From 031ed04e0cc6c29da6820ae25c3a96b0def341a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Mon, 22 Sep 2014 14:33:06 +0000 Subject: [PATCH] [WIN32K] - Add some debug prints helping diagnosing which GDI objects are locked when they should not be. - Plug a region (lock) leak - Remove some dead code. svn path=/trunk/; revision=64226 --- reactos/win32ss/gdi/ntgdi/gdidebug.h | 3 +++ reactos/win32ss/gdi/ntgdi/region.c | 4 ---- reactos/win32ss/user/ntuser/vis.c | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/win32ss/gdi/ntgdi/gdidebug.h b/reactos/win32ss/gdi/ntgdi/gdidebug.h index a5139687081..048ad9ff8cd 100644 --- a/reactos/win32ss/gdi/ntgdi/gdidebug.h +++ b/reactos/win32ss/gdi/ntgdi/gdidebug.h @@ -80,8 +80,11 @@ GdiDbgAssertNoLocks(char * pszFile, ULONG nLine) PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); if (pti && pti->cExclusiveLocks != 0) { + ULONG i; DbgPrint("(%s:%lu) There are %lu exclusive locks!\n", pszFile, nLine, pti->cExclusiveLocks); + for (i = 0; i < (GDIObjTypeTotal + 1); i++) + DbgPrint(" Type %u: %u.\n", i, pti->acExclusiveLockCount[i]); ASSERT(FALSE); } } diff --git a/reactos/win32ss/gdi/ntgdi/region.c b/reactos/win32ss/gdi/ntgdi/region.c index b4863b1364d..4efcc6f14dd 100644 --- a/reactos/win32ss/gdi/ntgdi/region.c +++ b/reactos/win32ss/gdi/ntgdi/region.c @@ -3847,10 +3847,6 @@ NtGdiPtInRegion( RGNOBJAPI_Unlock(prgn); return ret; - - - RGNOBJAPI_Unlock(prgn); - return FALSE; } BOOL diff --git a/reactos/win32ss/user/ntuser/vis.c b/reactos/win32ss/user/ntuser/vis.c index 053a0b0d1f0..cd816b5317e 100644 --- a/reactos/win32ss/user/ntuser/vis.c +++ b/reactos/win32ss/user/ntuser/vis.c @@ -116,6 +116,7 @@ VIS_ComputeVisibleRegion( IntGdiOffsetRgn(ClipRgn, -CurrentWindow->rcWindow.left, -CurrentWindow->rcWindow.top); IntGdiCombineRgn(ClipRgn, ClipRgn, CurrentRgnClip, RGN_AND); IntGdiOffsetRgn(ClipRgn, CurrentWindow->rcWindow.left, CurrentWindow->rcWindow.top); + RGNOBJAPI_Unlock(CurrentRgnClip); } } IntGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF); -- 2.17.1