So, in the answer of this question Proper way close WinAPI HANDLEs (avoiding of repeated closing) the answerer creates a HandleWrapper template, which you can use like this:
HandleWrapper<KernelHandleTraits> hFile(CreateFile(...))
and hFile will be destroyed when it gets out of scope.
In your code there also may be lines similar to this:
ReadFile(hFile(), ...)
I am wondering how the template or class for a Handle would look like, if I wanted to use it like this:
ReadFile(hFile, ...)
Note the missing parenthesis. Is there any C++ trick to achieve this?