[WIN32K]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 24 Nov 2015 22:04:39 +0000 (22:04 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 24 Nov 2015 22:04:39 +0000 (22:04 +0000)
"Gracyfully" (i.e. ignore, like Windows does) handle hsem == NULL in EngAcquireSemaphore
Should fix crash of QXL Virtual GPU driver installer
CORE-9779 #comment Please retest.

svn path=/trunk/; revision=70103

reactos/win32ss/gdi/eng/semaphor.c

index 0207186..48ee574 100644 (file)
@@ -42,7 +42,14 @@ EngAcquireSemaphore(
 {
     // www.osr.com/ddk/graphics/gdifncs_14br.htm
     PTHREADINFO W32Thread;
-    ASSERT(hsem);
+
+    /* On Windows a NULL hsem is ignored */
+    if (hsem == NULL)
+    {
+        DPRINT1("EngAcquireSemaphore called with hsem == NULL!\n");
+        return;
+    }
+
     ExEnterCriticalRegionAndAcquireResourceExclusive((PERESOURCE)hsem);
     W32Thread = PsGetThreadWin32Thread(PsGetCurrentThread());
     if (W32Thread) W32Thread->dwEngAcquireCount++;