Sebastian Lackner : ole32: Don' t process window events when APC calls are queued.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Nov 21 09:11:39 CST 2014


Module: wine
Branch: master
Commit: f6f55058e4853d7685467af74e90b428a6234941
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f6f55058e4853d7685467af74e90b428a6234941

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Wed Nov  5 00:49:59 2014 +0100

ole32: Don't process window events when APC calls are queued.

---

 dlls/ole32/compobj.c       | 17 ++++++++++++++---
 dlls/ole32/tests/compobj.c |  1 -
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index 1d9b943..da466c4 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -4427,6 +4427,7 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
     DWORD start_time = GetTickCount();
     APARTMENT *apt = COM_CurrentApt();
     BOOL message_loop = apt && !apt->multi_threaded;
+    BOOL check_apc = (dwFlags & COWAIT_ALERTABLE) != 0;
 
     TRACE("(0x%08x, 0x%08x, %d, %p, %p)\n", dwFlags, dwTimeout, cHandles,
         pHandles, lpdwindex);
@@ -4460,9 +4461,19 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
 
             TRACE("waiting for rpc completion or window message\n");
 
-            res = MsgWaitForMultipleObjectsEx(cHandles, pHandles,
-                (dwTimeout == INFINITE) ? INFINITE : start_time + dwTimeout - now,
-                QS_SENDMESSAGE | QS_ALLPOSTMESSAGE | QS_PAINT, wait_flags);
+            res = WAIT_TIMEOUT;
+
+            if (check_apc)
+            {
+                res = WaitForMultipleObjectsEx(cHandles, pHandles,
+                    (dwFlags & COWAIT_WAITALL) != 0, 0, TRUE);
+                check_apc = FALSE;
+            }
+
+            if (res == WAIT_TIMEOUT)
+                res = MsgWaitForMultipleObjectsEx(cHandles, pHandles,
+                    (dwTimeout == INFINITE) ? INFINITE : start_time + dwTimeout - now,
+                    QS_SENDMESSAGE | QS_ALLPOSTMESSAGE | QS_PAINT, wait_flags);
 
             if (res == WAIT_OBJECT_0 + cHandles)  /* messages available */
             {
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index 38b21c9..eed5ac8 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -2241,7 +2241,6 @@ static void test_CoWaitForMultipleHandles(void)
     ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
     ok(index == WAIT_IO_COMPLETION, "expected index WAIT_IO_COMPLETION, got %u\n", index);
     success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE);
-    todo_wine
     ok(success, "CoWaitForMultipleHandles unexpectedly pumped messages\n");
 
     /* test with COWAIT_INPUTAVAILABLE (semaphores are still locked) */




More information about the wine-cvs mailing list