Fix horridly wrong SignalObjectAndWait return values, should make more wine tests pass
Modified: trunk/reactos/lib/kernel32/synch/wait.c

Modified: trunk/reactos/lib/kernel32/synch/wait.c
--- trunk/reactos/lib/kernel32/synch/wait.c	2005-08-07 23:08:07 UTC (rev 17186)
+++ trunk/reactos/lib/kernel32/synch/wait.c	2005-08-07 23:18:40 UTC (rev 17187)
@@ -266,7 +266,7 @@
 	{
 	  DPRINT1("Console handles are not supported yet!\n");
 	  SetLastError(ERROR_INVALID_HANDLE);
-	  return FALSE;
+	  return WAIT_FAILED;
 	}
     }
 
@@ -280,6 +280,7 @@
       TimePtr = &Time;
     }
 
+WaitAgain:
   Status = NtSignalAndWaitForSingleObject (hObjectToSignal,
 					   hObjectToWaitOn,
 					   (BOOLEAN)bAlertable,
@@ -287,10 +288,12 @@
   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 */