[ros-diffs] [jimtabor] 33288: Implement IntGdiReferencePdev and part of IntGdiUnreferencePdev.
jimtabor at svn.reactos.org
jimtabor at svn.reactos.org
Mon May 5 03:34:17 CEST 2008
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/objects/dc.c?rev=33288&r1=33287&r2=33288&view=diff
==============================================================================
--- 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);
}
More information about the Ros-diffs
mailing list