ole32: Post quit message after leaving wait loop in CoWaitForMultipleHandles.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-01-22 17:05:34 +01:00 committed by Alexandre Julliard
parent 7ff0881775
commit f4b1454f33
1 changed files with 5 additions and 1 deletions

View File

@ -4467,6 +4467,8 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
APARTMENT *apt = COM_CurrentApt();
BOOL message_loop = apt && !apt->multi_threaded;
BOOL check_apc = (dwFlags & COWAIT_ALERTABLE) != 0;
BOOL post_quit = FALSE;
UINT exit_code;
TRACE("(0x%08x, 0x%08x, %d, %p, %p)\n", dwFlags, dwTimeout, cHandles,
pHandles, lpdwindex);
@ -4563,7 +4565,8 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
if (msg.message == WM_QUIT)
{
TRACE("resending WM_QUIT to outer message loop\n");
PostQuitMessage(msg.wParam);
post_quit = TRUE;
exit_code = msg.wParam;
/* no longer need to process messages */
message_loop = FALSE;
break;
@ -4595,6 +4598,7 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
}
break;
}
if (post_quit) PostQuitMessage(exit_code);
TRACE("-- 0x%08x\n", hr);
return hr;
}