[PATCH 1/3] services: Monitor process handles for process quit
Alexandre Julliard
julliard at winehq.org
Wed Feb 25 22:34:44 CST 2015
Andrew Eikum <aeikum at 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.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list