diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index 5a72bc516bb..30855437276 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -224,7 +224,7 @@ POBJECT_TYPE ExEventObjectType = &event_type; LONG WINAPI KeSetEvent( PRKEVENT event, KPRIORITY increment, BOOLEAN wait ) { HANDLE handle; - ULONG ret = 0; + LONG ret = 0; 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 { - FIXME("unsupported on kernel objects\n"); + if ((handle = kernel_object_handle( event, EVENT_MODIFY_STATE ))) + { + NtSetEvent( handle, &ret ); + NtClose( handle ); + } event->Header.SignalState = TRUE; } @@ -251,7 +255,7 @@ LONG WINAPI KeSetEvent( PRKEVENT event, KPRIORITY increment, BOOLEAN wait ) LONG WINAPI KeResetEvent( PRKEVENT event ) { HANDLE handle; - ULONG ret = 0; + LONG ret = 0; TRACE("event %p.\n", event); @@ -265,7 +269,11 @@ LONG WINAPI KeResetEvent( PRKEVENT event ) } 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; } diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c index 0fc0058a284..88237461d5b 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -461,10 +461,8 @@ static void test_sync(void) ok(ret == 0, "got %#x\n", ret); KeResetEvent(event); ret = wait_single(event, 0); - todo_wine ok(ret == STATUS_TIMEOUT, "got %#x\n", ret); ret = wait_single_handle(handle, 0); - todo_wine ok(ret == STATUS_TIMEOUT, "got %#x\n", ret); KeSetEvent(event, 0, FALSE);