Commit 65e550d2 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler Committed by Alexandre Julliard

user32: Fix NULL dereference in UnregisterDeviceNotification.

parent 8091922d
...@@ -2109,6 +2109,9 @@ BOOL WINAPI I_ScUnregisterDeviceNotification( HDEVNOTIFY handle ) ...@@ -2109,6 +2109,9 @@ BOOL WINAPI I_ScUnregisterDeviceNotification( HDEVNOTIFY handle )
TRACE("%p\n", handle); TRACE("%p\n", handle);
if (!handle)
return FALSE;
EnterCriticalSection( &service_cs ); EnterCriticalSection( &service_cs );
list_remove( &registration->entry ); list_remove( &registration->entry );
LeaveCriticalSection(&service_cs); LeaveCriticalSection(&service_cs);
......
...@@ -3004,6 +3004,12 @@ static void test_GetPointerType(void) ...@@ -3004,6 +3004,12 @@ static void test_GetPointerType(void)
ok(type == PT_MOUSE, " type %d\n", type ); 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) START_TEST(input)
{ {
POINT pos; POINT pos;
...@@ -3050,4 +3056,6 @@ START_TEST(input) ...@@ -3050,4 +3056,6 @@ START_TEST(input)
test_GetPointerType(); test_GetPointerType();
else else
win_skip("GetPointerType is not available\n"); win_skip("GetPointerType is not available\n");
test_UnregisterDeviceNotification();
} }
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