From 736ff1ac84103bbb0aace9f5242da5e4c39e13a8 Mon Sep 17 00:00:00 2001 From: Eugene Ingerman Date: Sat, 18 Jan 2003 20:47:32 +0000 Subject: [PATCH] Fixed functions where GDI objects were locked but not released. svn path=/trunk/; revision=4034 --- reactos/subsys/win32k/objects/brush.c | 13 +++++++------ reactos/subsys/win32k/objects/cliprgn.c | 14 ++++++++++---- reactos/subsys/win32k/objects/fillshap.c | 6 +++--- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/reactos/subsys/win32k/objects/brush.c b/reactos/subsys/win32k/objects/brush.c index 11feb083358..00fd50f2c15 100644 --- a/reactos/subsys/win32k/objects/brush.c +++ b/reactos/subsys/win32k/objects/brush.c @@ -1,4 +1,4 @@ -/* $Id: brush.c,v 1.17 2002/09/08 10:23:52 chorns Exp $ +/* $Id: brush.c,v 1.18 2003/01/18 20:46:31 ei Exp $ */ @@ -200,7 +200,7 @@ BOOL STDCALL W32kPatBlt(HDC hDC, BrushObj = (BRUSHOBJ*) GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC); assert(BrushObj); if (BrushObj->logbrush.lbStyle != BS_NULL) - { + { if (Width > 0) { DestRect.left = XLeft + dc->w.DCOrgX; @@ -213,15 +213,15 @@ BOOL STDCALL W32kPatBlt(HDC hDC, } if (Height > 0) { - DestRect.top = YLeft + dc->w.DCOrgY; + DestRect.top = YLeft + dc->w.DCOrgY; DestRect.bottom = YLeft + Height + dc->w.DCOrgY; } else { - DestRect.top = YLeft + Height + dc->w.DCOrgY; + DestRect.top = YLeft + Height + dc->w.DCOrgY; DestRect.bottom = YLeft + dc->w.DCOrgY; } - ret = EngBitBlt(SurfObj, + ret = EngBitBlt(SurfObj, NULL, NULL, NULL, @@ -233,7 +233,8 @@ BOOL STDCALL W32kPatBlt(HDC hDC, NULL, PATCOPY); } - GDIOBJ_UnlockObj( dc->w.hBrush, GO_PEN_MAGIC ); + GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC ); + DC_ReleasePtr( hDC ); return(ret); } diff --git a/reactos/subsys/win32k/objects/cliprgn.c b/reactos/subsys/win32k/objects/cliprgn.c index 2439268ef5e..8ec98acf96a 100644 --- a/reactos/subsys/win32k/objects/cliprgn.c +++ b/reactos/subsys/win32k/objects/cliprgn.c @@ -54,19 +54,22 @@ HRGN WINAPI SaveVisRgn(HDC hdc) return copy; } -INT WINAPI +INT WINAPI W32kSelectVisRgn(HDC hdc, HRGN hrgn) { int retval; DC *dc; - if (!hrgn) return ERROR; - if (!(dc = DC_HandleToPtr(hdc))) return ERROR; + if (!hrgn) + return ERROR; + if (!(dc = DC_HandleToPtr(hdc))) + return ERROR; dc->w.flags &= ~DC_DIRTY; retval = W32kCombineRgn(dc->w.hVisRgn, hrgn, 0, RGN_COPY); CLIPPING_UpdateGCRegion(dc); + DC_ReleasePtr( hdc ); return retval; } @@ -93,12 +96,15 @@ int STDCALL W32kGetClipBox(HDC hDC, int retval; DC *dc; - if (!(dc = DC_HandleToPtr(hDC))) return ERROR; + if (!(dc = DC_HandleToPtr(hDC))) + return ERROR; retval = UnsafeW32kGetRgnBox(dc->w.hGCClipRgn, rc); rc->left -= dc->w.DCOrgX; rc->right -= dc->w.DCOrgX; rc->top -= dc->w.DCOrgY; rc->bottom -= dc->w.DCOrgY; + + DC_ReleasePtr( hDC ); W32kDPtoLP(hDC, (LPPOINT)rc, 2); return(retval); } diff --git a/reactos/subsys/win32k/objects/fillshap.c b/reactos/subsys/win32k/objects/fillshap.c index 0e06ee26445..a5e424eadec 100644 --- a/reactos/subsys/win32k/objects/fillshap.c +++ b/reactos/subsys/win32k/objects/fillshap.c @@ -140,12 +140,12 @@ W32kRectangle(HDC hDC, if (BrushObj) { if (BrushObj->logbrush.lbStyle != BS_NULL) - { + { DestRect.left = LeftRect + 1; DestRect.right = RightRect - 1; DestRect.top = TopRect + 1; DestRect.bottom = BottomRect - 1; - ret = EngBitBlt(SurfObj, + ret = EngBitBlt(SurfObj, NULL, NULL, NULL, @@ -158,7 +158,7 @@ W32kRectangle(HDC hDC, PATCOPY); } } - GDIOBJ_UnlockObj( dc->w.hBrush, GO_PEN_MAGIC ); + GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC ); } // FIXME: Move current position in DC?