KD System Rewrite:
[reactos.git] / reactos / ntoskrnl / ke / event.c
index c4ab1aa..6dd6533 100644 (file)
@@ -1,11 +1,12 @@
-/* $Id$
+/*
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/ke/event.c
  * PURPOSE:         Implements events
  * 
- * PROGRAMMERS:     David Welch (welch@mcmail.com)
+ * PROGRAMMERS:     Alex Ionescu (alex@relsoft.net)
+ *                  David Welch (welch@mcmail.com)
  */
 
 /* INCLUDES *****************************************************************/
@@ -91,7 +92,7 @@ KePulseEvent(IN PKEVENT Event,
         Event->Header.SignalState = 1;
     
         /* Wake the Event */
-        KiDispatcherObjectWake(&Event->Header, Increment);
+        KiWaitTest(&Event->Header, Increment);
     }
     
     /* Unsignal it */
@@ -196,14 +197,14 @@ KeSetEvent(PKEVENT Event,
                 /* We must do a full wait satisfaction */
                 DPRINT("Notification Event or WaitAll, Wait on the Event and Signal\n");
                 Event->Header.SignalState = 1;
-                KiDispatcherObjectWake(&Event->Header, Increment);
+                KiWaitTest(&Event->Header, Increment);
             }
                 
         } else {
         
             /* We can satisfy wait simply by waking the thread, since our signal state is 0 now */        
             DPRINT("WaitAny or Sync Event, just unwait the thread\n");
-            KiAbortWaitThread(WaitBlock->Thread, WaitBlock->WaitKey);
+            KiAbortWaitThread(WaitBlock->Thread, WaitBlock->WaitKey, Increment);
         }
     }
     
@@ -259,7 +260,7 @@ KeSetEventBoostPriority(IN PKEVENT Event,
 
         /* Reset the Quantum and Unwait the Thread */
         WaitingThread->Quantum = WaitingThread->ApcState.Process->ThreadQuantum;
-        KiAbortWaitThread(WaitingThread, STATUS_SUCCESS);
+        KiAbortWaitThread(WaitingThread, STATUS_SUCCESS, EVENT_INCREMENT);
     }
    
     /* Release the Dispatcher Database Lock */