From e95cff03327e9e7bda55087bca45397a646426f1 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 20 Sep 2012 21:07:04 +0200 Subject: [PATCH] gdi32: Always update the DC before looking for the physdev pointer. --- dlls/gdi32/bitblt.c | 31 ++++--- dlls/gdi32/clipping.c | 60 +++++++------ dlls/gdi32/dc.c | 3 +- dlls/gdi32/dib.c | 6 +- dlls/gdi32/driver.c | 15 ++-- dlls/gdi32/painting.c | 228 +++++++++++++++++++++++--------------------------- 6 files changed, 165 insertions(+), 178 deletions(-) diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c index 238e3752cea..7a1f06fd90f 100644 --- a/dlls/gdi32/bitblt.c +++ b/dlls/gdi32/bitblt.c @@ -518,7 +518,6 @@ BOOL WINAPI PatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop if ((dc = get_dc_ptr( hdc ))) { struct bitblt_coords dst; - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pPatBlt ); update_dc( dc ); @@ -538,8 +537,11 @@ BOOL WINAPI PatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop hdc, dst.log_x, dst.log_y, dst.log_width, dst.log_height, dst.x, dst.y, dst.width, dst.height, wine_dbgstr_rect(&dst.visrect), rop ); - if (!ret) ret = physdev->funcs->pPatBlt( physdev, &dst, rop ); - + if (!ret) + { + PHYSDEV physdev = GET_DC_PHYSDEV( dc, pPatBlt ); + ret = physdev->funcs->pPatBlt( physdev, &dst, rop ); + } release_dc_ptr( dc ); } return ret; @@ -574,8 +576,6 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst, INT widthDst, INT height if ((dcSrc = get_dc_ptr( hdcSrc ))) { struct bitblt_coords src, dst; - PHYSDEV src_dev = GET_DC_PHYSDEV( dcSrc, pStretchBlt ); - PHYSDEV dst_dev = GET_DC_PHYSDEV( dcDst, pStretchBlt ); update_dc( dcSrc ); update_dc( dcDst ); @@ -604,7 +604,12 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst, INT widthDst, INT height hdcDst, dst.log_x, dst.log_y, dst.log_width, dst.log_height, dst.x, dst.y, dst.width, dst.height, wine_dbgstr_rect(&dst.visrect), rop ); - if (!ret) ret = dst_dev->funcs->pStretchBlt( dst_dev, &dst, src_dev, &src, rop ); + if (!ret) + { + PHYSDEV src_dev = GET_DC_PHYSDEV( dcSrc, pStretchBlt ); + PHYSDEV dst_dev = GET_DC_PHYSDEV( dcDst, pStretchBlt ); + ret = dst_dev->funcs->pStretchBlt( dst_dev, &dst, src_dev, &src, rop ); + } release_dc_ptr( dcSrc ); } release_dc_ptr( dcDst ); @@ -911,8 +916,6 @@ BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heig if ((dcDst = get_dc_ptr( hdcDst ))) { struct bitblt_coords src, dst; - PHYSDEV src_dev = GET_DC_PHYSDEV( dcSrc, pAlphaBlend ); - PHYSDEV dst_dev = GET_DC_PHYSDEV( dcDst, pAlphaBlend ); update_dc( dcSrc ); update_dc( dcDst ); @@ -921,12 +924,12 @@ BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heig src.log_y = ySrc; src.log_width = widthSrc; src.log_height = heightSrc; - src.layout = GetLayout( src_dev->hdc ); + src.layout = GetLayout( hdcSrc ); dst.log_x = xDst; dst.log_y = yDst; dst.log_width = widthDst; dst.log_height = heightDst; - dst.layout = GetLayout( dst_dev->hdc ); + dst.layout = GetLayout( hdcDst ); ret = !get_vis_rectangles( dcDst, &dst, dcSrc, &src ); TRACE("src %p log=%d,%d %dx%d phys=%d,%d %dx%d vis=%s dst %p log=%d,%d %dx%d phys=%d,%d %dx%d vis=%s blend=%02x/%02x/%02x/%02x\n", @@ -962,8 +965,12 @@ BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heig SetLastError( ERROR_INVALID_PARAMETER ); ret = FALSE; } - else if (!ret) ret = dst_dev->funcs->pAlphaBlend( dst_dev, &dst, src_dev, &src, blendFunction ); - + else if (!ret) + { + PHYSDEV src_dev = GET_DC_PHYSDEV( dcSrc, pAlphaBlend ); + PHYSDEV dst_dev = GET_DC_PHYSDEV( dcDst, pAlphaBlend ); + ret = dst_dev->funcs->pAlphaBlend( dst_dev, &dst, src_dev, &src, blendFunction ); + } release_dc_ptr( dcDst ); } release_dc_ptr( dcSrc ); diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c index 23adf3155ad..ee7873e9e80 100644 --- a/dlls/gdi32/clipping.c +++ b/dlls/gdi32/clipping.c @@ -250,18 +250,17 @@ INT WINAPI SelectClipRgn( HDC hdc, HRGN hrgn ) */ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode ) { - INT retval = ERROR; + PHYSDEV physdev; + INT retval; DC * dc = get_dc_ptr( hdc ); TRACE("%p %p %d\n", hdc, hrgn, fnMode ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pExtSelectClipRgn ); - update_dc( dc ); - retval = physdev->funcs->pExtSelectClipRgn( physdev, hrgn, fnMode ); - release_dc_ptr( dc ); - } + if (!dc) return ERROR; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pExtSelectClipRgn ); + retval = physdev->funcs->pExtSelectClipRgn( physdev, hrgn, fnMode ); + release_dc_ptr( dc ); return retval; } @@ -298,18 +297,17 @@ void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect, */ INT WINAPI OffsetClipRgn( HDC hdc, INT x, INT y ) { - INT ret = ERROR; + PHYSDEV physdev; + INT ret; DC *dc = get_dc_ptr( hdc ); TRACE("%p %d,%d\n", hdc, x, y ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pOffsetClipRgn ); - update_dc( dc ); - ret = physdev->funcs->pOffsetClipRgn( physdev, x, y ); - release_dc_ptr( dc ); - } + if (!dc) return ERROR; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pOffsetClipRgn ); + ret = physdev->funcs->pOffsetClipRgn( physdev, x, y ); + release_dc_ptr( dc ); return ret; } @@ -320,18 +318,17 @@ INT WINAPI OffsetClipRgn( HDC hdc, INT x, INT y ) INT WINAPI ExcludeClipRect( HDC hdc, INT left, INT top, INT right, INT bottom ) { - INT ret = ERROR; + PHYSDEV physdev; + INT ret; DC *dc = get_dc_ptr( hdc ); TRACE("%p %d,%d-%d,%d\n", hdc, left, top, right, bottom ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pExcludeClipRect ); - update_dc( dc ); - ret = physdev->funcs->pExcludeClipRect( physdev, left, top, right, bottom ); - release_dc_ptr( dc ); - } + if (!dc) return ERROR; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pExcludeClipRect ); + ret = physdev->funcs->pExcludeClipRect( physdev, left, top, right, bottom ); + release_dc_ptr( dc ); return ret; } @@ -341,18 +338,17 @@ INT WINAPI ExcludeClipRect( HDC hdc, INT left, INT top, */ INT WINAPI IntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bottom ) { - INT ret = ERROR; + PHYSDEV physdev; + INT ret; DC *dc = get_dc_ptr( hdc ); TRACE("%p %d,%d - %d,%d\n", hdc, left, top, right, bottom ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pIntersectClipRect ); - update_dc( dc ); - ret = physdev->funcs->pIntersectClipRect( physdev, left, top, right, bottom ); - release_dc_ptr( dc ); - } + if (!dc) return ERROR; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pIntersectClipRect ); + ret = physdev->funcs->pIntersectClipRect( physdev, left, top, right, bottom ); + release_dc_ptr( dc ); return ret; } diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index e128e53c9b7..1f089defff3 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -537,14 +537,15 @@ INT WINAPI SaveDC( HDC hdc ) */ BOOL WINAPI RestoreDC( HDC hdc, INT level ) { + PHYSDEV physdev; DC *dc; BOOL success = FALSE; TRACE("%p %d\n", hdc, level ); if ((dc = get_dc_ptr( hdc ))) { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pRestoreDC ); update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pRestoreDC ); success = physdev->funcs->pRestoreDC( physdev, level ); release_dc_ptr( dc ); } diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 78f0b933a03..91cfae79d0a 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -603,6 +603,7 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, INT heightDs { char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; BITMAPINFO *info = (BITMAPINFO *)buffer; + PHYSDEV physdev; DC *dc; INT ret = 0; @@ -615,8 +616,8 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, INT heightDs if ((dc = get_dc_ptr( hdc ))) { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pStretchDIBits ); update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pStretchDIBits ); ret = physdev->funcs->pStretchDIBits( physdev, xDst, yDst, widthDst, heightDst, xSrc, ySrc, widthSrc, heightSrc, bits, info, coloruse, rop ); release_dc_ptr( dc ); @@ -875,6 +876,7 @@ INT WINAPI SetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx, { char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; BITMAPINFO *info = (BITMAPINFO *)buffer; + PHYSDEV physdev; INT ret = 0; DC *dc; @@ -887,8 +889,8 @@ INT WINAPI SetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx, if ((dc = get_dc_ptr( hdc ))) { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetDIBitsToDevice ); update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pSetDIBitsToDevice ); ret = physdev->funcs->pSetDIBitsToDevice( physdev, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, bits, info, coloruse ); release_dc_ptr( dc ); diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index b60f0cfe593..9c5ddb80b2c 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -1121,16 +1121,15 @@ INT WINAPI Escape( HDC hdc, INT escape, INT in_count, LPCSTR in_data, LPVOID out INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData, INT cbOutput, LPSTR lpszOutData ) { - INT ret = 0; + PHYSDEV physdev; + INT ret; DC * dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pExtEscape ); - update_dc( dc ); - ret = physdev->funcs->pExtEscape( physdev, nEscape, cbInput, lpszInData, cbOutput, lpszOutData ); - release_dc_ptr( dc ); - } + if (!dc) return 0; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pExtEscape ); + ret = physdev->funcs->pExtEscape( physdev, nEscape, cbInput, lpszInData, cbOutput, lpszOutData ); + release_dc_ptr( dc ); return ret; } diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index 023e183b0f6..74ca8358f3f 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -282,16 +282,15 @@ BOOL WINAPI Arc( HDC hdc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { - BOOL ret = FALSE; + PHYSDEV physdev; + BOOL ret; DC * dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pArc ); - update_dc( dc ); - ret = physdev->funcs->pArc( physdev, left, top, right, bottom, xstart, ystart, xend, yend ); - release_dc_ptr( dc ); - } + if (!dc) return FALSE; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pArc ); + ret = physdev->funcs->pArc( physdev, left, top, right, bottom, xstart, ystart, xend, yend ); + release_dc_ptr( dc ); return ret; } @@ -396,16 +395,15 @@ BOOL WINAPI Ellipse( HDC hdc, INT left, INT top, BOOL WINAPI Rectangle( HDC hdc, INT left, INT top, INT right, INT bottom ) { - BOOL ret = FALSE; + PHYSDEV physdev; + BOOL ret; DC * dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pRectangle ); - update_dc( dc ); - ret = physdev->funcs->pRectangle( physdev, left, top, right, bottom ); - release_dc_ptr( dc ); - } + if (!dc) return FALSE; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pRectangle ); + ret = physdev->funcs->pRectangle( physdev, left, top, right, bottom ); + release_dc_ptr( dc ); return ret; } @@ -416,16 +414,15 @@ BOOL WINAPI Rectangle( HDC hdc, INT left, INT top, BOOL WINAPI RoundRect( HDC hdc, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height ) { - BOOL ret = FALSE; + PHYSDEV physdev; + BOOL ret; DC *dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pRoundRect ); - update_dc( dc ); - ret = physdev->funcs->pRoundRect( physdev, left, top, right, bottom, ell_width, ell_height ); - release_dc_ptr( dc ); - } + if (!dc) return FALSE; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pRoundRect ); + ret = physdev->funcs->pRoundRect( physdev, left, top, right, bottom, ell_width, ell_height ); + release_dc_ptr( dc ); return ret; } @@ -434,16 +431,15 @@ BOOL WINAPI RoundRect( HDC hdc, INT left, INT top, INT right, */ COLORREF WINAPI SetPixel( HDC hdc, INT x, INT y, COLORREF color ) { - COLORREF ret = 0; + PHYSDEV physdev; + COLORREF ret; DC * dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetPixel ); - update_dc( dc ); - ret = physdev->funcs->pSetPixel( physdev, x, y, color ); - release_dc_ptr( dc ); - } + if (!dc) return 0; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pSetPixel ); + ret = physdev->funcs->pSetPixel( physdev, x, y, color ); + release_dc_ptr( dc ); return ret; } @@ -452,18 +448,15 @@ COLORREF WINAPI SetPixel( HDC hdc, INT x, INT y, COLORREF color ) */ BOOL WINAPI SetPixelV( HDC hdc, INT x, INT y, COLORREF color ) { - BOOL ret = FALSE; + PHYSDEV physdev; DC * dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetPixel ); - update_dc( dc ); - physdev->funcs->pSetPixel( physdev, x, y, color ); - ret = TRUE; - release_dc_ptr( dc ); - } - return ret; + if (!dc) return FALSE; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pSetPixel ); + physdev->funcs->pSetPixel( physdev, x, y, color ); + release_dc_ptr( dc ); + return TRUE; } /*********************************************************************** @@ -471,16 +464,15 @@ BOOL WINAPI SetPixelV( HDC hdc, INT x, INT y, COLORREF color ) */ COLORREF WINAPI GetPixel( HDC hdc, INT x, INT y ) { - COLORREF ret = CLR_INVALID; + PHYSDEV physdev; + COLORREF ret; DC * dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetPixel ); - update_dc( dc ); - ret = physdev->funcs->pGetPixel( physdev, x, y ); - release_dc_ptr( dc ); - } + if (!dc) return CLR_INVALID; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pGetPixel ); + ret = physdev->funcs->pGetPixel( physdev, x, y ); + release_dc_ptr( dc ); return ret; } @@ -535,16 +527,15 @@ BOOL WINAPI GdiSwapBuffers( HDC hdc ) */ BOOL WINAPI PaintRgn( HDC hdc, HRGN hrgn ) { - BOOL ret = FALSE; + PHYSDEV physdev; + BOOL ret; DC * dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pPaintRgn ); - update_dc( dc ); - ret = physdev->funcs->pPaintRgn( physdev, hrgn ); - release_dc_ptr( dc ); - } + if (!dc) return FALSE; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pPaintRgn ); + ret = physdev->funcs->pPaintRgn( physdev, hrgn ); + release_dc_ptr( dc ); return ret; } @@ -554,16 +545,15 @@ BOOL WINAPI PaintRgn( HDC hdc, HRGN hrgn ) */ BOOL WINAPI FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) { - BOOL retval = FALSE; + PHYSDEV physdev; + BOOL retval; DC * dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pFillRgn ); - update_dc( dc ); - retval = physdev->funcs->pFillRgn( physdev, hrgn, hbrush ); - release_dc_ptr( dc ); - } + if (!dc) return FALSE; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pFillRgn ); + retval = physdev->funcs->pFillRgn( physdev, hrgn, hbrush ); + release_dc_ptr( dc ); return retval; } @@ -574,16 +564,15 @@ BOOL WINAPI FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) BOOL WINAPI FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, INT nWidth, INT nHeight ) { - BOOL ret = FALSE; + PHYSDEV physdev; + BOOL ret; DC *dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pFrameRgn ); - update_dc( dc ); - ret = physdev->funcs->pFrameRgn( physdev, hrgn, hbrush, nWidth, nHeight ); - release_dc_ptr( dc ); - } + if (!dc) return FALSE; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pFrameRgn ); + ret = physdev->funcs->pFrameRgn( physdev, hrgn, hbrush, nWidth, nHeight ); + release_dc_ptr( dc ); return ret; } @@ -593,16 +582,15 @@ BOOL WINAPI FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, */ BOOL WINAPI InvertRgn( HDC hdc, HRGN hrgn ) { - BOOL ret = FALSE; + PHYSDEV physdev; + BOOL ret; DC *dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pInvertRgn ); - update_dc( dc ); - ret = physdev->funcs->pInvertRgn( physdev, hrgn ); - release_dc_ptr( dc ); - } + if (!dc) return FALSE; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pInvertRgn ); + ret = physdev->funcs->pInvertRgn( physdev, hrgn ); + release_dc_ptr( dc ); return ret; } @@ -612,16 +600,15 @@ BOOL WINAPI InvertRgn( HDC hdc, HRGN hrgn ) */ BOOL WINAPI Polyline( HDC hdc, const POINT* pt, INT count ) { - BOOL ret = FALSE; + PHYSDEV physdev; + BOOL ret; DC * dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pPolyline ); - update_dc( dc ); - ret = physdev->funcs->pPolyline( physdev, pt, count ); - release_dc_ptr( dc ); - } + if (!dc) return FALSE; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pPolyline ); + ret = physdev->funcs->pPolyline( physdev, pt, count ); + release_dc_ptr( dc ); return ret; } @@ -655,16 +642,15 @@ BOOL WINAPI PolylineTo( HDC hdc, const POINT* pt, DWORD cCount ) */ BOOL WINAPI Polygon( HDC hdc, const POINT* pt, INT count ) { - BOOL ret = FALSE; + PHYSDEV physdev; + BOOL ret; DC * dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pPolygon ); - update_dc( dc ); - ret = physdev->funcs->pPolygon( physdev, pt, count ); - release_dc_ptr( dc ); - } + if (!dc) return FALSE; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pPolygon ); + ret = physdev->funcs->pPolygon( physdev, pt, count ); + release_dc_ptr( dc ); return ret; } @@ -675,16 +661,15 @@ BOOL WINAPI Polygon( HDC hdc, const POINT* pt, INT count ) BOOL WINAPI PolyPolygon( HDC hdc, const POINT* pt, const INT* counts, UINT polygons ) { - BOOL ret = FALSE; + PHYSDEV physdev; + BOOL ret; DC * dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pPolyPolygon ); - update_dc( dc ); - ret = physdev->funcs->pPolyPolygon( physdev, pt, counts, polygons ); - release_dc_ptr( dc ); - } + if (!dc) return FALSE; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pPolyPolygon ); + ret = physdev->funcs->pPolyPolygon( physdev, pt, counts, polygons ); + release_dc_ptr( dc ); return ret; } @@ -694,16 +679,15 @@ BOOL WINAPI PolyPolygon( HDC hdc, const POINT* pt, const INT* counts, BOOL WINAPI PolyPolyline( HDC hdc, const POINT* pt, const DWORD* counts, DWORD polylines ) { - BOOL ret = FALSE; + PHYSDEV physdev; + BOOL ret; DC * dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pPolyPolyline ); - update_dc( dc ); - ret = physdev->funcs->pPolyPolyline( physdev, pt, counts, polylines ); - release_dc_ptr( dc ); - } + if (!dc) return FALSE; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pPolyPolyline ); + ret = physdev->funcs->pPolyPolyline( physdev, pt, counts, polylines ); + release_dc_ptr( dc ); return ret; } @@ -713,17 +697,15 @@ BOOL WINAPI PolyPolyline( HDC hdc, const POINT* pt, const DWORD* counts, BOOL WINAPI ExtFloodFill( HDC hdc, INT x, INT y, COLORREF color, UINT fillType ) { - BOOL ret = FALSE; + PHYSDEV physdev; + BOOL ret; DC * dc = get_dc_ptr( hdc ); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pExtFloodFill ); - - update_dc( dc ); - ret = physdev->funcs->pExtFloodFill( physdev, x, y, color, fillType ); - release_dc_ptr( dc ); - } + if (!dc) return FALSE; + update_dc( dc ); + physdev = GET_DC_PHYSDEV( dc, pExtFloodFill ); + ret = physdev->funcs->pExtFloodFill( physdev, x, y, color, fillType ); + release_dc_ptr( dc ); return ret; } -- 2.11.4.GIT