From eec2739a8bdf49255d08a1c2384f3635da894f92 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 26 Jun 2008 12:05:38 +0000 Subject: [PATCH] Patch by Jeffrey Morlan : Rearrange code in NtGdiSelectBitmap to prevent deadlock. See bug 3333. svn path=/trunk/; revision=34097 --- reactos/subsystems/win32/win32k/objects/dc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/subsystems/win32/win32k/objects/dc.c b/reactos/subsystems/win32/win32k/objects/dc.c index 9f543684e90..12b19a333d1 100644 --- a/reactos/subsystems/win32/win32k/objects/dc.c +++ b/reactos/subsystems/win32/win32k/objects/dc.c @@ -1955,6 +1955,9 @@ NtGdiSelectBitmap( pDC->w.bitsPerPixel = BitsPerFormat(pBmp->SurfObj.iBitmapFormat); } + hVisRgn = NtGdiCreateRectRgn(0, 0, pBmp->SurfObj.sizlBitmap.cx, pBmp->SurfObj.sizlBitmap.cy); + BITMAPOBJ_UnlockBitmap(pBmp); + /* Regenerate the XLATEOBJs. */ pBrush = BRUSHOBJ_LockBrush(pDc_Attr->hbrush); if (pBrush) @@ -1980,9 +1983,6 @@ NtGdiSelectBitmap( DC_UnlockDc(pDC); - hVisRgn = NtGdiCreateRectRgn(0, 0, pBmp->SurfObj.sizlBitmap.cx, pBmp->SurfObj.sizlBitmap.cy); - BITMAPOBJ_UnlockBitmap(pBmp); - if (hVisRgn) { GdiSelectVisRgn(hDC, hVisRgn);