ntdll: Tolerate null handle in DeregisterWait.
Signed-off-by: Keno Fischer <keno@juliacomputing.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
710a58da79
commit
90173ce448
|
@ -1245,6 +1245,10 @@ static void test_RegisterWaitForSingleObject(void)
|
|||
|
||||
ret = pUnregisterWait(wait_handle);
|
||||
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;
|
||||
|
|
|
@ -637,6 +637,9 @@ NTSTATUS WINAPI RtlDeregisterWaitEx(HANDLE WaitHandle, HANDLE CompletionEvent)
|
|||
|
||||
TRACE( "(%p)\n", WaitHandle );
|
||||
|
||||
if (WaitHandle == NULL)
|
||||
return STATUS_INVALID_HANDLE;
|
||||
|
||||
NtSetEvent( wait_work_item->CancelEvent, NULL );
|
||||
if (wait_work_item->CallbackInProgress)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue