From: Jérôme Gardou Date: Mon, 19 Apr 2010 14:17:26 +0000 (+0000) Subject: [WIN32K] X-Git-Tag: backups/reactos-yarotows@57446~163 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=75108218f77548b4b03aba180387e89746a4ce6b;ds=sidebyside [WIN32K] - move mouse related ppdev locking to Gre* functions Spotted by Physicus svn path=/branches/reactos-yarotows/; revision=46939 --- diff --git a/subsystems/win32/win32k/eng/mouse.c b/subsystems/win32/win32k/eng/mouse.c index ec6c3b4d3c9..5a96086a7d5 100644 --- a/subsystems/win32/win32k/eng/mouse.c +++ b/subsystems/win32/win32k/eng/mouse.c @@ -531,9 +531,7 @@ IntEngMovePointer( if(ppdev->SafetyRemoveLevel) return ; - EngAcquireSemaphore(ppdev->hsemDevLock); ppdev->pfnMovePointer(pso, x, y, prcl); - EngReleaseSemaphore(ppdev->hsemDevLock); } ULONG APIENTRY @@ -555,7 +553,6 @@ IntEngSetPointerShape( pfnSetPointerShape = GDIDEVFUNCS(pso).SetPointerShape; - EngAcquireSemaphore(ppdev->hsemDevLock); if (pfnSetPointerShape) { ulResult = pfnSetPointerShape(pso, @@ -593,8 +590,6 @@ IntEngSetPointerShape( ppdev->pfnMovePointer = EngMovePointer; } - EngReleaseSemaphore(ppdev->hsemDevLock); - return ulResult; } @@ -623,11 +618,13 @@ GreSetPointerShape( } ASSERT(pdc->dctype == DCTYPE_DIRECT); + EngAcquireSemaphore(pdc->ppdev->hsemDevLock); /* We're not sure DC surface is the good one */ psurf = pdc->ppdev->pSurface; if (!psurf) { DPRINT1("DC has no surface.\n"); + EngReleaseSemaphore(pdc->ppdev->hsemDevLock); DC_UnlockDc(pdc); return 0; } @@ -675,6 +672,8 @@ GreSetPointerShape( if (psurfMask) SURFACE_ShareUnlockSurface(psurfMask); + EngReleaseSemaphore(pdc->ppdev->hsemDevLock); + /* Unlock the DC */ DC_UnlockDc(pdc); @@ -701,12 +700,14 @@ GreMovePointer( } ASSERT(pdc->dctype == DCTYPE_DIRECT); + EngAcquireSemaphore(pdc->ppdev->hsemDevLock); /* Store the cursor exclude position in the PDEV */ prcl = &pdc->ppdev->Pointer.Exclude; /* Call Eng/Drv function */ IntEngMovePointer(&pdc->ppdev->pSurface->SurfObj, x, y, prcl); + EngReleaseSemaphore(pdc->ppdev->hsemDevLock); /* Unlock the DC */ DC_UnlockDc(pdc); }