Commit 1476e346 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Add separate functions for releasing/freeing DCs to replace the standard GDI ones.

This should make it possible to use a different locking mechanism for DCs.
parent 0dade720
......@@ -45,7 +45,7 @@ BOOL WINAPI PatBlt( HDC hdc, INT left, INT top,
TRACE("%p %d,%d %dx%d %06x\n", hdc, left, top, width, height, rop );
bRet = dc->funcs->pPatBlt( dc->physDev, left, top, width, height, rop );
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return bRet;
}
......@@ -61,7 +61,7 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
if ((dcDst = DC_GetDCUpdate( hdcDst )) && dcDst->funcs->pBitBlt)
{
GDI_ReleaseObj( hdcDst );
DC_ReleaseDCPtr( dcDst );
/* FIXME: there is a race condition here */
dcSrc = DC_GetDCUpdate( hdcSrc );
dcDst = DC_GetDCPtr( hdcDst );
......@@ -71,8 +71,8 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height,
dcSrc ? dcSrc->physDev : NULL, xSrc, ySrc, rop );
GDI_ReleaseObj( hdcDst );
if (dcSrc) GDI_ReleaseObj( hdcSrc );
DC_ReleaseDCPtr( dcDst );
if (dcSrc) DC_ReleaseDCPtr( dcSrc );
}
else if(dcDst && dcDst->funcs->pStretchDIBits)
{
......@@ -82,7 +82,7 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
LPVOID bits;
INT lines;
GDI_ReleaseObj( hdcDst );
DC_ReleaseDCPtr( dcDst );
if(GetObjectType( hdcSrc ) != OBJ_MEMDC)
{
......@@ -119,7 +119,7 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
return (lines == height);
}
else if(dcDst)
GDI_ReleaseObj( hdcDst );
DC_ReleaseDCPtr( dcDst );
return ret;
}
......@@ -139,7 +139,7 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
if ((dcDst = DC_GetDCUpdate( hdcDst )) && dcDst->funcs->pStretchBlt)
{
GDI_ReleaseObj( hdcDst );
DC_ReleaseDCPtr( dcDst );
/* FIXME: there is a race condition here */
if ((dcSrc = DC_GetDCUpdate( hdcSrc )))
{
......@@ -152,8 +152,8 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
ret = dcDst->funcs->pStretchBlt( dcDst->physDev, xDst, yDst, widthDst, heightDst,
dcSrc->physDev, xSrc, ySrc, widthSrc, heightSrc,
rop );
GDI_ReleaseObj( hdcDst );
GDI_ReleaseObj( hdcSrc );
DC_ReleaseDCPtr( dcDst );
DC_ReleaseDCPtr( dcSrc );
}
}
else if(dcDst && dcDst->funcs->pStretchDIBits)
......@@ -164,7 +164,7 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
LPVOID bits;
INT lines;
GDI_ReleaseObj( hdcDst );
DC_ReleaseDCPtr( dcDst );
if(GetObjectType( hdcSrc ) != OBJ_MEMDC) return FALSE;
......@@ -197,7 +197,7 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
return (lines == heightSrc);
}
else if(dcDst)
GDI_ReleaseObj( hdcDst );
DC_ReleaseDCPtr( dcDst );
return ret;
}
......@@ -496,7 +496,7 @@ BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heig
BOOL ret = FALSE;
DC *dcDst, *dcSrc;
if ((dcSrc = DC_GetDCUpdate( hdcSrc ))) GDI_ReleaseObj( hdcSrc );
if ((dcSrc = DC_GetDCUpdate( hdcSrc ))) DC_ReleaseDCPtr( dcSrc );
/* FIXME: there is a race condition here */
if ((dcDst = DC_GetDCUpdate( hdcDst )))
{
......@@ -510,8 +510,8 @@ BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heig
ret = dcDst->funcs->pAlphaBlend( dcDst->physDev, xDst, yDst, widthDst, heightDst,
dcSrc ? dcSrc->physDev : NULL,
xSrc, ySrc, widthSrc, heightSrc, blendFunction );
if (dcSrc) GDI_ReleaseObj( hdcSrc );
GDI_ReleaseObj( hdcDst );
if (dcSrc) DC_ReleaseDCPtr( dcSrc );
DC_ReleaseDCPtr( dcDst );
}
return ret;
}
......
......@@ -207,7 +207,7 @@ HBITMAP WINAPI CreateCompatibleBitmap( HDC hdc, INT width, INT height)
}
GDI_ReleaseObj(dc->hBitmap);
}
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr( dc );
}
TRACE("\t\t%p\n", hbmpRet);
......@@ -563,7 +563,7 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, void *obj, HDC hdc )
if (!dc) return 0;
if (GetObjectType( hdc ) != OBJ_MEMDC)
{
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return 0;
}
ret = dc->hBitmap;
......@@ -572,13 +572,13 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, void *obj, HDC hdc )
if (bitmap->header.dwCount && (handle != GetStockObject(DEFAULT_BITMAP)))
{
WARN( "Bitmap already selected in another DC\n" );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return 0;
}
if (!bitmap->funcs && !BITMAP_SetOwnerDC( handle, dc ))
{
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return 0;
}
......@@ -594,7 +594,7 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, void *obj, HDC hdc )
else ret = 0;
done:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......
......@@ -346,7 +346,7 @@ BOOL WINAPI SetBrushOrgEx( HDC hdc, INT x, INT y, LPPOINT oldorg )
}
dc->brushOrgX = x;
dc->brushOrgY = y;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return TRUE;
}
......@@ -383,7 +383,7 @@ static HGDIOBJ BRUSH_SelectObject( HGDIOBJ handle, void *obj, HDC hdc )
if (dc->funcs->pSelectBrush) handle = dc->funcs->pSelectBrush( dc->physDev, handle );
if (handle) dc->hBrush = handle;
else ret = 0;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......
......@@ -129,7 +129,7 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode )
if (dc->funcs->pExtSelectClipRgn)
{
retval = dc->funcs->pExtSelectClipRgn( dc->physDev, hrgn, fnMode );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return retval;
}
......@@ -143,7 +143,7 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode )
else
{
FIXME("Unimplemented: hrgn NULL in mode: %d\n", fnMode);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ERROR;
}
}
......@@ -159,7 +159,7 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode )
}
CLIPPING_UpdateGCRegion( dc );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return GetClipBox(hdc, &rect);
}
......@@ -182,7 +182,7 @@ INT16 WINAPI SelectVisRgn16( HDC16 hdc16, HRGN16 hrgn )
retval = CombineRgn( dc->hVisRgn, HRGN_32(hrgn), 0, RGN_COPY );
CLIPPING_UpdateGCRegion( dc );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return retval;
}
......@@ -208,7 +208,7 @@ INT WINAPI OffsetClipRgn( HDC hdc, INT x, INT y )
MulDiv( y, dc->vportExtY, dc->wndExtY ) );
CLIPPING_UpdateGCRegion( dc );
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -225,7 +225,7 @@ INT16 WINAPI OffsetVisRgn16( HDC16 hdc16, INT16 x, INT16 y )
TRACE("%p %d,%d\n", hdc, x, y );
retval = OffsetRgn( dc->hVisRgn, x, y );
CLIPPING_UpdateGCRegion( dc );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return retval;
}
......@@ -267,7 +267,7 @@ INT WINAPI ExcludeClipRect( HDC hdc, INT left, INT top,
}
if (ret != ERROR) CLIPPING_UpdateGCRegion( dc );
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -317,7 +317,7 @@ INT WINAPI IntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bottom
}
if (ret != ERROR) CLIPPING_UpdateGCRegion( dc );
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -350,7 +350,7 @@ INT16 WINAPI ExcludeVisRect16( HDC16 hdc16, INT16 left, INT16 top, INT16 right,
DeleteObject( tempRgn );
}
if (ret != ERROR) CLIPPING_UpdateGCRegion( dc );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -384,7 +384,7 @@ INT16 WINAPI IntersectVisRect16( HDC16 hdc16, INT16 left, INT16 top, INT16 right
DeleteObject( tempRgn );
}
if (ret != ERROR) CLIPPING_UpdateGCRegion( dc );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -407,7 +407,7 @@ BOOL WINAPI PtVisible( HDC hdc, INT x, INT y )
LPtoDP( hdc, &pt, 1 );
ret = PtInRegion( dc->hVisRgn, pt.x, pt.y );
if (ret && (clip = get_clip_region(dc))) ret = PtInRegion( clip, pt.x, pt.y );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -435,7 +435,7 @@ BOOL WINAPI RectVisible( HDC hdc, const RECT* rect )
DeleteObject( hrgn );
}
else ret = RectInRegion( dc->hVisRgn, &tmpRect );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -458,7 +458,7 @@ INT WINAPI GetClipBox( HDC hdc, LPRECT rect )
}
else ret = GetRgnBox( dc->hVisRgn, rect );
DPtoLP( hdc, (LPPOINT)rect, 2 );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -477,7 +477,7 @@ INT WINAPI GetClipRgn( HDC hdc, HRGN hRgn )
if( CombineRgn(hRgn, dc->hClipRgn, 0, RGN_COPY) != ERROR ) ret = 1;
}
else ret = 0;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -495,7 +495,7 @@ INT WINAPI GetMetaRgn( HDC hdc, HRGN hRgn )
{
if (dc->hMetaRgn && CombineRgn( hRgn, dc->hMetaRgn, 0, RGN_COPY ) != ERROR)
ret = 1;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -518,11 +518,11 @@ HRGN16 WINAPI SaveVisRgn16( HDC16 hdc16 )
CombineRgn( saved->hrgn, dc->hVisRgn, 0, RGN_COPY );
saved->next = dc->saved_visrgn;
dc->saved_visrgn = saved;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return HRGN_16(saved->hrgn);
error:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
HeapFree( GetProcessHeap(), 0, saved );
return 0;
}
......@@ -551,7 +551,7 @@ INT16 WINAPI RestoreVisRgn16( HDC16 hdc16 )
dc->flags &= ~DC_DIRTY;
CLIPPING_UpdateGCRegion( dc );
done:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -595,11 +595,11 @@ INT WINAPI GetRandomRgn(HDC hDC, HRGN hRgn, INT iCode)
break;
default:
WARN("Unknown code %d\n", iCode);
GDI_ReleaseObj( hDC );
DC_ReleaseDCPtr( dc );
return -1;
}
if (rgn) CombineRgn( hRgn, rgn, 0, RGN_COPY );
GDI_ReleaseObj( hDC );
DC_ReleaseDCPtr( dc );
/* On Windows NT/2000, the SYSRGN returned is in screen coordinates */
if (iCode == SYSRGN && !(GetVersion() & 0x80000000))
......@@ -642,6 +642,6 @@ INT WINAPI SetMetaRgn( HDC hdc )
/* Note: no need to call CLIPPING_UpdateGCRegion, the overall clip region hasn't changed */
ret = GetRgnBox( dc->hMetaRgn, &dummy );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -201,7 +201,7 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
heightSrc = dc->funcs->pStretchDIBits(dc->physDev, xDst, yDst, widthDst,
heightDst, xSrc, ySrc, widthSrc,
heightSrc, bits, info, wUsage, dwRop);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
else /* use StretchBlt */
{
......@@ -213,7 +213,7 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
WORD planes, bpp;
DWORD compr, size;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
if (DIB_GetBitmapInfo( &info->bmiHeader, &width, &height, &planes, &bpp, &compr, &size ) == -1)
{
......@@ -311,7 +311,7 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
if (!(bitmap = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
{
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return 0;
}
......@@ -325,7 +325,7 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
done:
GDI_ReleaseObj( hbitmap );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return result;
}
......@@ -354,7 +354,7 @@ INT WINAPI SetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx,
ret = 0;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -387,7 +387,7 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, CONST RGBQUA
if (dc->funcs->pSetDIBColorTable)
dc->funcs->pSetDIBColorTable(dc->physDev, startpos, entries, colors);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return result;
}
......@@ -422,7 +422,7 @@ UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries, RGBQUAD *col
GDI_ReleaseObj( dc->hBitmap );
}
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return result;
}
......@@ -570,7 +570,7 @@ INT WINAPI GetDIBits(
}
if (!(bmp = (BITMAPOBJ *)GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
{
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return 0;
}
......@@ -622,7 +622,7 @@ INT WINAPI GetDIBits(
memset( palEntry, 0, sizeof(palEntry) );
if (!GetPaletteEntries( dc->hPalette, 0, 1 << bmp->bitmap.bmBitsPixel, palEntry ))
{
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
GDI_ReleaseObj( hbitmap );
return 0;
}
......@@ -1019,7 +1019,7 @@ INT WINAPI GetDIBits(
}
TRACE("biWidth = %d, biHeight = %d\n", width, height);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
GDI_ReleaseObj( hbitmap );
return lines;
}
......@@ -1072,7 +1072,7 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header,
DeleteObject( handle );
handle = 0;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
}
......@@ -1337,7 +1337,7 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage,
}
}
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr( dc );
if (bDesktopDC) DeleteDC( hdc );
if (ret && bits) *bits = dib->dsBm.bmBits;
return ret;
......
......@@ -514,7 +514,7 @@ INT WINAPI GDI_CallExtDeviceMode16( HWND hwnd,
if ((dc = DC_GetDCPtr( hdc )))
{
pExtDeviceMode = dc->funcs->pExtDeviceMode;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
if (pExtDeviceMode)
ret = pExtDeviceMode(buf, hwnd, lpdmOutput, lpszDevice, lpszPort,
lpdmInput, lpszProfile, fwMode);
......@@ -571,7 +571,7 @@ DWORD WINAPI GDI_CallDeviceCapabilities16( LPCSTR lpszDevice, LPCSTR lpszPort,
if (dc->funcs->pDeviceCapabilities)
ret = dc->funcs->pDeviceCapabilities( buf, lpszDevice, lpszPort,
fwCapability, lpszOutput, lpdm );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
DeleteDC( hdc );
return ret;
......@@ -700,7 +700,7 @@ INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData,
{
if (dc->funcs->pExtEscape)
ret = dc->funcs->pExtEscape( dc->physDev, nEscape, cbInput, lpszInData, cbOutput, lpszOutData );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......
......@@ -172,7 +172,7 @@ static BOOL EMFDRV_DeleteDC( PHYSDEV dev )
HeapFree( GetProcessHeap(), 0, physDev->handles );
HeapFree( GetProcessHeap(), 0, physDev );
dc->physDev = NULL;
GDI_FreeObject( dc->hSelf, dc );
DC_FreeDCPtr( dc );
return TRUE;
}
......@@ -319,7 +319,7 @@ HDC WINAPI CreateEnhMetaFileW(
physDev = HeapAlloc(GetProcessHeap(),0,sizeof(*physDev));
if (!physDev) {
GDI_FreeObject( dc->hSelf, dc );
DC_FreeDCPtr( dc );
return 0;
}
dc->physDev = (PHYSDEV)physDev;
......@@ -336,7 +336,7 @@ HDC WINAPI CreateEnhMetaFileW(
if (!(physDev->emh = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size))) {
HeapFree( GetProcessHeap(), 0, physDev );
GDI_FreeObject( dc->hSelf, dc );
DC_FreeDCPtr( dc );
return 0;
}
......@@ -417,7 +417,7 @@ HDC WINAPI CreateEnhMetaFileW(
TRACE("returning %p\n", dc->hSelf);
ret = dc->hSelf;
GDI_ReleaseObj( dc->hSelf );
DC_ReleaseDCPtr( dc );
if( !hdc )
DeleteDC( hRefDC );
......@@ -438,7 +438,12 @@ HENHMETAFILE WINAPI CloseEnhMetaFile(HDC hdc) /* [in] metafile DC */
TRACE("(%p)\n", hdc );
if (!(dc = (DC *) GDI_GetObjPtr( hdc, ENHMETAFILE_DC_MAGIC ))) return 0;
if (!(dc = DC_GetDCPtr( hdc ))) return NULL;
if (GDIMAGIC(dc->header.wMagic) != ENHMETAFILE_DC_MAGIC)
{
DC_ReleaseDCPtr( dc );
return NULL;
}
physDev = (EMFDRV_PDEVICE *)dc->physDev;
if(dc->saveLevel)
......
......@@ -609,7 +609,7 @@ static HGDIOBJ FONT_SelectObject( HGDIOBJ handle, void *obj, HDC hdc )
ret = dc->hFont;
dc->hFont = handle;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -695,7 +695,7 @@ static INT CALLBACK FONT_EnumInstance16( const LOGFONTW *plf, const TEXTMETRICW
FONT_EnumLogFontExWTo16((const ENUMLOGFONTEXW *)plf, pfe->lpLogFont);
FONT_NewTextMetricExWTo16((const NEWTEXTMETRICEXW *)ptm, pfe->lpTextMetric);
pfe->dwFlags |= ENUM_CALLED;
GDI_ReleaseObj( pfe->hdc ); /* release the GDI lock */
DC_ReleaseDCPtr( pfe->dc ); /* release the GDI lock */
args[6] = SELECTOROF(pfe->segLogFont);
args[5] = OFFSETOF(pfe->segLogFont);
......@@ -711,8 +711,9 @@ static INT CALLBACK FONT_EnumInstance16( const LOGFONTW *plf, const TEXTMETRICW
dc = DC_GetDCPtr( pfe->hdc );
if (!dc || dc != pfe->dc || dc->physDev != pfe->physDev)
{
if (dc) GDI_ReleaseObj( pfe->hdc );
if (dc) DC_ReleaseDCPtr( dc );
pfe->hdc = 0; /* make sure we don't try to release it later on */
pfe->dc = NULL;
ret = 0;
}
}
......@@ -749,7 +750,7 @@ static INT CALLBACK FONT_EnumInstance( const LOGFONTW *plf, const TEXTMETRICW *p
plf = (LOGFONTW *)&logfont.elfLogFont;
ptm = (TEXTMETRICW *)&tmA;
}
GDI_ReleaseObj( pfe->hdc ); /* release the GDI lock */
DC_ReleaseDCPtr( pfe->dc ); /* release the GDI lock */
ret = pfe->lpEnumFunc( plf, ptm, fType, pfe->lpData );
......@@ -757,8 +758,9 @@ static INT CALLBACK FONT_EnumInstance( const LOGFONTW *plf, const TEXTMETRICW *p
dc = DC_GetDCPtr( pfe->hdc );
if (!dc || dc != pfe->dc || dc->physDev != pfe->physDev)
{
if (dc) GDI_ReleaseObj( pfe->hdc );
if (dc) DC_ReleaseDCPtr( dc );
pfe->hdc = 0; /* make sure we don't try to release it later on */
pfe->dc = NULL;
ret = 0;
}
}
......@@ -814,7 +816,7 @@ INT16 WINAPI EnumFontFamiliesEx16( HDC16 hDC, LPLOGFONT16 plf,
done:
UnMapLS( fe16.segTextMetric );
UnMapLS( fe16.segLogFont );
if (fe16.hdc) GDI_ReleaseObj( fe16.hdc );
if (fe16.dc) DC_ReleaseDCPtr( fe16.dc );
return ret;
}
......@@ -859,7 +861,7 @@ static INT FONT_EnumFontFamiliesEx( HDC hDC, LPLOGFONTW plf,
ret = ret2;
}
done:
if (fe32.hdc) GDI_ReleaseObj( fe32.hdc );
if (fe32.dc) DC_ReleaseDCPtr( fe32.dc );
return ret;
}
......@@ -980,7 +982,7 @@ INT WINAPI GetTextCharacterExtra( HDC hdc )
DC *dc = DC_GetDCPtr( hdc );
if (!dc) return 0x80000000;
ret = dc->charExtra;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -1000,7 +1002,7 @@ INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra )
prev = dc->charExtra;
dc->charExtra = extra;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return prev;
}
......@@ -1030,7 +1032,7 @@ BOOL WINAPI SetTextJustification( HDC hdc, INT extra, INT breaks )
dc->breakRem = 0;
}
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -1079,7 +1081,7 @@ INT WINAPI GetTextFaceW( HDC hdc, INT count, LPWSTR name )
else ret = strlenW(font->logfont.lfFaceName) + 1;
GDI_ReleaseObj( dc->hFont );
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -1158,7 +1160,7 @@ BOOL WINAPI GetTextExtentPointI(
count, 0, NULL, NULL, size );
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
TRACE("(%p %p %d %p): returning %d x %d\n",
hdc, indices, count, size, size->cx, size->cy );
......@@ -1278,7 +1280,7 @@ BOOL WINAPI GetTextExtentExPointW( HDC hdc, LPCWSTR str, INT count,
dxs = alpDx ? alpDx : HeapAlloc(GetProcessHeap(), 0, count * sizeof alpDx[0]);
if (! dxs)
{
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr(dc);
SetLastError(ERROR_OUTOFMEMORY);
return FALSE;
}
......@@ -1347,7 +1349,7 @@ BOOL WINAPI GetTextExtentExPointW( HDC hdc, LPCWSTR str, INT count,
if (! alpDx)
HeapFree(GetProcessHeap(), 0, dxs);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
TRACE("returning %d %d x %d\n",nFit,size->cx,size->cy);
return ret;
......@@ -1426,7 +1428,7 @@ BOOL WINAPI GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics )
metrics->tmDescent,
metrics->tmHeight );
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -1717,7 +1719,7 @@ UINT WINAPI GetOutlineTextMetricsW(
}
}
}
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr(dc);
return ret;
}
......@@ -1746,7 +1748,7 @@ BOOL WINAPI GetCharWidth32W( HDC hdc, UINT firstChar, UINT lastChar,
*buffer = INTERNAL_XDSTOWS(dc, *buffer);
ret = TRUE;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -1889,7 +1891,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
if (!dc->funcs->pExtTextOut && !PATH_IsPathOpen(dc->path))
{
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -1897,7 +1899,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
if(type == OBJ_METADC || type == OBJ_ENHMETADC)
{
ret = dc->funcs->pExtTextOut(dc->physDev, x, y, flags, lprect, str, count, lpDx);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -2196,7 +2198,7 @@ done:
if(reordered_str != str)
HeapFree(GetProcessHeap(), 0, reordered_str);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
if (ret && (lf.lfUnderline || lf.lfStrikeOut))
{
......@@ -2378,7 +2380,7 @@ DWORD WINAPI SetMapperFlags( HDC hDC, DWORD dwFlag )
}
else
FIXME("(%p, 0x%08x): stub - harmless\n", hDC, dwFlag);
GDI_ReleaseObj( hDC );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -2482,7 +2484,7 @@ BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar,
ret = TRUE;
}
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -2531,7 +2533,7 @@ BOOL WINAPI GetCharABCWidthsI( HDC hdc, UINT firstChar, UINT count,
ret = TRUE;
}
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -2589,7 +2591,7 @@ DWORD WINAPI GetGlyphOutlineW( HDC hdc, UINT uChar, UINT fuFormat,
else
ret = GDI_ERROR;
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -2728,7 +2730,7 @@ DWORD WINAPI GetKerningPairsW( HDC hDC, DWORD cPairs,
if (dc->gdiFont)
ret = WineEngGetKerningPairs(dc->gdiFont, cPairs, lpKerningPairs);
GDI_ReleaseObj(hDC);
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -2851,7 +2853,7 @@ DWORD WINAPI GetFontData(HDC hdc, DWORD table, DWORD offset,
if(dc->gdiFont)
ret = WineEngGetFontData(dc->gdiFont, table, offset, buffer, length);
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -2892,7 +2894,7 @@ DWORD WINAPI GetGlyphIndicesW(HDC hdc, LPCWSTR lpstr, INT count,
if(dc->gdiFont)
ret = WineEngGetGlyphIndices(dc->gdiFont, lpstr, count, pgi, flags);
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -3261,7 +3263,7 @@ UINT WINAPI GetTextCharsetInfo(HDC hdc, LPFONTSIGNATURE fs, DWORD flags)
if (dc->gdiFont)
ret = WineEngGetTextCharsetInfo(dc->gdiFont, fs, flags);
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr( dc );
}
if (ret == DEFAULT_CHARSET && fs)
......
......@@ -4564,7 +4564,7 @@ DWORD WineEngGetFontUnicodeRanges(HDC hdc, LPGLYPHSET glyphset)
}
}
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr(dc);
return size;
}
......@@ -4579,7 +4579,7 @@ BOOL WINAPI FontIsLinked(HDC hdc)
if(!dc) return FALSE;
if(dc->gdiFont && !list_empty(&dc->gdiFont->child_fonts))
ret = TRUE;
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr(dc);
TRACE("returning %d\n", ret);
return ret;
}
......
......@@ -395,6 +395,8 @@ extern void CLIPPING_UpdateGCRegion( DC * dc );
extern DC * DC_AllocDC( const DC_FUNCTIONS *funcs, WORD magic );
extern DC * DC_GetDCUpdate( HDC hdc );
extern DC * DC_GetDCPtr( HDC hdc );
extern void DC_ReleaseDCPtr( DC *dc );
extern BOOL DC_FreeDCPtr( DC *dc );
extern void DC_InitDC( DC * dc );
extern void DC_UpdateXforms( DC * dc );
......
......@@ -1115,7 +1115,7 @@ HGDIOBJ WINAPI GetCurrentObject(HDC hdc,UINT type)
FIXME("(%p,%d): unknown type.\n",hdc,type);
break;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -1149,7 +1149,7 @@ HGDIOBJ WINAPI SelectObject( HDC hdc, HGDIOBJ hObj )
SetLastError( ERROR_INVALID_HANDLE );
else
{
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
header = GDI_GetObjPtr( hObj, MAGIC_DONTCARE );
if (header)
......@@ -1449,7 +1449,7 @@ BOOL WINAPI GdiComment(HDC hdc, UINT cbSize, const BYTE *lpData)
if (dc->funcs->pGdiComment)
ret = dc->funcs->pGdiComment( dc->physDev, cbSize, lpData );
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......
......@@ -71,7 +71,7 @@ BOOL16 WINAPI DPtoLP16( HDC16 hdc, LPPOINT16 points, INT16 count )
points->y = MulDiv( points->y - dc->vportOrgY, dc->wndExtY, dc->vportExtY ) + dc->wndOrgY;
points++;
}
GDI_ReleaseObj( HDC_32(hdc) );
DC_ReleaseDCPtr( dc );
return TRUE;
}
......@@ -99,7 +99,7 @@ BOOL WINAPI DPtoLP( HDC hdc, LPPOINT points, INT count )
points++;
}
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return (count < 0);
}
......@@ -118,7 +118,7 @@ BOOL16 WINAPI LPtoDP16( HDC16 hdc, LPPOINT16 points, INT16 count )
points->y = MulDiv( points->y - dc->wndOrgY, dc->vportExtY, dc->wndExtY ) + dc->vportOrgY;
points++;
}
GDI_ReleaseObj( HDC_32(hdc) );
DC_ReleaseDCPtr( dc );
return TRUE;
}
......@@ -143,7 +143,7 @@ BOOL WINAPI LPtoDP( HDC hdc, LPPOINT points, INT count )
dc->xformWorld2Vport.eDy + 0.5 );
points++;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return TRUE;
}
......@@ -226,7 +226,7 @@ INT WINAPI SetMapMode( HDC hdc, INT mode )
dc->MapMode = mode;
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -265,7 +265,7 @@ BOOL WINAPI SetViewportExtEx( HDC hdc, INT x, INT y, LPSIZE size )
if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -297,7 +297,7 @@ BOOL WINAPI SetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -339,7 +339,7 @@ BOOL WINAPI SetWindowExtEx( HDC hdc, INT x, INT y, LPSIZE size )
if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -370,7 +370,7 @@ BOOL WINAPI SetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
dc->wndOrgY = y;
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -401,7 +401,7 @@ BOOL WINAPI OffsetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt)
dc->vportOrgY += y;
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -432,7 +432,7 @@ BOOL WINAPI OffsetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
dc->wndOrgY += y;
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -474,7 +474,7 @@ BOOL WINAPI ScaleViewportExtEx( HDC hdc, INT xNum, INT xDenom,
if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -516,6 +516,6 @@ BOOL WINAPI ScaleWindowExtEx( HDC hdc, INT xNum, INT xDenom,
if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -170,7 +170,7 @@ static DC *MFDRV_AllocMetaFile(void)
physDev = HeapAlloc(GetProcessHeap(),0,sizeof(*physDev));
if (!physDev)
{
GDI_FreeObject( dc->hSelf, dc );
DC_FreeDCPtr( dc );
return NULL;
}
dc->physDev = (PHYSDEV)physDev;
......@@ -180,7 +180,7 @@ static DC *MFDRV_AllocMetaFile(void)
if (!(physDev->mh = HeapAlloc( GetProcessHeap(), 0, sizeof(*physDev->mh) )))
{
HeapFree( GetProcessHeap(), 0, physDev );
GDI_FreeObject( dc->hSelf, dc );
DC_FreeDCPtr( dc );
return NULL;
}
......@@ -217,7 +217,7 @@ static BOOL MFDRV_DeleteDC( PHYSDEV dev )
HeapFree( GetProcessHeap(), 0, physDev->handles );
HeapFree( GetProcessHeap(), 0, physDev );
dc->physDev = NULL;
GDI_FreeObject( dc->hSelf, dc );
DC_FreeDCPtr( dc );
return TRUE;
}
......@@ -269,7 +269,7 @@ HDC WINAPI CreateMetaFileW( LPCWSTR filename )
TRACE("returning %p\n", dc->hSelf);
ret = dc->hSelf;
GDI_ReleaseObj( dc->hSelf );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -308,7 +308,12 @@ static DC *MFDRV_CloseMetaFile( HDC hdc )
TRACE("(%p)\n", hdc );
if (!(dc = (DC *) GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ))) return 0;
if (!(dc = DC_GetDCPtr( hdc ))) return NULL;
if (GDIMAGIC(dc->header.wMagic) != METAFILE_DC_MAGIC)
{
DC_ReleaseDCPtr( dc );
return NULL;
}
physDev = (METAFILEDRV_PDEVICE *)dc->physDev;
/* Construct the end of metafile record - this is documented
......
......@@ -74,7 +74,7 @@ HGLRC WINAPI wglCreateContext(HDC hdc)
if (!dc->funcs->pwglCreateContext) FIXME(" :stub\n");
else ret = dc->funcs->pwglCreateContext(dc->physDev);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -99,7 +99,7 @@ BOOL WINAPI wglDeleteContext(HGLRC hglrc)
if (!dc->funcs->pwglDeleteContext) FIXME(" :stub\n");
else ret = dc->funcs->pwglDeleteContext(hglrc);
GDI_ReleaseObj(ctx->hdc);
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -152,7 +152,7 @@ static HDC WINAPI wglGetPbufferDCARB(void *pbuffer)
TRACE("(%p), hdc=%p\n", pbuffer, ret);
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -178,11 +178,7 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
if (!dc->funcs->pwglMakeCurrent) FIXME(" :stub\n");
else ret = dc->funcs->pwglMakeCurrent(dc->physDev,hglrc);
if(hglrc == NULL)
GDI_ReleaseObj(default_hdc);
else
GDI_ReleaseObj(hdc);
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -203,15 +199,15 @@ static BOOL WINAPI wglMakeContextCurrentARB(HDC hDrawDC, HDC hReadDC, HGLRC hglr
ReadDC = DC_GetDCPtr( hReadDC);
if (!ReadDC) {
GDI_ReleaseObj(hDrawDC);
DC_ReleaseDCPtr(DrawDC);
return FALSE;
}
if (!DrawDC->funcs->pwglMakeContextCurrentARB) FIXME(" :stub\n");
else ret = DrawDC->funcs->pwglMakeContextCurrentARB(DrawDC->physDev, ReadDC->physDev, hglrc);
GDI_ReleaseObj(hDrawDC);
GDI_ReleaseObj(hReadDC);
DC_ReleaseDCPtr(DrawDC);
DC_ReleaseDCPtr(ReadDC);
return ret;
}
......@@ -236,7 +232,7 @@ BOOL WINAPI wglShareLists(HGLRC hglrc1, HGLRC hglrc2)
if (!dc->funcs->pwglShareLists) FIXME(" :stub\n");
else ret = dc->funcs->pwglShareLists(hglrc1, hglrc2);
GDI_ReleaseObj(ctx->hdc);
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -255,7 +251,7 @@ BOOL WINAPI wglUseFontBitmapsA(HDC hdc, DWORD first, DWORD count, DWORD listBase
if (!dc->funcs->pwglUseFontBitmapsA) FIXME(" :stub\n");
else ret = dc->funcs->pwglUseFontBitmapsA(dc->physDev, first, count, listBase);
GDI_ReleaseObj( hdc);
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -274,7 +270,7 @@ BOOL WINAPI wglUseFontBitmapsW(HDC hdc, DWORD first, DWORD count, DWORD listBase
if (!dc->funcs->pwglUseFontBitmapsW) FIXME(" :stub\n");
else ret = dc->funcs->pwglUseFontBitmapsW(dc->physDev, first, count, listBase);
GDI_ReleaseObj( hdc);
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -298,7 +294,7 @@ PROC WINAPI wglGetProcAddress(LPCSTR func)
if (!dc->funcs->pwglGetProcAddress) FIXME(" :stub\n");
else ret = dc->funcs->pwglGetProcAddress(func);
GDI_ReleaseObj(default_hdc);
DC_ReleaseDCPtr( dc );
/* At the moment we implement one WGL extension which requires a HDC. When we
* are looking up this call and when the Extension is available (that is the case
......
......@@ -55,7 +55,7 @@ BOOL WINAPI LineTo( HDC hdc, INT x, INT y )
dc->CursPosX = x;
dc->CursPosY = y;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -79,7 +79,7 @@ BOOL WINAPI MoveToEx( HDC hdc, INT x, INT y, LPPOINT pt )
if(PATH_IsPathOpen(dc->path)) ret = PATH_MoveTo(dc);
else if (dc->funcs->pMoveTo) ret = dc->funcs->pMoveTo(dc->physDev,x,y);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -99,7 +99,7 @@ BOOL WINAPI Arc( HDC hdc, INT left, INT top, INT right,
ret = PATH_Arc(dc, left, top, right, bottom, xstart, ystart, xend, yend,0);
else if (dc->funcs->pArc)
ret = dc->funcs->pArc(dc->physDev,left,top,right,bottom,xstart,ystart,xend,yend);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -143,7 +143,7 @@ BOOL WINAPI ArcTo( HDC hdc,
dc->CursPosX = GDI_ROUND(xcenter+(cos(angle)*xradius));
dc->CursPosY = GDI_ROUND(ycenter+(sin(angle)*yradius));
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return result;
}
......@@ -164,7 +164,7 @@ BOOL WINAPI Pie( HDC hdc, INT left, INT top,
else if(dc->funcs->pPie)
ret = dc->funcs->pPie(dc->physDev,left,top,right,bottom,xstart,ystart,xend,yend);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -185,7 +185,7 @@ BOOL WINAPI Chord( HDC hdc, INT left, INT top,
else if(dc->funcs->pChord)
ret = dc->funcs->pChord(dc->physDev,left,top,right,bottom,xstart,ystart,xend,yend);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -205,7 +205,7 @@ BOOL WINAPI Ellipse( HDC hdc, INT left, INT top,
else if (dc->funcs->pEllipse)
ret = dc->funcs->pEllipse(dc->physDev,left,top,right,bottom);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -224,7 +224,7 @@ BOOL WINAPI Rectangle( HDC hdc, INT left, INT top,
ret = PATH_Rectangle(dc, left, top, right, bottom);
else if (dc->funcs->pRectangle)
ret = dc->funcs->pRectangle(dc->physDev,left,top,right,bottom);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -245,7 +245,7 @@ BOOL WINAPI RoundRect( HDC hdc, INT left, INT top, INT right,
ret = PATH_RoundRect(dc,left,top,right,bottom,ell_width,ell_height);
else if (dc->funcs->pRoundRect)
ret = dc->funcs->pRoundRect(dc->physDev,left,top,right,bottom,ell_width,ell_height);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -260,7 +260,7 @@ COLORREF WINAPI SetPixel( HDC hdc, INT x, INT y, COLORREF color )
if (dc)
{
if (dc->funcs->pSetPixel) ret = dc->funcs->pSetPixel(dc->physDev,x,y,color);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -279,7 +279,7 @@ BOOL WINAPI SetPixelV( HDC hdc, INT x, INT y, COLORREF color )
dc->funcs->pSetPixel(dc->physDev,x,y,color);
ret = TRUE;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -299,7 +299,7 @@ COLORREF WINAPI GetPixel( HDC hdc, INT x, INT y )
{
if (dc->funcs->pGetPixel) ret = dc->funcs->pGetPixel(dc->physDev,x,y);
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -329,7 +329,7 @@ INT WINAPI ChoosePixelFormat( HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd )
if (!dc->funcs->pChoosePixelFormat) FIXME(" :stub\n");
else ret = dc->funcs->pChoosePixelFormat(dc->physDev,ppfd);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -360,7 +360,7 @@ BOOL WINAPI SetPixelFormat( HDC hdc, INT iPixelFormat,
if (!dc->funcs->pSetPixelFormat) FIXME(" :stub\n");
else bRet = dc->funcs->pSetPixelFormat(dc->physDev,iPixelFormat,ppfd);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return bRet;
}
......@@ -388,7 +388,7 @@ INT WINAPI GetPixelFormat( HDC hdc )
if (!dc->funcs->pGetPixelFormat) FIXME(" :stub\n");
else ret = dc->funcs->pGetPixelFormat(dc->physDev);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -426,7 +426,7 @@ INT WINAPI DescribePixelFormat( HDC hdc, INT iPixelFormat, UINT nBytes,
}
else ret = dc->funcs->pDescribePixelFormat(dc->physDev,iPixelFormat,nBytes,ppfd);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -458,7 +458,7 @@ BOOL WINAPI SwapBuffers( HDC hdc )
}
else bRet = dc->funcs->pSwapBuffers(dc->physDev);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return bRet;
}
......@@ -473,7 +473,7 @@ BOOL WINAPI PaintRgn( HDC hdc, HRGN hrgn )
if (dc)
{
if (dc->funcs->pPaintRgn) ret = dc->funcs->pPaintRgn(dc->physDev,hrgn);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -496,7 +496,7 @@ BOOL WINAPI FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush )
retval = PaintRgn( hdc, hrgn );
SelectObject( hdc, prevBrush );
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return retval;
}
......@@ -526,7 +526,7 @@ BOOL WINAPI FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush,
DeleteObject( tmp );
}
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -552,7 +552,7 @@ BOOL WINAPI InvertRgn( HDC hdc, HRGN hrgn )
SelectObject( hdc, prevBrush );
SetROP2( hdc, prevROP );
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return retval;
}
......@@ -568,7 +568,7 @@ BOOL WINAPI Polyline( HDC hdc, const POINT* pt, INT count )
{
if (PATH_IsPathOpen(dc->path)) ret = PATH_Polyline(dc, pt, count);
else if (dc->funcs->pPolyline) ret = dc->funcs->pPolyline(dc->physDev,pt,count);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -605,7 +605,7 @@ BOOL WINAPI PolylineTo( HDC hdc, const POINT* pt, DWORD cCount )
dc->CursPosX = pt[cCount-1].x;
dc->CursPosY = pt[cCount-1].y;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -621,7 +621,7 @@ BOOL WINAPI Polygon( HDC hdc, const POINT* pt, INT count )
{
if (PATH_IsPathOpen(dc->path)) ret = PATH_Polygon(dc, pt, count);
else if (dc->funcs->pPolygon) ret = dc->funcs->pPolygon(dc->physDev,pt,count);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -639,7 +639,7 @@ BOOL WINAPI PolyPolygon( HDC hdc, const POINT* pt, const INT* counts,
{
if (PATH_IsPathOpen(dc->path)) ret = PATH_PolyPolygon(dc, pt, counts, polygons);
else if (dc->funcs->pPolyPolygon) ret = dc->funcs->pPolyPolygon(dc->physDev,pt,counts,polygons);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -656,7 +656,7 @@ BOOL WINAPI PolyPolyline( HDC hdc, const POINT* pt, const DWORD* counts,
{
if (PATH_IsPathOpen(dc->path)) ret = PATH_PolyPolyline(dc, pt, counts, polylines);
else if (dc->funcs->pPolyPolyline) ret = dc->funcs->pPolyPolyline(dc->physDev,pt,counts,polylines);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -672,7 +672,7 @@ BOOL WINAPI ExtFloodFill( HDC hdc, INT x, INT y, COLORREF color,
if (dc)
{
if (dc->funcs->pExtFloodFill) ret = dc->funcs->pExtFloodFill(dc->physDev,x,y,color,fillType);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -728,7 +728,7 @@ BOOL WINAPI PolyBezier( HDC hdc, const POINT* lppt, DWORD cPoints )
}
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -774,7 +774,7 @@ BOOL WINAPI PolyBezierTo( HDC hdc, const POINT* lppt, DWORD cPoints )
dc->CursPosX = lppt[cPoints-1].x;
dc->CursPosY = lppt[cPoints-1].y;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -812,7 +812,7 @@ BOOL WINAPI AngleArc(HDC hdc, INT x, INT y, DWORD dwRadius, FLOAT eStartAngle, F
dc->CursPosX = x2;
dc->CursPosY = y2;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return result;
}
......@@ -908,7 +908,7 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes,
}
end:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return result;
}
......
......@@ -519,7 +519,7 @@ UINT WINAPI GetSystemPaletteEntries(
{
if (dc->funcs->pGetSystemPaletteEntries)
ret = dc->funcs->pGetSystemPaletteEntries( dc->physDev, start, count, entries );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
}
return ret;
}
......@@ -589,13 +589,13 @@ COLORREF WINAPI GetNearestColor(
if (dc->funcs->pGetNearestColor)
{
nearest = dc->funcs->pGetNearestColor( dc->physDev, color );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return nearest;
}
if (!(GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE))
{
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return color;
}
......@@ -618,14 +618,14 @@ COLORREF WINAPI GetNearestColor(
WARN("RGB(%x) : idx %d is out of bounds, assuming NULL\n", color, index );
if (!GetPaletteEntries( hpal, 0, 1, &entry ))
{
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return CLR_INVALID;
}
}
color = RGB( entry.peRed, entry.peGreen, entry.peBlue );
}
nearest = color & 0x00ffffff;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
TRACE("(%06x): returning %06x\n", color, nearest );
return nearest;
......@@ -705,7 +705,7 @@ HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg)
if (!wBkg) hPrimaryPalette = hpal;
}
else ret = 0;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -744,7 +744,7 @@ UINT WINAPI GDIRealizePalette( HDC hdc )
}
else TRACE(" skipping (hLastRealizedPalette = %p)\n", hLastRealizedPalette);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
TRACE(" realized %i colors.\n", realized );
return realized;
}
......@@ -763,7 +763,7 @@ UINT16 WINAPI RealizeDefaultPalette16( HDC16 hdc )
if (!(dc = DC_GetDCPtr( HDC_32(hdc) ))) return 0;
if (dc->funcs->pRealizeDefaultPalette) ret = dc->funcs->pRealizeDefaultPalette( dc->physDev );
GDI_ReleaseObj( HDC_32(hdc) );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -776,7 +776,7 @@ BOOL16 WINAPI IsDCCurrentPalette16(HDC16 hDC)
if (dc)
{
BOOL bRet = dc->hPalette == hPrimaryPalette;
GDI_ReleaseObj( HDC_32(hDC) );
DC_ReleaseDCPtr( dc );
return bRet;
}
return FALSE;
......
......@@ -148,7 +148,7 @@ BOOL WINAPI BeginPath(HDC hdc)
dc->path.state=PATH_Open;
}
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -176,7 +176,7 @@ BOOL WINAPI EndPath(HDC hdc)
/* Set flag to indicate that path is finished */
else dc->path.state=PATH_Closed;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -206,7 +206,7 @@ BOOL WINAPI AbortPath( HDC hdc )
ret = dc->funcs->pAbortPath(dc->physDev);
else /* Remove all entries from the path */
PATH_EmptyPath( &dc->path );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -245,7 +245,7 @@ BOOL WINAPI CloseFigure(HDC hdc)
}
}
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -293,7 +293,7 @@ INT WINAPI GetPath(HDC hdc, LPPOINT pPoints, LPBYTE pTypes,
else ret = pPath->numEntriesUsed;
}
done:
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -328,7 +328,7 @@ HRGN WINAPI PathToRegion(HDC hdc)
else
hrgnRval=0;
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return hrgnRval;
}
......@@ -431,7 +431,7 @@ BOOL WINAPI FillPath(HDC hdc)
PATH_EmptyPath(&dc->path);
}
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return bRet;
}
......@@ -471,7 +471,7 @@ BOOL WINAPI SelectClipPath(HDC hdc, INT iMode)
/* FIXME: Should this function delete the path even if it failed? */
}
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return success;
}
......@@ -1709,7 +1709,7 @@ BOOL WINAPI FlattenPath(HDC hdc)
if(pPath->state != PATH_Closed)
ret = PATH_FlattenPath(pPath);
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -2204,7 +2204,7 @@ BOOL WINAPI StrokeAndFillPath(HDC hdc)
if(bRet) bRet = PATH_StrokePath(dc, &dc->path);
if(bRet) PATH_EmptyPath(&dc->path);
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return bRet;
}
......@@ -2231,7 +2231,7 @@ BOOL WINAPI StrokePath(HDC hdc)
bRet = PATH_StrokePath(dc, pPath);
PATH_EmptyPath(pPath);
}
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return bRet;
}
......@@ -2252,6 +2252,6 @@ BOOL WINAPI WidenPath(HDC hdc)
ret = dc->funcs->pWidenPath(dc->physDev);
else
ret = PATH_WidenPath(dc);
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -225,7 +225,7 @@ static HGDIOBJ PEN_SelectObject( HGDIOBJ handle, void *obj, HDC hdc )
if (dc->funcs->pSelectPen) handle = dc->funcs->pSelectPen( dc->physDev, handle );
if (handle) dc->hPen = handle;
else ret = 0;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......
......@@ -80,7 +80,7 @@ INT WINAPI StartDocW(HDC hdc, const DOCINFOW* doc)
if(!dc) return SP_ERROR;
if (dc->funcs->pStartDoc) ret = dc->funcs->pStartDoc( dc->physDev, doc );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -140,7 +140,7 @@ INT WINAPI EndDoc(HDC hdc)
if(!dc) return SP_ERROR;
if (dc->funcs->pEndDoc) ret = dc->funcs->pEndDoc( dc->physDev );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -159,7 +159,7 @@ INT WINAPI StartPage(HDC hdc)
ret = dc->funcs->pStartPage( dc->physDev );
else
FIXME("stub\n");
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -177,7 +177,7 @@ INT WINAPI EndPage(HDC hdc)
if (dc->funcs->pEndPage) ret = dc->funcs->pEndPage( dc->physDev );
abort_proc = dc->pAbortProc;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
if (abort_proc && !abort_proc( hdc, 0 ))
{
EndDoc( hdc );
......@@ -197,7 +197,7 @@ INT WINAPI AbortDoc(HDC hdc)
if(!dc) return SP_ERROR;
if (dc->funcs->pAbortDoc) ret = dc->funcs->pAbortDoc( dc->physDev );
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return ret;
}
......@@ -223,7 +223,7 @@ BOOL16 WINAPI QueryAbort16(HDC16 hdc16, INT16 reserved)
}
abproc = dc->pAbortProc;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
if (abproc)
ret = abproc(hdc, 0);
......@@ -241,7 +241,7 @@ static BOOL CALLBACK call_abort_proc16( HDC hdc, INT code )
if (!dc) return FALSE;
proc16 = dc->pAbortProc16;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
if (proc16)
{
WORD args[2];
......@@ -266,7 +266,7 @@ INT16 WINAPI SetAbortProc16(HDC16 hdc16, ABORTPROC16 abrtprc)
if (!dc) return FALSE;
dc->pAbortProc16 = abrtprc;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return SetAbortProc( hdc, call_abort_proc16 );
}
......@@ -280,7 +280,7 @@ INT WINAPI SetAbortProc(HDC hdc, ABORTPROC abrtprc)
if (!dc) return FALSE;
dc->pAbortProc = abrtprc;
GDI_ReleaseObj( hdc );
DC_ReleaseDCPtr( dc );
return TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment