1 in front of the bwait meaning of GetOverlappedResult
The bwait meaning of GetOverlappedResult indicates whether it is necessary to wait, if IO is still in the pending state, the internal approximate implementation is like this
Hobject = lpoverlapped->hevent? lpoverlapped->hevent:hfile;
Waitstatus = WaitForSingleObject (hobject, INFINITE);
Why overlapped inside to have hevent this field, why use? Suppose such a scenario, open a file handle, initiate multiple asynchronous read requests, and how does the request complete know which read request to correspond to? By hfile, it is clear that there is no need to allocate an event for each IO request, and when the IO is complete, the event is set to a trusted state. Because WaitForMultipleObjectsEx can only deliver up to 64 handles, requests that can be processed at the same time are limited to 64
Asynchronous mechanism-Overlapped