Alexandre Julliard : user: Abort WaitForUserIdle if the target process died .

Alexandre Julliard julliard at wine.codeweavers.com
Sat Jul 29 05:22:11 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 293d7ab6885e5e4a0e20503d14ce775db69292ea
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=293d7ab6885e5e4a0e20503d14ce775db69292ea

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Jul 28 18:01:50 2006 +0200

user: Abort WaitForUserIdle if the target process died.

---

 dlls/user/message.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/dlls/user/message.c b/dlls/user/message.c
index 6351ff3..c7a9a6c 100644
--- a/dlls/user/message.c
+++ b/dlls/user/message.c
@@ -3179,27 +3179,30 @@ DWORD WINAPI MsgWaitForMultipleObjects( 
 DWORD WINAPI WaitForInputIdle( HANDLE hProcess, DWORD dwTimeOut )
 {
     DWORD start_time, elapsed, ret;
-    HANDLE idle_event = (HANDLE)-1;
+    HANDLE handles[2];
 
+    handles[0] = hProcess;
     SERVER_START_REQ( get_process_idle_event )
     {
         req->handle = hProcess;
-        if (!(ret = wine_server_call_err( req ))) idle_event = reply->event;
+        if (!(ret = wine_server_call_err( req ))) handles[1] = reply->event;
     }
     SERVER_END_REQ;
     if (ret) return WAIT_FAILED;  /* error */
-    if (!idle_event) return 0;  /* no event to wait on */
+    if (!handles[1]) return 0;  /* no event to wait on */
 
     start_time = GetTickCount();
     elapsed = 0;
 
-    TRACE("waiting for %p\n", idle_event );
+    TRACE("waiting for %p\n", handles[1] );
     do
     {
-        ret = MsgWaitForMultipleObjects ( 1, &idle_event, FALSE, dwTimeOut - elapsed, QS_SENDMESSAGE );
+        ret = MsgWaitForMultipleObjects ( 2, handles, FALSE, dwTimeOut - elapsed, QS_SENDMESSAGE );
         switch (ret)
         {
-        case WAIT_OBJECT_0+1:
+        case WAIT_OBJECT_0:
+            return WAIT_FAILED;
+        case WAIT_OBJECT_0+2:
             process_sent_messages();
             break;
         case WAIT_TIMEOUT:




More information about the wine-cvs mailing list