Andrew Eikum aeikum@codeweavers.com writes:
@@ -1636,13 +1638,30 @@ DWORD events_loop(void)
do {
err = WaitForMultipleObjects(2, wait_handles, FALSE, timeout);
num_handles = 2;
/* monitor tracked process handles for process end */
EnterCriticalSection(&timeout_queue_cs);
LIST_FOR_EACH_ENTRY(iter, &timeout_queue, struct timeout_queue_elem, entry)
{
if(num_handles == max_handles)
{
max_handles++;
wait_handles = HeapReAlloc(GetProcessHeap(), 0, wait_handles, sizeof(HANDLE) * max_handles);
}
You don't need heap allocation, you can't wait for more than MAXIMUM_WAIT_OBJECTS anyway.