When asynchronous I/O (or "overlapped" I/O in Win32 jargon) is used, we need to deal with the OVERLAPPED
structure and his hEvent
member. If the I/O function will delay the read or write operation, we will get an ERROR_IO_PENDING
error code, then we will wait the asynchronous operation to complete with a WaitForXxxEvent
function, then we will call GetOverlappedResult
.
However, if the I/O operation is immediately completed, we will not get ERROR_IO_PENDING
, and in a read operation our read buffer will be filled immediately. But what about the OVERLAPPED::hEvent
member? Will it be set to signaled state? I've not found a clear statement about that.
This question may seem pointless (why deal with the event if I know that the operation is already completed?), however I have a library that mimics the overlapped pattern and I need to have the same exact behavior.