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);