mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +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);
|
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
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -7607,7 +7607,7 @@ KeLeaveCriticalRegion(
|
||||||
VOID);
|
VOID);
|
||||||
|
|
||||||
NTOSAPI
|
NTOSAPI
|
||||||
NTSTATUS
|
LONG
|
||||||
DDKAPI
|
DDKAPI
|
||||||
KePulseEvent(
|
KePulseEvent(
|
||||||
IN PRKEVENT Event,
|
IN PRKEVENT Event,
|
||||||
|
|
Loading…
Reference in a new issue