Commit 90173ce4 authored by Keno Fischer's avatar Keno Fischer Committed by Alexandre Julliard

ntdll: Tolerate null handle in DeregisterWait.

parent 710a58da
...@@ -1245,6 +1245,10 @@ static void test_RegisterWaitForSingleObject(void) ...@@ -1245,6 +1245,10 @@ static void test_RegisterWaitForSingleObject(void)
ret = pUnregisterWait(wait_handle); ret = pUnregisterWait(wait_handle);
ok(ret, "UnregisterWait failed with error %d\n", GetLastError()); ok(ret, "UnregisterWait failed with error %d\n", GetLastError());
ret = pUnregisterWait(0);
ok(!ret && GetLastError() == ERROR_INVALID_HANDLE,
"UnregisterWait failed with unexpected error %d\n", GetLastError());
} }
static DWORD LS_main; static DWORD LS_main;
......
...@@ -637,6 +637,9 @@ NTSTATUS WINAPI RtlDeregisterWaitEx(HANDLE WaitHandle, HANDLE CompletionEvent) ...@@ -637,6 +637,9 @@ NTSTATUS WINAPI RtlDeregisterWaitEx(HANDLE WaitHandle, HANDLE CompletionEvent)
TRACE( "(%p)\n", WaitHandle ); TRACE( "(%p)\n", WaitHandle );
if (WaitHandle == NULL)
return STATUS_INVALID_HANDLE;
NtSetEvent( wait_work_item->CancelEvent, NULL ); NtSetEvent( wait_work_item->CancelEvent, NULL );
if (wait_work_item->CallbackInProgress) if (wait_work_item->CallbackInProgress)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment