Author: hbelusca Date: Sat Oct 5 22:17:34 2013 New Revision: 60551
URL: http://svn.reactos.org/svn/reactos?rev=60551&view=rev Log: [CSRSRV][CONSRV] - 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 ...
Modified: trunk/reactos/include/reactos/subsys/csr/csrsrv.h trunk/reactos/subsystems/win32/csrsrv/wait.c trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c trunk/reactos/win32ss/user/winsrv/consrv/console.c trunk/reactos/win32ss/user/winsrv/consrv/handle.c
Modified: trunk/reactos/include/reactos/subsys/csr/csrsrv.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/csr/... ============================================================================== --- trunk/reactos/include/reactos/subsys/csr/csrsrv.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/subsys/csr/csrsrv.h [iso-8859-1] Sat Oct 5 22:17:34 2013 @@ -349,7 +349,7 @@ BOOLEAN NTAPI CsrNotifyWait(IN PLIST_ENTRY WaitList, - IN ULONG WaitType, + IN BOOLEAN NotifyAll, IN PVOID WaitArgument1, IN PVOID WaitArgument2);
Modified: trunk/reactos/subsystems/win32/csrsrv/wait.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrsrv/wai... ============================================================================== --- trunk/reactos/subsystems/win32/csrsrv/wait.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrsrv/wait.c [iso-8859-1] Sat Oct 5 22:17:34 2013 @@ -372,8 +372,8 @@ * @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 @@ BOOLEAN NTAPI CsrNotifyWait(IN PLIST_ENTRY WaitList, - IN ULONG WaitType, + IN BOOLEAN NotifyAll, IN PVOID WaitArgument1, IN PVOID WaitArgument2) { @@ -420,8 +420,11 @@ 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; } }
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv/... ============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c [iso-8859-1] Sat Oct 5 22:17:34 2013 @@ -101,7 +101,7 @@
SetEvent(Console->InputBuffer.ActiveEvent); CsrNotifyWait(&Console->InputBuffer.ReadWaitQueue, - WaitAny, + FALSE, NULL, NULL); if (!IsListEmpty(&Console->InputBuffer.ReadWaitQueue))
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv/... ============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1] Sat Oct 5 22:17:34 2013 @@ -282,7 +282,7 @@ Console->UnpauseEvent = NULL;
CsrNotifyWait(&Console->WriteWaitQueue, - WaitAll, + TRUE, NULL, NULL); if (!IsListEmpty(&Console->WriteWaitQueue))
Modified: trunk/reactos/win32ss/user/winsrv/consrv/console.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv/... ============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/console.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/console.c [iso-8859-1] Sat Oct 5 22:17:34 2013 @@ -123,7 +123,7 @@ Console->UnpauseEvent = NULL;
CsrNotifyWait(&Console->WriteWaitQueue, - WaitAll, + TRUE, NULL, NULL); if (!IsListEmpty(&Console->WriteWaitQueue))
Modified: trunk/reactos/win32ss/user/winsrv/consrv/handle.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv/... ============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/handle.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/handle.c [iso-8859-1] Sat Oct 5 22:17:34 2013 @@ -89,7 +89,7 @@ * return. */ CsrNotifyWait(&InputBuffer->ReadWaitQueue, - WaitAll, + TRUE, NULL, (PVOID)Entry); if (!IsListEmpty(&InputBuffer->ReadWaitQueue))