user32: Fix NULL dereference in UnregisterDeviceNotification.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49211
Signed-off-by: Arkadiusz Hiler <arek@hiler.eu>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Arkadiusz Hiler 2020-05-26 23:01:36 +03:00 committed by Alexandre Julliard
parent 8091922d9a
commit 65e550d265
2 changed files with 11 additions and 0 deletions

View File

@ -2109,6 +2109,9 @@ BOOL WINAPI I_ScUnregisterDeviceNotification( HDEVNOTIFY handle )
TRACE("%p\n", handle);
if (!handle)
return FALSE;
EnterCriticalSection( &service_cs );
list_remove( &registration->entry );
LeaveCriticalSection(&service_cs);

View File

@ -3004,6 +3004,12 @@ static void test_GetPointerType(void)
ok(type == PT_MOUSE, " type %d\n", type );
}
static void test_UnregisterDeviceNotification(void)
{
BOOL ret = UnregisterDeviceNotification(NULL);
ok(ret == FALSE, "Unregistering NULL Device Notification returned: %d\n", ret);
}
START_TEST(input)
{
POINT pos;
@ -3050,4 +3056,6 @@ START_TEST(input)
test_GetPointerType();
else
win_skip("GetPointerType is not available\n");
test_UnregisterDeviceNotification();
}