[WIN32K]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Wed, 25 Nov 2015 01:55:14 +0000 (01:55 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Wed, 25 Nov 2015 01:55:14 +0000 (01:55 +0000)
Apply the same fix for EngAcquireSemaphore to EngReleaseSemaphore.
CORE-9779 #comment Yet another try please

svn path=/trunk/; revision=70106

reactos/win32ss/gdi/eng/semaphor.c

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