[WIN32K] Deny deviceless calls to EngDeviceIoControl
authorPierre Schweitzer <pierre@reactos.org>
Mon, 31 Dec 2018 19:33:59 +0000 (20:33 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Mon, 31 Dec 2018 19:35:17 +0000 (20:35 +0100)
This fixes BSOD happening in ntoskrnl coming from win32k under certain
conditions with 3rd party display drivers (such as VBox or VMware)

win32ss/gdi/eng/device.c

index 0123a27..6d20e30 100644 (file)
@@ -485,6 +485,11 @@ EngDeviceIoControl(
 
     TRACE("EngDeviceIoControl() called\n");
 
+    if (!hDevice)
+    {
+        return ERROR_INVALID_HANDLE;
+    }
+
     KeInitializeEvent(&Event, SynchronizationEvent, FALSE);
 
     DeviceObject = (PDEVICE_OBJECT) hDevice;