On Thu, 8 Mar 2007, Alexandre Julliard wrote: [...]
Note that a valid file handle will never be NULL, so while these checks are wrong in theory, in practice it makes no difference.
Right. But the invalid check means that in some cases we will call CloseHandle(INVALID_HANDLE_VALUE) which the MSDN has this to say about:
If the application is running under a debugger, the function will throw an exception if it receives either a handle value that is not valid or a pseudo-handle value. This can happen if you close a handle twice, or if you call CloseHandle on a handle returned by the FindFirstFile function.
I did not check but I guess Wine does not do that... so far. It's still best avoided.