What do you mean by "it will also interfere with the existing and somewhat intricate read process"?
If you want to use WaitOnMultipleObjects function then you either wait for any handle to get signaled, or wait for all of them get signaled. And you can either block infinitely, return immediately (basically a boolean check), or wait approximate time.
Something like this (if you want to wait for any of events and want to block):
| HANDLE events[] = { overlapped1.hEvent, oeverlapped2.hEvent };
DWORD ret = WaitOnMultipleObjects(2, events, FALSE, INFINITE);
if (ret == WAIT_OBJECT_0)
{
// do something with overlapped1
}
else if (ret == WAIT_OBJECT_0 + 1)
{
// do something with overlapped2
}
|
Or if can have code that will periodically check the result of handle with WaitForSingleObject, useful for sticking it in game loop:
| if (WaitForSingleObject(overlapped1.hEvent, 0) == WAIT_OBJECT_0) // will not block
{
// do something with overlapped1
}
// else it nothing happened with overlapped1, so skip it and check it later
|