ntoskrnl.exe: Implement KeReadStateEvent.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
65df36c115
commit
72540c9301
|
@ -599,7 +599,7 @@
|
|||
@ stdcall KeQueryTickCount(ptr)
|
||||
@ stdcall KeQueryTimeIncrement()
|
||||
@ stub KeRaiseUserException
|
||||
@ stub KeReadStateEvent
|
||||
@ stdcall KeReadStateEvent(ptr)
|
||||
@ stub KeReadStateMutant
|
||||
@ stub KeReadStateMutex
|
||||
@ stub KeReadStateQueue
|
||||
|
|
|
@ -311,6 +311,28 @@ void WINAPI KeClearEvent( PRKEVENT event )
|
|||
KeResetEvent( event );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* KeReadStateEvent (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
LONG WINAPI KeReadStateEvent( PRKEVENT event )
|
||||
{
|
||||
HANDLE handle;
|
||||
|
||||
TRACE("event %p.\n", event);
|
||||
|
||||
if (event->Header.WaitListHead.Blink == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
if (!(ObOpenObjectByPointer( event, OBJ_KERNEL_HANDLE, NULL, EVENT_QUERY_STATE, NULL, KernelMode, &handle )))
|
||||
{
|
||||
EVENT_BASIC_INFORMATION event_info;
|
||||
if (!(NtQueryEvent( handle, EventBasicInformation, &event_info, sizeof(event_info), NULL)))
|
||||
event->Header.SignalState = event_info.EventState;
|
||||
NtClose( handle );
|
||||
}
|
||||
}
|
||||
return event->Header.SignalState;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* KeInitializeSemaphore (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
|
|
|
@ -467,8 +467,14 @@ static void test_sync(void)
|
|||
ret = wait_single(&manual_event, 0);
|
||||
ok(ret == STATUS_TIMEOUT, "got %#x\n", ret);
|
||||
|
||||
ret = KeReadStateEvent(&manual_event);
|
||||
ok(ret == 0, "got %d\n", ret);
|
||||
|
||||
KeSetEvent(&manual_event, 0, FALSE);
|
||||
|
||||
ret = KeReadStateEvent(&manual_event);
|
||||
ok(ret == 1, "got %d\n", ret);
|
||||
|
||||
ret = wait_single(&manual_event, 0);
|
||||
ok(ret == 0, "got %#x\n", ret);
|
||||
|
||||
|
@ -561,9 +567,14 @@ static void test_sync(void)
|
|||
ret = ObReferenceObjectByHandle(handle, SYNCHRONIZE, *pExEventObjectType, KernelMode, (void **)&event, NULL);
|
||||
ok(!ret, "ObReferenceObjectByHandle failed: %#x\n", ret);
|
||||
|
||||
|
||||
ret = wait_single(event, 0);
|
||||
ok(ret == 0, "got %#x\n", ret);
|
||||
ret = KeReadStateEvent(event);
|
||||
ok(ret == 1, "got %d\n", ret);
|
||||
KeResetEvent(event);
|
||||
ret = KeReadStateEvent(event);
|
||||
ok(ret == 0, "got %d\n", ret);
|
||||
ret = wait_single(event, 0);
|
||||
ok(ret == STATUS_TIMEOUT, "got %#x\n", ret);
|
||||
ret = wait_single_handle(handle, 0);
|
||||
|
|
|
@ -1759,6 +1759,7 @@ KAFFINITY WINAPI KeQueryActiveProcessors(void);
|
|||
void WINAPI KeQuerySystemTime(LARGE_INTEGER*);
|
||||
void WINAPI KeQueryTickCount(LARGE_INTEGER*);
|
||||
ULONG WINAPI KeQueryTimeIncrement(void);
|
||||
LONG WINAPI KeReadStateEvent(PRKEVENT);
|
||||
void FASTCALL KeReleaseInStackQueuedSpinLockFromDpcLevel(KLOCK_QUEUE_HANDLE*);
|
||||
LONG WINAPI KeReleaseMutex(PRKMUTEX,BOOLEAN);
|
||||
LONG WINAPI KeReleaseSemaphore(PRKSEMAPHORE,KPRIORITY,LONG,BOOLEAN);
|
||||
|
|
Loading…
Reference in New Issue