mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
fixed the prototype of KePulseEvent() and made NtPulseEvent() return the previous state
svn path=/trunk/; revision=13209
This commit is contained in:
parent
72ae3c4197
commit
1be6d7bcaa
4 changed files with 24 additions and 12 deletions
|
@ -218,9 +218,9 @@ VOID STDCALL KeLeaveCriticalRegion (VOID);
|
|||
|
||||
VOID STDCALL KeLowerIrql (KIRQL NewIrql);
|
||||
|
||||
NTSTATUS STDCALL KePulseEvent (PKEVENT Event,
|
||||
KPRIORITY Increment,
|
||||
BOOLEAN Wait);
|
||||
LONG STDCALL KePulseEvent (PKEVENT Event,
|
||||
KPRIORITY Increment,
|
||||
BOOLEAN Wait);
|
||||
|
||||
LARGE_INTEGER
|
||||
STDCALL
|
||||
|
|
|
@ -295,10 +295,21 @@ NtPulseEvent(IN HANDLE EventHandle,
|
|||
NULL);
|
||||
if(NT_SUCCESS(Status))
|
||||
{
|
||||
KePulseEvent(Event, EVENT_INCREMENT, FALSE);
|
||||
LONG Prev = KePulseEvent(Event, EVENT_INCREMENT, FALSE);
|
||||
ObDereferenceObject(Event);
|
||||
|
||||
/* FIXME - Return the previous state! */
|
||||
if(PreviousState != NULL)
|
||||
{
|
||||
_SEH_TRY
|
||||
{
|
||||
*PreviousState = Prev;
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
Status = _SEH_GetExceptionCode();
|
||||
}
|
||||
_SEH_END;
|
||||
}
|
||||
}
|
||||
|
||||
return Status;
|
||||
|
|
|
@ -108,16 +108,17 @@ LONG STDCALL KeSetEvent (PKEVENT Event,
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
NTSTATUS STDCALL KePulseEvent (PKEVENT Event,
|
||||
KPRIORITY Increment,
|
||||
BOOLEAN Wait)
|
||||
LONG STDCALL
|
||||
KePulseEvent (IN PKEVENT Event,
|
||||
IN KPRIORITY Increment,
|
||||
IN BOOLEAN Wait)
|
||||
{
|
||||
KIRQL OldIrql;
|
||||
int ret;
|
||||
LONG Ret;
|
||||
|
||||
DPRINT("KePulseEvent(Event %x, Wait %x)\n",Event,Wait);
|
||||
OldIrql = KeAcquireDispatcherDatabaseLock();
|
||||
ret = InterlockedExchange(&Event->Header.SignalState,1);
|
||||
Ret = InterlockedExchange(&Event->Header.SignalState,1);
|
||||
KiDispatcherObjectWake(&Event->Header, Increment);
|
||||
InterlockedExchange(&(Event->Header.SignalState),0);
|
||||
|
||||
|
@ -132,7 +133,7 @@ NTSTATUS STDCALL KePulseEvent (PKEVENT Event,
|
|||
Thread->WaitIrql = OldIrql;
|
||||
}
|
||||
|
||||
return ((NTSTATUS)ret);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -7607,7 +7607,7 @@ KeLeaveCriticalRegion(
|
|||
VOID);
|
||||
|
||||
NTOSAPI
|
||||
NTSTATUS
|
||||
LONG
|
||||
DDKAPI
|
||||
KePulseEvent(
|
||||
IN PRKEVENT Event,
|
||||
|
|
Loading…
Reference in a new issue