[RTL] Partially sync wait.c with Wine Staging 1.7.55. By Samuel SerapiĆ³n. CORE-10536...
authorAmine Khaldi <amine.khaldi@reactos.org>
Sun, 29 Nov 2015 16:35:51 +0000 (16:35 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sun, 29 Nov 2015 16:35:51 +0000 (16:35 +0000)
svn path=/trunk/; revision=70200

reactos/lib/rtl/wait.c
reactos/media/doc/README.WINE

index 6a69da5..3dc1c2a 100644 (file)
@@ -44,7 +44,7 @@ Wait_thread_proc(LPVOID Arg)
 {
     PRTLP_WAIT Wait = (PRTLP_WAIT) Arg;
     NTSTATUS Status;
-    BOOLEAN alertable = (Wait->Flags & WT_EXECUTEINIOTHREAD) ? TRUE : FALSE;
+    BOOLEAN alertable = (Wait->Flags & WT_EXECUTEINIOTHREAD) != 0;
     HANDLE handles[2] = { Wait->Object, Wait->CancelEvent };
     LARGE_INTEGER timeout;
     HANDLE completion_event;
@@ -84,7 +84,7 @@ Wait_thread_proc(LPVOID Arg)
             if (Wait->Flags & WT_EXECUTEONLYONCE)
                 break;
         }
-        else
+        else if (Status != STATUS_USER_APC)
             break;
     }
 
@@ -157,7 +157,7 @@ RtlRegisterWait(PHANDLE NewWaitObject,
     Status = NtCreateEvent( &Wait->CancelEvent, 
                              EVENT_ALL_ACCESS, 
                              NULL,
-                             TRUE,
+                             NotificationEvent,
                              FALSE );
 
     if (Status != STATUS_SUCCESS)
@@ -166,9 +166,12 @@ RtlRegisterWait(PHANDLE NewWaitObject,
         return Status;
     }
 
+    Flags = Flags & (WT_EXECUTEINIOTHREAD | WT_EXECUTEINPERSISTENTTHREAD |
+                     WT_EXECUTELONGFUNCTION | WT_TRANSFER_IMPERSONATION);
+
     Status = RtlQueueWorkItem( Wait_thread_proc,
                                Wait,
-                               Flags & ~WT_EXECUTEONLYONCE );
+                               Flags );
 
     if (Status != STATUS_SUCCESS)
     {
@@ -214,7 +217,7 @@ RtlDeregisterWaitEx(HANDLE WaitHandle,
                 Status = NtCreateEvent( &CompletionEvent,
                                          EVENT_ALL_ACCESS,
                                          NULL,
-                                         TRUE,
+                                         NotificationEvent,
                                          FALSE );
 
                 if (Status != STATUS_SUCCESS)
index 6d5b65d..92d2697 100644 (file)
@@ -254,6 +254,7 @@ reactos/lib/3rdparty/strmbase               # Synced to WineStaging-1.7.55
 
 reactos/lib/rtl/actctx.c                    # Partly synced with WineStaging-1.7.55
 reactos/lib/rtl/timerqueue.c                # Partly synced with WineStaging-1.7.55
+reactos/lib/rtl/wait.c                      # Partly synced with WineStaging-1.7.55
 
 advapi32 -
   reactos/dll/win32/advapi32/wine/cred.c         # Synced to WineStaging-1.7.55