Sync with trunk r63935.
[reactos.git] / ntoskrnl / ob / obwait.c
index cf68a5f..98b4ca8 100644 (file)
@@ -117,7 +117,8 @@ NtWaitForMultipleObjects(IN ULONG ObjectCount,
     _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
     {
         /* Return the exception code */
-        _SEH2_YIELD(return _SEH2_GetExceptionCode());
+        Status = _SEH2_GetExceptionCode();
+        _SEH2_YIELD(goto Quickie);
     }
     _SEH2_END;
 
@@ -141,7 +142,7 @@ NtWaitForMultipleObjects(IN ULONG ObjectCount,
     do
     {
         /* Use the right Executive Handle */
-        if (ObIsKernelHandle(Handles[i], PreviousMode))
+        if (ObpIsKernelHandle(Handles[i], PreviousMode))
         {
             /* Use the System Handle Table and decode */
             HandleTable = ObpKernelHandleTable;
@@ -164,6 +165,7 @@ NtWaitForMultipleObjects(IN ULONG ObjectCount,
         {
             /* Fail, handle is invalid */
             Status = STATUS_INVALID_HANDLE;
+            DPRINT1("Invalid handle passed to NtWaitForMultipleObjects\n");
             goto Quickie;
         }
 
@@ -173,6 +175,7 @@ NtWaitForMultipleObjects(IN ULONG ObjectCount,
         {
             /* Unlock the entry and fail */
             ExUnlockHandleTableEntry(HandleTable, HandleEntry);
+            DPRINT1("Handle does not have SYNCHRONIZE access\n");
             Status = STATUS_ACCESS_DENIED;
             goto Quickie;
         }
@@ -227,6 +230,7 @@ NtWaitForMultipleObjects(IN ULONG ObjectCount,
                 {
                     /* Fail */
                     Status = STATUS_INVALID_PARAMETER_MIX;
+                    DPRINT1("Passed a duplicate object to NtWaitForMultipleObjects\n");
                     goto Quickie;
                 }
             }
@@ -416,6 +420,10 @@ NtWaitForSingleObject(IN HANDLE ObjectHandle,
         /* Dereference the Object */
         ObDereferenceObject(Object);
     }
+    else
+    {
+        DPRINT1("Failed to reference the handle with status 0x%x\n", Status);
+    }
 
     /* Return the status */
     return Status;