From 7905e74e5939f3b7050c93da955371d7bb169c0d Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Sun, 7 Aug 2005 23:18:40 +0000 Subject: [PATCH] Fix horridly wrong SignalObjectAndWait return values, should make more wine tests pass svn path=/trunk/; revision=17187 --- reactos/lib/kernel32/synch/wait.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/reactos/lib/kernel32/synch/wait.c b/reactos/lib/kernel32/synch/wait.c index 67f2b98a4fe..eb1079dd20d 100644 --- a/reactos/lib/kernel32/synch/wait.c +++ b/reactos/lib/kernel32/synch/wait.c @@ -266,7 +266,7 @@ SignalObjectAndWait(HANDLE hObjectToSignal, { DPRINT1("Console handles are not supported yet!\n"); SetLastError(ERROR_INVALID_HANDLE); - return FALSE; + return WAIT_FAILED; } } @@ -280,6 +280,7 @@ SignalObjectAndWait(HANDLE hObjectToSignal, TimePtr = &Time; } +WaitAgain: Status = NtSignalAndWaitForSingleObject (hObjectToSignal, hObjectToWaitOn, (BOOLEAN)bAlertable, @@ -287,10 +288,12 @@ SignalObjectAndWait(HANDLE hObjectToSignal, if (!NT_SUCCESS(Status)) { SetLastErrorByStatus (Status); - return FALSE; + return WAIT_FAILED; } + if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain; - return TRUE; + /* STATUS_SUCCESS maps to WAIT_OBJECT_0 */ + return Status; } /* EOF */