[Vortex] [PATCH] guard win32 close calls [3/5]
b.amiaux at ateme.com
Mon Feb 11 09:27:20 CET 2008
Yourch, Chris wrote:
> It looks like the macro is structure this way so an extra trailing
> semi-colon won't cause trouble. If that is the case, structure the macro
> as follows using the "do while loop" trick
The do/while trick should work fine too, and it's more classic/understood
> Also, and this is VERY important, an invalid handle, as returned from
> CreateFile(), is an INVALID_HANDLE_VALUE and not a NULL. In addition, if
> the handle is from FindFirstFile() then FindClose() should be called,
> not CloseHandle().
> What kinds of handles is this macro called for?
It's used for locks. Now that I think about it, it would be best not to
apply this patch but fix the real issue, which is that some locks are
not properly initialized before use.
More information about the Vortex