Author: jimtabor
Date: Sun May 4 20:34:17 2008
New Revision: 33288
URL:
http://svn.reactos.org/svn/reactos?rev=33288&view=rev
Log:
Implement IntGdiReferencePdev and part of IntGdiUnreferencePdev.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/dc.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] Sun May 4 20:34:17
2008
@@ -2699,16 +2699,27 @@
return &PrimarySurface;
}
+HSEMAPHORE hsemDriverMgmt = NULL; // Hax, should be in dllmain.c and global.
+
VOID FASTCALL
IntGdiReferencePdev(PGDIDEVICE pPDev)
{
+ if(!hsemDriverMgmt) hsemDriverMgmt = EngCreateSemaphore(); // Hax, should be in
dllmain.c
+ EngAcquireSemaphore(hsemDriverMgmt);
pPDev->cPdevRefs++;
+ EngReleaseSemaphore(hsemDriverMgmt);
}
VOID FASTCALL
IntGdiUnreferencePdev(PGDIDEVICE pPDev, DWORD CleanUpType)
{
+ EngAcquireSemaphore(hsemDriverMgmt);
pPDev->cPdevRefs--;
+ if (!pPDev->cPdevRefs)
+ {
+ // Handle the destruction of pPDev or GDIDEVICE or PDEVOBJ or PDEV etc.
+ }
+ EngReleaseSemaphore(hsemDriverMgmt);
}