Win32 internals question: is the kernel assumed to increment the reference count of a HANDLE during overlapped I/O, such that the "correct" time to CloseHandle is after all I/O is _issued_ rather than completed? Or is it not incremented, so the CloseHandle must be deferred?
-
-
Replying to @cmuratori
Are you asking about hEvent? The kernel has to increment the refcount itself if you passed it in, or else it couldn't safely SetEvent at completion. But if you close the handle just after it's issued, you can't wait on completion using that event, right?
1 reply 0 retweets 0 likes -
This Tweet is unavailable.
-
Replying to @cmuratori @_knutaf
If the overlapped IO adds a ref to the hFile, then the CloseHandle() won't close the file handle, it'll wait until the IO is finished. If the overlapped IO doesn't add a ref, then the CloseHandle will force close the file handle, (probably) cancelling the IO in flight.
2 replies 0 retweets 0 likes -
Replying to @cmuratori @_knutaf
A quick scan of Windows Internals didn't turn anything up, But I would expect the answer to be the former if the developers had any sense..
1 reply 0 retweets 0 likes
This is a Microsoft API we're talking about here...
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.