fixed the prototype of KePulseEvent() and made NtPulseEvent() return the previous state

svn path=/trunk/; revision=13209
This commit is contained in:
Thomas Bluemel 2005-01-22 12:45:03 +00:00
parent 72ae3c4197
commit 1be6d7bcaa
4 changed files with 24 additions and 12 deletions

View file

@ -218,9 +218,9 @@ VOID STDCALL KeLeaveCriticalRegion (VOID);
VOID STDCALL KeLowerIrql (KIRQL NewIrql); VOID STDCALL KeLowerIrql (KIRQL NewIrql);
NTSTATUS STDCALL KePulseEvent (PKEVENT Event, LONG STDCALL KePulseEvent (PKEVENT Event,
KPRIORITY Increment, KPRIORITY Increment,
BOOLEAN Wait); BOOLEAN Wait);
LARGE_INTEGER LARGE_INTEGER
STDCALL STDCALL

View file

@ -295,10 +295,21 @@ NtPulseEvent(IN HANDLE EventHandle,
NULL); NULL);
if(NT_SUCCESS(Status)) if(NT_SUCCESS(Status))
{ {
KePulseEvent(Event, EVENT_INCREMENT, FALSE); LONG Prev = KePulseEvent(Event, EVENT_INCREMENT, FALSE);
ObDereferenceObject(Event); ObDereferenceObject(Event);
/* FIXME - Return the previous state! */ if(PreviousState != NULL)
{
_SEH_TRY
{
*PreviousState = Prev;
}
_SEH_HANDLE
{
Status = _SEH_GetExceptionCode();
}
_SEH_END;
}
} }
return Status; return Status;

View file

@ -108,16 +108,17 @@ LONG STDCALL KeSetEvent (PKEVENT Event,
/* /*
* @implemented * @implemented
*/ */
NTSTATUS STDCALL KePulseEvent (PKEVENT Event, LONG STDCALL
KPRIORITY Increment, KePulseEvent (IN PKEVENT Event,
BOOLEAN Wait) IN KPRIORITY Increment,
IN BOOLEAN Wait)
{ {
KIRQL OldIrql; KIRQL OldIrql;
int ret; LONG Ret;
DPRINT("KePulseEvent(Event %x, Wait %x)\n",Event,Wait); DPRINT("KePulseEvent(Event %x, Wait %x)\n",Event,Wait);
OldIrql = KeAcquireDispatcherDatabaseLock(); OldIrql = KeAcquireDispatcherDatabaseLock();
ret = InterlockedExchange(&Event->Header.SignalState,1); Ret = InterlockedExchange(&Event->Header.SignalState,1);
KiDispatcherObjectWake(&Event->Header, Increment); KiDispatcherObjectWake(&Event->Header, Increment);
InterlockedExchange(&(Event->Header.SignalState),0); InterlockedExchange(&(Event->Header.SignalState),0);
@ -132,7 +133,7 @@ NTSTATUS STDCALL KePulseEvent (PKEVENT Event,
Thread->WaitIrql = OldIrql; Thread->WaitIrql = OldIrql;
} }
return ((NTSTATUS)ret); return Ret;
} }
/* /*

View file

@ -7607,7 +7607,7 @@ KeLeaveCriticalRegion(
VOID); VOID);
NTOSAPI NTOSAPI
NTSTATUS LONG
DDKAPI DDKAPI
KePulseEvent( KePulseEvent(
IN PRKEVENT Event, IN PRKEVENT Event,