Commit 67a9edbd authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Get rid of a few more uses of DC_GetDCPtr.

parent b962fca7
...@@ -336,7 +336,7 @@ HBRUSH WINAPI CreateSolidBrush( COLORREF color ) ...@@ -336,7 +336,7 @@ HBRUSH WINAPI CreateSolidBrush( COLORREF color )
*/ */
BOOL WINAPI SetBrushOrgEx( HDC hdc, INT x, INT y, LPPOINT oldorg ) BOOL WINAPI SetBrushOrgEx( HDC hdc, INT x, INT y, LPPOINT oldorg )
{ {
DC *dc = DC_GetDCPtr( hdc ); DC *dc = get_dc_ptr( hdc );
if (!dc) return FALSE; if (!dc) return FALSE;
if (oldorg) if (oldorg)
...@@ -346,7 +346,7 @@ BOOL WINAPI SetBrushOrgEx( HDC hdc, INT x, INT y, LPPOINT oldorg ) ...@@ -346,7 +346,7 @@ BOOL WINAPI SetBrushOrgEx( HDC hdc, INT x, INT y, LPPOINT oldorg )
} }
dc->brushOrgX = x; dc->brushOrgX = x;
dc->brushOrgY = y; dc->brushOrgY = y;
DC_ReleaseDCPtr( dc ); release_dc_ptr( dc );
return TRUE; return TRUE;
} }
......
...@@ -376,7 +376,7 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, CONST RGBQUA ...@@ -376,7 +376,7 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, CONST RGBQUA
UINT result = 0; UINT result = 0;
BITMAPOBJ * bitmap; BITMAPOBJ * bitmap;
if (!(dc = DC_GetDCPtr( hdc ))) return 0; if (!(dc = get_dc_ptr( hdc ))) return 0;
if ((bitmap = GDI_GetObjPtr( dc->hBitmap, BITMAP_MAGIC ))) if ((bitmap = GDI_GetObjPtr( dc->hBitmap, BITMAP_MAGIC )))
{ {
...@@ -396,7 +396,7 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, CONST RGBQUA ...@@ -396,7 +396,7 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, CONST RGBQUA
if (dc->funcs->pSetDIBColorTable) if (dc->funcs->pSetDIBColorTable)
dc->funcs->pSetDIBColorTable(dc->physDev, startpos, entries, colors); dc->funcs->pSetDIBColorTable(dc->physDev, startpos, entries, colors);
DC_ReleaseDCPtr( dc ); release_dc_ptr( dc );
return result; return result;
} }
...@@ -409,7 +409,7 @@ UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries, RGBQUAD *col ...@@ -409,7 +409,7 @@ UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries, RGBQUAD *col
DC * dc; DC * dc;
UINT result = 0; UINT result = 0;
if (!(dc = DC_GetDCPtr( hdc ))) return 0; if (!(dc = get_dc_ptr( hdc ))) return 0;
if (dc->funcs->pGetDIBColorTable) if (dc->funcs->pGetDIBColorTable)
result = dc->funcs->pGetDIBColorTable(dc->physDev, startpos, entries, colors); result = dc->funcs->pGetDIBColorTable(dc->physDev, startpos, entries, colors);
...@@ -431,7 +431,7 @@ UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries, RGBQUAD *col ...@@ -431,7 +431,7 @@ UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries, RGBQUAD *col
GDI_ReleaseObj( dc->hBitmap ); GDI_ReleaseObj( dc->hBitmap );
} }
} }
DC_ReleaseDCPtr( dc ); release_dc_ptr( dc );
return result; return result;
} }
...@@ -1075,14 +1075,14 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header, ...@@ -1075,14 +1075,14 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header,
{ {
if (init == CBM_INIT) SetDIBits( hdc, handle, 0, height, bits, data, coloruse ); if (init == CBM_INIT) SetDIBits( hdc, handle, 0, height, bits, data, coloruse );
else if (hdc && ((dc = DC_GetDCPtr( hdc )) != NULL) ) else if (hdc && ((dc = get_dc_ptr( hdc )) != NULL) )
{ {
if (!BITMAP_SetOwnerDC( handle, dc )) if (!BITMAP_SetOwnerDC( handle, dc ))
{ {
DeleteObject( handle ); DeleteObject( handle );
handle = 0; handle = 0;
} }
DC_ReleaseDCPtr( dc ); release_dc_ptr( dc );
} }
} }
...@@ -1323,7 +1323,7 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage, ...@@ -1323,7 +1323,7 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage,
bDesktopDC = TRUE; bDesktopDC = TRUE;
} }
if (!(dc = DC_GetDCPtr( hdc ))) goto error; if (!(dc = get_dc_ptr( hdc ))) goto error;
/* create Device Dependent Bitmap and add DIB pointer */ /* create Device Dependent Bitmap and add DIB pointer */
ret = CreateBitmap( dib->dsBm.bmWidth, dib->dsBm.bmHeight, 1, ret = CreateBitmap( dib->dsBm.bmWidth, dib->dsBm.bmHeight, 1,
...@@ -1347,7 +1347,7 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage, ...@@ -1347,7 +1347,7 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage,
} }
} }
DC_ReleaseDCPtr( dc ); release_dc_ptr( dc );
if (bDesktopDC) DeleteDC( hdc ); if (bDesktopDC) DeleteDC( hdc );
if (ret && bits) *bits = dib->dsBm.bmBits; if (ret && bits) *bits = dib->dsBm.bmBits;
return ret; return ret;
......
...@@ -1006,10 +1006,10 @@ INT WINAPI EnumFontsW( HDC hDC, LPCWSTR lpName, FONTENUMPROCW efproc, ...@@ -1006,10 +1006,10 @@ INT WINAPI EnumFontsW( HDC hDC, LPCWSTR lpName, FONTENUMPROCW efproc,
INT WINAPI GetTextCharacterExtra( HDC hdc ) INT WINAPI GetTextCharacterExtra( HDC hdc )
{ {
INT ret; INT ret;
DC *dc = DC_GetDCPtr( hdc ); DC *dc = get_dc_ptr( hdc );
if (!dc) return 0x80000000; if (!dc) return 0x80000000;
ret = dc->charExtra; ret = dc->charExtra;
DC_ReleaseDCPtr( dc ); release_dc_ptr( dc );
return ret; return ret;
} }
...@@ -1020,7 +1020,7 @@ INT WINAPI GetTextCharacterExtra( HDC hdc ) ...@@ -1020,7 +1020,7 @@ INT WINAPI GetTextCharacterExtra( HDC hdc )
INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra ) INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra )
{ {
INT prev; INT prev;
DC * dc = DC_GetDCPtr( hdc ); DC * dc = get_dc_ptr( hdc );
if (!dc) return 0x80000000; if (!dc) return 0x80000000;
if (dc->funcs->pSetTextCharacterExtra) if (dc->funcs->pSetTextCharacterExtra)
prev = dc->funcs->pSetTextCharacterExtra( dc->physDev, extra ); prev = dc->funcs->pSetTextCharacterExtra( dc->physDev, extra );
...@@ -1029,7 +1029,7 @@ INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra ) ...@@ -1029,7 +1029,7 @@ INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra )
prev = dc->charExtra; prev = dc->charExtra;
dc->charExtra = extra; dc->charExtra = extra;
} }
DC_ReleaseDCPtr( dc ); release_dc_ptr( dc );
return prev; return prev;
} }
...@@ -1040,7 +1040,7 @@ INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra ) ...@@ -1040,7 +1040,7 @@ INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra )
BOOL WINAPI SetTextJustification( HDC hdc, INT extra, INT breaks ) BOOL WINAPI SetTextJustification( HDC hdc, INT extra, INT breaks )
{ {
BOOL ret = TRUE; BOOL ret = TRUE;
DC * dc = DC_GetDCPtr( hdc ); DC * dc = get_dc_ptr( hdc );
if (!dc) return FALSE; if (!dc) return FALSE;
if (dc->funcs->pSetTextJustification) if (dc->funcs->pSetTextJustification)
ret = dc->funcs->pSetTextJustification( dc->physDev, extra, breaks ); ret = dc->funcs->pSetTextJustification( dc->physDev, extra, breaks );
...@@ -1059,7 +1059,7 @@ BOOL WINAPI SetTextJustification( HDC hdc, INT extra, INT breaks ) ...@@ -1059,7 +1059,7 @@ BOOL WINAPI SetTextJustification( HDC hdc, INT extra, INT breaks )
dc->breakRem = 0; dc->breakRem = 0;
} }
} }
DC_ReleaseDCPtr( dc ); release_dc_ptr( dc );
return ret; return ret;
} }
...@@ -2425,7 +2425,7 @@ BOOL WINAPI PolyTextOutW( HDC hdc, const POLYTEXTW *pptxt, INT cStrings ) ...@@ -2425,7 +2425,7 @@ BOOL WINAPI PolyTextOutW( HDC hdc, const POLYTEXTW *pptxt, INT cStrings )
*/ */
DWORD WINAPI SetMapperFlags( HDC hDC, DWORD dwFlag ) DWORD WINAPI SetMapperFlags( HDC hDC, DWORD dwFlag )
{ {
DC *dc = DC_GetDCPtr( hDC ); DC *dc = get_dc_ptr( hDC );
DWORD ret = 0; DWORD ret = 0;
if(!dc) return 0; if(!dc) return 0;
if(dc->funcs->pSetMapperFlags) if(dc->funcs->pSetMapperFlags)
...@@ -2435,7 +2435,7 @@ DWORD WINAPI SetMapperFlags( HDC hDC, DWORD dwFlag ) ...@@ -2435,7 +2435,7 @@ DWORD WINAPI SetMapperFlags( HDC hDC, DWORD dwFlag )
} }
else else
FIXME("(%p, 0x%08x): stub - harmless\n", hDC, dwFlag); FIXME("(%p, 0x%08x): stub - harmless\n", hDC, dwFlag);
DC_ReleaseDCPtr( dc ); release_dc_ptr( dc );
return ret; return ret;
} }
......
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