[YAROTOWS] Reintegrate the branch. For a brighter future.
[reactos.git] / reactos / subsystems / win32 / win32k / eng / semaphor.c
index 13f376c..ce9780f 100644 (file)
@@ -1,4 +1,4 @@
-#include <w32k.h>
+#include <win32k.h>
 
 #define NDEBUG
 #include <debug.h>
@@ -38,7 +38,7 @@ APIENTRY
 EngAcquireSemaphore ( IN HSEMAPHORE hsem )
 {
   // www.osr.com/ddk/graphics/gdifncs_14br.htm
-  PW32THREAD W32Thread;
+  PTHREADINFO W32Thread;
   ASSERT(hsem);
   IntGdiAcquireSemaphore ( hsem );
   W32Thread = PsGetThreadWin32Thread(PsGetCurrentThread());
@@ -62,13 +62,26 @@ APIENTRY
 EngReleaseSemaphore ( IN HSEMAPHORE hsem )
 {
   // www.osr.com/ddk/graphics/gdifncs_5u3r.htm
-  PW32THREAD W32Thread;
+  PTHREADINFO W32Thread;
   ASSERT(hsem);
   W32Thread = PsGetThreadWin32Thread(PsGetCurrentThread());
   if (W32Thread) --W32Thread->dwEngAcquireCount;
   IntGdiReleaseSemaphore ( hsem );
 }
 
+VOID
+NTAPI
+EngAcquireSemaphoreShared(
+    IN HSEMAPHORE hsem)
+{
+    PTHREADINFO pti;
+
+    ASSERT(hsem);
+    ExEnterCriticalRegionAndAcquireResourceShared((PERESOURCE)hsem);
+    pti = PsGetThreadWin32Thread(PsGetCurrentThread());
+    if (pti) ++pti->dwEngAcquireCount;
+}
+
 /*
  * @implemented
  */