Author: jgardou Date: Sat Apr 3 18:32:30 2010 New Revision: 46697
URL: http://svn.reactos.org/svn/reactos?rev=46697&view=rev Log: [WIN32K] Unlock/lock surface when locking DC
Modified: branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h
Modified: branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win3... ============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h [iso-8859-1] Sat Apr 3 18:32:30 2010 @@ -169,15 +169,19 @@ { PDC pdc; pdc = GDIOBJ_LockObj(hdc, GDILoObjType_LO_DC_TYPE); - + /* Direct DC's need PDEV locking */ if(pdc && pdc->dctype == DCTYPE_DIRECT) { /* Acquire shared PDEV lock */ EngAcquireSemaphoreShared(pdc->ppdev->hsemDevLock); - - /* Get the current surface */ - pdc->dclevel.pSurface = pdc->ppdev->pSurface; + + /* Update Surface if needed */ + if(pdc->dclevel.pSurface != pdc->ppdev->pSurface) + { + if(pdc->dclevel.pSurface) SURFACE_ShareUnlockSurface(pdc->dclevel.pSurface); + pdc->dclevel.pSurface = PDEVOBJ_pSurface(pdc->ppdev); + } } return pdc; }