https://git.reactos.org/?p=reactos.git;a=commitdiff;h=01b580d8760be6870964ecd7b18ae2fab5fa250f

commit 01b580d8760be6870964ecd7b18ae2fab5fa250f
Author:     Pierre Schweitzer <pie...@reactos.org>
AuthorDate: Mon Dec 31 20:33:59 2018 +0100
Commit:     Pierre Schweitzer <pie...@reactos.org>
CommitDate: Mon Dec 31 20:35:17 2018 +0100

    [WIN32K] Deny deviceless calls to EngDeviceIoControl
    
    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 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/win32ss/gdi/eng/device.c b/win32ss/gdi/eng/device.c
index 0123a2713c..6d20e30de5 100644
--- a/win32ss/gdi/eng/device.c
+++ b/win32ss/gdi/eng/device.c
@@ -485,6 +485,11 @@ EngDeviceIoControl(
 
     TRACE("EngDeviceIoControl() called\n");
 
+    if (!hDevice)
+    {
+        return ERROR_INVALID_HANDLE;
+    }
+
     KeInitializeEvent(&Event, SynchronizationEvent, FALSE);
 
     DeviceObject = (PDEVICE_OBJECT) hDevice;

Reply via email to