ntoskrnl.exe: Support event functions on kernel objects.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-03-25 14:39:07 +01:00 committed by Alexandre Julliard
parent f57a383d09
commit b9c621856f
2 changed files with 12 additions and 6 deletions

View File

@ -224,7 +224,7 @@ POBJECT_TYPE ExEventObjectType = &event_type;
LONG WINAPI KeSetEvent( PRKEVENT event, KPRIORITY increment, BOOLEAN wait ) LONG WINAPI KeSetEvent( PRKEVENT event, KPRIORITY increment, BOOLEAN wait )
{ {
HANDLE handle; HANDLE handle;
ULONG ret = 0; LONG ret = 0;
TRACE("event %p, increment %d, wait %u.\n", event, increment, wait); TRACE("event %p, increment %d, wait %u.\n", event, increment, wait);
@ -238,7 +238,11 @@ LONG WINAPI KeSetEvent( PRKEVENT event, KPRIORITY increment, BOOLEAN wait )
} }
else else
{ {
FIXME("unsupported on kernel objects\n"); if ((handle = kernel_object_handle( event, EVENT_MODIFY_STATE )))
{
NtSetEvent( handle, &ret );
NtClose( handle );
}
event->Header.SignalState = TRUE; event->Header.SignalState = TRUE;
} }
@ -251,7 +255,7 @@ LONG WINAPI KeSetEvent( PRKEVENT event, KPRIORITY increment, BOOLEAN wait )
LONG WINAPI KeResetEvent( PRKEVENT event ) LONG WINAPI KeResetEvent( PRKEVENT event )
{ {
HANDLE handle; HANDLE handle;
ULONG ret = 0; LONG ret = 0;
TRACE("event %p.\n", event); TRACE("event %p.\n", event);
@ -265,7 +269,11 @@ LONG WINAPI KeResetEvent( PRKEVENT event )
} }
else else
{ {
FIXME("unsupported on kernel objects\n"); if ((handle = kernel_object_handle( event, EVENT_MODIFY_STATE )))
{
NtResetEvent( handle, &ret );
NtClose( handle );
}
event->Header.SignalState = FALSE; event->Header.SignalState = FALSE;
} }

View File

@ -461,10 +461,8 @@ static void test_sync(void)
ok(ret == 0, "got %#x\n", ret); ok(ret == 0, "got %#x\n", ret);
KeResetEvent(event); KeResetEvent(event);
ret = wait_single(event, 0); ret = wait_single(event, 0);
todo_wine
ok(ret == STATUS_TIMEOUT, "got %#x\n", ret); ok(ret == STATUS_TIMEOUT, "got %#x\n", ret);
ret = wait_single_handle(handle, 0); ret = wait_single_handle(handle, 0);
todo_wine
ok(ret == STATUS_TIMEOUT, "got %#x\n", ret); ok(ret == STATUS_TIMEOUT, "got %#x\n", ret);
KeSetEvent(event, 0, FALSE); KeSetEvent(event, 0, FALSE);