[CSRSRV][CONSRV]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 5 Oct 2013 22:17:34 +0000 (22:17 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 5 Oct 2013 22:17:34 +0000 (22:17 +0000)
- Fix the second parameter WaitType (aka. NotifyAll) of CsrNotifyWait. Indeed, we used before the constants WaitAll == 0 / WaitAny == 1 (see the WAIT_TYPE enum); however, it appeared that Win2k3's CsrNotifyWait wanted a WaitType parameter == 1 when waiting for all the waits in a given wait-list. Therefore we would have to use WaitAll for waiting for any of the wait blocks, and WaitAny for waiting for all the wait blocks... looks illogical. Therefore I use instead a BOOLEAN variable (that I call NotifyAll) which is TRUE when I want to wait for all the wait blocks, and FALSE otherwise (as done e.g. for the WaitForMultipleObjects API).
- Fix its usage in CONSRV.

Magically fix key presses problems in console, when using Win2k3 csrsrv.dll ...

svn path=/trunk/; revision=60551

reactos/include/reactos/subsys/csr/csrsrv.h
reactos/subsystems/win32/csrsrv/wait.c
reactos/win32ss/user/winsrv/consrv/condrv/coninput.c
reactos/win32ss/user/winsrv/consrv/condrv/console.c
reactos/win32ss/user/winsrv/consrv/console.c
reactos/win32ss/user/winsrv/consrv/handle.c

index a8bf5d2..b904710 100644 (file)
@@ -349,7 +349,7 @@ CsrMoveSatisfiedWait(IN PLIST_ENTRY DestinationList,
 BOOLEAN
 NTAPI
 CsrNotifyWait(IN PLIST_ENTRY WaitList,
-              IN ULONG WaitType,
+              IN BOOLEAN NotifyAll,
               IN PVOID WaitArgument1,
               IN PVOID WaitArgument2);
 
index e9e4d2f..8a599dc 100644 (file)
@@ -372,8 +372,8 @@ CsrMoveSatisfiedWait(IN PLIST_ENTRY DestinationList,
  * @param WaitList
  *        Pointer to the wait list whose wait blocks will be notified.
  *
- * @param WaitType
- *        Type of the wait to perform, either WaitAny or WaitAll.
+ * @param NotifyAll
+ *        Whether or not we must notify all the waits.
  *
  * @param WaitArgument[1-2]
  *        User-defined argument to pass on to the wait function.
@@ -386,7 +386,7 @@ CsrMoveSatisfiedWait(IN PLIST_ENTRY DestinationList,
 BOOLEAN
 NTAPI
 CsrNotifyWait(IN PLIST_ENTRY WaitList,
-              IN ULONG WaitType,
+              IN BOOLEAN NotifyAll,
               IN PVOID WaitArgument1,
               IN PVOID WaitArgument2)
 {
@@ -420,8 +420,11 @@ CsrNotifyWait(IN PLIST_ENTRY WaitList,
                                                 0,
                                                 FALSE);
             
-            /* We've already done a wait, so leave unless this is a Wait All */
-            if (WaitType != WaitAll) break;
+            /*
+             * We've already done a wait, so leave unless
+             * we want to notify all the waits...
+             */
+            if (!NotifyAll) break;
         }
     }
 
index 3803130..d013ea8 100644 (file)
@@ -101,7 +101,7 @@ ConioProcessInputEvent(PCONSOLE Console,
 
     SetEvent(Console->InputBuffer.ActiveEvent);
     CsrNotifyWait(&Console->InputBuffer.ReadWaitQueue,
-                  WaitAny,
+                  FALSE,
                   NULL,
                   NULL);
     if (!IsListEmpty(&Console->InputBuffer.ReadWaitQueue))
index 0c4cb6a..fa4562f 100644 (file)
@@ -282,7 +282,7 @@ ConioUnpause(PCONSOLE Console, UINT Flags)
         Console->UnpauseEvent = NULL;
 
         CsrNotifyWait(&Console->WriteWaitQueue,
-                      WaitAll,
+                      TRUE,
                       NULL,
                       NULL);
         if (!IsListEmpty(&Console->WriteWaitQueue))
index 0b7e2fa..1b0e788 100644 (file)
@@ -123,7 +123,7 @@ ConioUnpause(PCONSOLE Console, UINT Flags)
         Console->UnpauseEvent = NULL;
 
         CsrNotifyWait(&Console->WriteWaitQueue,
-                      WaitAll,
+                      TRUE,
                       NULL,
                       NULL);
         if (!IsListEmpty(&Console->WriteWaitQueue))
index 84384db..47900de 100644 (file)
@@ -89,7 +89,7 @@ ConSrvCloseHandleEntry(PCONSOLE_IO_HANDLE Entry)
              * return.
              */
             CsrNotifyWait(&InputBuffer->ReadWaitQueue,
-                          WaitAll,
+                          TRUE,
                           NULL,
                           (PVOID)Entry);
             if (!IsListEmpty(&InputBuffer->ReadWaitQueue))