"Alexander Grigoriev" <alegr@earthlink.net> wrote in message
news:esUSDHFGIHA.1212@TK2MSFTNGP05.phx.gbl...
The rules are:
1. Create an event per OVERLAPPED.
2. Events used for notification should be manual reset. Such as used for
overlapped IO. Pattern of use: reset the event before you start an
operation that may signal it. The event gets set only once per use cycle.
Although, if you listen from the same thread, set the event before
starting an operation, the functions like ReadFile, WriteFile will reset
the event if the operation goes overlapped.
You do not need to reset the event.
"ReadFile resets the event specified by the hEvent member of the
OVERLAPPED structure to a nonsignaled state when it begins the I/O
operation. Therefore, the caller does not need to do that."
I was telling about general pattern, not Read/Write file. In Read/Write
case, "reset event" part is done for you. But it's done.