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?
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.
-
-
I was wondering which one Windows implemented. I will probably just end up testing experimentally and see what the deal is, but it can be hard to know if the behavior differs on different Windows platforms.
-
ah, I see (that's really the only interesting interpretation of your question, now that I think about it). I suspect there is an internal ref, but I haven't run into this before.
- Show replies
New conversation -
-
-
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..
-
This is a Microsoft API we're talking about here...
End of conversation
New conversation -
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.