Alexandre Julliard : ole32: Limit the number of messages processed at once in CoWaitForMultipleObjects .

Alexandre Julliard julliard at winehq.org
Wed Dec 12 15:14:55 CST 2012


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Dec 12 14:06:46 2012 +0100

ole32: Limit the number of messages processed at once in CoWaitForMultipleObjects.

---

 dlls/ole32/compobj.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index af5b0fe..460ed4e 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -3871,6 +3871,7 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
             if (res == WAIT_OBJECT_0 + cHandles)  /* messages available */
             {
                 MSG msg;
+                int count = 0;
 
                 /* call message filter */
 
@@ -3900,7 +3901,9 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
                     }
                 }
 
-                while (COM_PeekMessage(apt, &msg))
+                /* some apps (e.g. Visio 2010) don't handle WM_PAINT properly and loop forever,
+                 * so after processing 100 messages we go back to checking the wait handles */
+                while (count++ < 100 && COM_PeekMessage(apt, &msg))
                 {
                     TRACE("received message whilst waiting for RPC: 0x%04x\n", msg.message);
                     TranslateMessage(&msg);




More information about the wine-cvs mailing list