From: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/win32u/bitblt.c | 2 +-
dlls/win32u/bitmap.c | 2 +-
dlls/win32u/dc.c | 20 ++++++++++----------
dlls/win32u/dibdrv/objects.c | 8 ++++----
dlls/win32u/font.c | 2 +-
dlls/win32u/gdiobj.c | 5 ++++-
dlls/win32u/ntgdi_private.h | 1 -
dlls/win32u/painting.c | 2 +-
dlls/win32u/palette.c | 10 +++++-----
dlls/win32u/pen.c | 2 +-
dlls/win32u/sysparams.c | 4 ++--
11 files changed, 30 insertions(+), 28 deletions(-)
diff --git a/dlls/win32u/bitblt.c b/dlls/win32u/bitblt.c
index 213aeeea58b..302a3ef77eb 100644
--- a/dlls/win32u/bitblt.c
+++ b/dlls/win32u/bitblt.c
@@ -789,7 +789,7 @@ BOOL WINAPI NtGdiMaskBlt( HDC hdcDest, INT nXDest, INT nYDest, INT nWidth, INT n
nXSrc, nYSrc, FRGND_ROP3(dwRop), bk_color, 0 );
hbrMask = NtGdiCreatePatternBrushInternal( hbmMask, FALSE, FALSE );
- hbrDst = NtGdiSelectBrush( hdcDest, get_stock_object(NULL_BRUSH) );
+ hbrDst = NtGdiSelectBrush( hdcDest, GetStockObject(NULL_BRUSH) );
/* make bitmap */
hDC1 = NtGdiCreateCompatibleDC( hdcDest );
diff --git a/dlls/win32u/bitmap.c b/dlls/win32u/bitmap.c
index 2be88715948..5d93ee69ee0 100644
--- a/dlls/win32u/bitmap.c
+++ b/dlls/win32u/bitmap.c
@@ -391,7 +391,7 @@ HGDIOBJ WINAPI NtGdiSelectBitmap( HDC hdc, HGDIOBJ handle )
goto done;
}
- if (handle != get_stock_object( DEFAULT_BITMAP ) && GDI_get_ref_count( handle ))
+ if (handle != GetStockObject( DEFAULT_BITMAP ) && GDI_get_ref_count( handle ))
{
WARN( "Bitmap already selected in another DC\n" );
GDI_ReleaseObj( handle );
diff --git a/dlls/win32u/dc.c b/dlls/win32u/dc.c
index 5707e50ed85..b684e198c05 100644
--- a/dlls/win32u/dc.c
+++ b/dlls/win32u/dc.c
@@ -217,10 +217,10 @@ DC *alloc_dc_ptr( DWORD magic )
dc->physDev = &dc->nulldrv;
dc->thread = GetCurrentThreadId();
dc->refcount = 1;
- dc->hPen = GDI_inc_ref_count( get_stock_object( BLACK_PEN ));
- dc->hBrush = GDI_inc_ref_count( get_stock_object( WHITE_BRUSH ));
- dc->hFont = GDI_inc_ref_count( get_stock_object( SYSTEM_FONT ));
- dc->hPalette = get_stock_object( DEFAULT_PALETTE );
+ dc->hPen = GDI_inc_ref_count( GetStockObject( BLACK_PEN ));
+ dc->hBrush = GDI_inc_ref_count( GetStockObject( WHITE_BRUSH ));
+ dc->hFont = GDI_inc_ref_count( GetStockObject( SYSTEM_FONT ));
+ dc->hPalette = GetStockObject( DEFAULT_PALETTE );
set_initial_dc_state( dc );
@@ -465,11 +465,11 @@ static BOOL reset_dc_state( HDC hdc )
set_initial_dc_state( dc );
set_bk_color( dc, RGB( 255, 255, 255 ));
set_text_color( dc, RGB( 0, 0, 0 ));
- NtGdiSelectBrush( hdc, get_stock_object( WHITE_BRUSH ));
- NtGdiSelectFont( hdc, get_stock_object( SYSTEM_FONT ));
- NtGdiSelectPen( hdc, get_stock_object( BLACK_PEN ));
+ NtGdiSelectBrush( hdc, GetStockObject( WHITE_BRUSH ));
+ NtGdiSelectFont( hdc, GetStockObject( SYSTEM_FONT ));
+ NtGdiSelectPen( hdc, GetStockObject( BLACK_PEN ));
NtGdiSetVirtualResolution( hdc, 0, 0, 0, 0 );
- NtUserSelectPalette( hdc, get_stock_object( DEFAULT_PALETTE ), FALSE );
+ NtUserSelectPalette( hdc, GetStockObject( DEFAULT_PALETTE ), FALSE );
NtGdiSetBoundsRect( hdc, NULL, DCB_DISABLE );
NtGdiAbortPath( hdc );
@@ -724,7 +724,7 @@ HDC WINAPI NtGdiOpenDCW( UNICODE_STRING *device, const DEVMODEW *devmode, UNICOD
if (!(dc = alloc_dc_ptr( NTGDI_OBJ_DC ))) return 0;
hdc = dc->hSelf;
- dc->hBitmap = GDI_inc_ref_count( get_stock_object( DEFAULT_BITMAP ));
+ dc->hBitmap = GDI_inc_ref_count( GetStockObject( DEFAULT_BITMAP ));
TRACE("(device=%s, output=%s): returning %p\n",
debugstr_us(device), debugstr_us(output), dc->hSelf );
@@ -791,7 +791,7 @@ HDC WINAPI NtGdiCreateCompatibleDC( HDC hdc )
TRACE("(%p): returning %p\n", hdc, dc->hSelf );
- dc->hBitmap = GDI_inc_ref_count( get_stock_object( DEFAULT_BITMAP ));
+ dc->hBitmap = GDI_inc_ref_count( GetStockObject( DEFAULT_BITMAP ));
dc->attr->vis_rect.left = 0;
dc->attr->vis_rect.top = 0;
dc->attr->vis_rect.right = 1;
diff --git a/dlls/win32u/dibdrv/objects.c b/dlls/win32u/dibdrv/objects.c
index 013444ff3cf..d9979a05fa6 100644
--- a/dlls/win32u/dibdrv/objects.c
+++ b/dlls/win32u/dibdrv/objects.c
@@ -1779,7 +1779,7 @@ COLORREF CDECL dibdrv_SetDCPenColor( PHYSDEV dev, COLORREF color )
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
DC *dc = get_physdev_dc( dev );
- if (dc->hPen == get_stock_object( DC_PEN ))
+ if (dc->hPen == GetStockObject( DC_PEN ))
pdev->pen_brush.colorref = color;
return color;
@@ -2145,7 +2145,7 @@ HBRUSH CDECL dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct brush_
NtGdiExtGetObjectW( hbrush, sizeof(logbrush), &logbrush );
- if (hbrush == get_stock_object( DC_BRUSH ))
+ if (hbrush == GetStockObject( DC_BRUSH ))
logbrush.lbColor = dc->attr->brush_color;
select_brush( pdev, &pdev->brush, &logbrush, pattern, TRUE );
@@ -2197,7 +2197,7 @@ HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern
pdev->pen_endcap = logpen.lopnStyle & PS_ENDCAP_MASK;
pdev->pen_width = get_pen_device_width( dc, logpen.lopnWidth.x );
- if (hpen == get_stock_object( DC_PEN ))
+ if (hpen == GetStockObject( DC_PEN ))
logbrush.lbColor = dc->attr->pen_color;
set_dash_pattern( &pdev->pen_pattern, 0, NULL );
@@ -2265,7 +2265,7 @@ COLORREF CDECL dibdrv_SetDCBrushColor( PHYSDEV dev, COLORREF color )
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
DC *dc = get_physdev_dc( dev );
- if (dc->hBrush == get_stock_object( DC_BRUSH ))
+ if (dc->hBrush == GetStockObject( DC_BRUSH ))
{
LOGBRUSH logbrush = { BS_SOLID, color, 0 };
select_brush( pdev, &pdev->brush, &logbrush, NULL, TRUE );
diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c
index 04b04446168..7017ec6614d 100644
--- a/dlls/win32u/font.c
+++ b/dlls/win32u/font.c
@@ -5634,7 +5634,7 @@ done:
UINT size = NtGdiGetOutlineTextMetricsInternalW( hdc, 0, NULL, 0 );
OUTLINETEXTMETRICW* otm = NULL;
POINT pts[5];
- HPEN hpen = NtGdiSelectPen( hdc, get_stock_object(NULL_PEN) );
+ HPEN hpen = NtGdiSelectPen( hdc, GetStockObject(NULL_PEN) );
HBRUSH hbrush = NtGdiCreateSolidBrush( dc->attr->text_color, NULL );
hbrush = NtGdiSelectBrush(hdc, hbrush);
diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c
index f120f543b9a..044ae8232e3 100644
--- a/dlls/win32u/gdiobj.c
+++ b/dlls/win32u/gdiobj.c
@@ -586,7 +586,10 @@ static void init_gdi_shared(void)
NtCurrentTeb()->Peb->GdiSharedHandleTable = gdi_shared;
}
-HGDIOBJ get_stock_object( INT obj )
+/***********************************************************************
+ * GetStockObject (win32u.so)
+ */
+HGDIOBJ WINAPI GetStockObject( INT obj )
{
assert( obj >= 0 && obj <= STOCK_LAST + 1 && obj != 9 );
diff --git a/dlls/win32u/ntgdi_private.h b/dlls/win32u/ntgdi_private.h
index 6e7e24b154a..b04f7a87e34 100644
--- a/dlls/win32u/ntgdi_private.h
+++ b/dlls/win32u/ntgdi_private.h
@@ -381,7 +381,6 @@ extern void GDI_ReleaseObj( HGDIOBJ ) DECLSPEC_HIDDEN;
extern UINT GDI_get_ref_count( HGDIOBJ handle ) DECLSPEC_HIDDEN;
extern HGDIOBJ GDI_inc_ref_count( HGDIOBJ handle ) DECLSPEC_HIDDEN;
extern BOOL GDI_dec_ref_count( HGDIOBJ handle ) DECLSPEC_HIDDEN;
-extern HGDIOBJ get_stock_object( INT obj ) DECLSPEC_HIDDEN;
extern DWORD get_gdi_object_type( HGDIOBJ obj ) DECLSPEC_HIDDEN;
extern void make_gdi_object_system( HGDIOBJ handle, BOOL set ) DECLSPEC_HIDDEN;
diff --git a/dlls/win32u/painting.c b/dlls/win32u/painting.c
index 742a75acc9c..9b973eeb757 100644
--- a/dlls/win32u/painting.c
+++ b/dlls/win32u/painting.c
@@ -112,7 +112,7 @@ BOOL CDECL nulldrv_InvertRgn( PHYSDEV dev, HRGN rgn )
INT prev_rop = dc->attr->rop_mode;
BOOL ret;
dc->attr->rop_mode = R2_NOT;
- ret = NtGdiFillRgn( dev->hdc, rgn, get_stock_object(BLACK_BRUSH) );
+ ret = NtGdiFillRgn( dev->hdc, rgn, GetStockObject(BLACK_BRUSH) );
dc->attr->rop_mode = prev_rop;
return ret;
}
diff --git a/dlls/win32u/palette.c b/dlls/win32u/palette.c
index 95361eac5cc..217a96bb027 100644
--- a/dlls/win32u/palette.c
+++ b/dlls/win32u/palette.c
@@ -196,7 +196,7 @@ static UINT set_palette_entries( HPALETTE hpalette, UINT start, UINT count,
TRACE("hpal=%p,start=%i,count=%i\n",hpalette,start,count );
- if (hpalette == get_stock_object(DEFAULT_PALETTE)) return 0;
+ if (hpalette == GetStockObject(DEFAULT_PALETTE)) return 0;
palPtr = GDI_GetObjPtr( hpalette, NTGDI_OBJ_PAL );
if (!palPtr) return 0;
@@ -249,7 +249,7 @@ static BOOL animate_palette( HPALETTE hPal, UINT StartIndex, UINT NumEntries,
{
TRACE("%p (%i - %i)\n", hPal, StartIndex,StartIndex+NumEntries);
- if( hPal != get_stock_object(DEFAULT_PALETTE) )
+ if( hPal != GetStockObject(DEFAULT_PALETTE) )
{
PALETTEOBJ * palPtr;
UINT pal_entries;
@@ -405,7 +405,7 @@ COLORREF CDECL nulldrv_GetNearestColor( PHYSDEV dev, COLORREF color )
PALETTEENTRY entry;
HPALETTE hpal = dc->hPalette;
- if (!hpal) hpal = get_stock_object( DEFAULT_PALETTE );
+ if (!hpal) hpal = GetStockObject( DEFAULT_PALETTE );
if (spec_type == 2) /* PALETTERGB */
index = NtGdiGetNearestPaletteIndex( hpal, color );
else /* PALETTEINDEX */
@@ -514,7 +514,7 @@ HPALETTE WINAPI NtUserSelectPalette( HDC hdc, HPALETTE hpal, WORD bkg )
TRACE("%p %p\n", hdc, hpal );
- if (!bkg && hpal != get_stock_object( DEFAULT_PALETTE ))
+ if (!bkg && hpal != GetStockObject( DEFAULT_PALETTE ))
{
HWND hwnd = NtUserWindowFromDC( hdc );
if (hwnd)
@@ -555,7 +555,7 @@ UINT realize_palette( HDC hdc )
/* FIXME: move primary palette handling from user32 */
- if( dc->hPalette == get_stock_object( DEFAULT_PALETTE ))
+ if( dc->hPalette == GetStockObject( DEFAULT_PALETTE ))
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pRealizeDefaultPalette );
realized = physdev->funcs->pRealizeDefaultPalette( physdev );
diff --git a/dlls/win32u/pen.c b/dlls/win32u/pen.c
index a6a14163827..af371108c46 100644
--- a/dlls/win32u/pen.c
+++ b/dlls/win32u/pen.c
@@ -96,7 +96,7 @@ HPEN create_pen( INT style, INT width, COLORREF color )
HPEN WINAPI NtGdiCreatePen( INT style, INT width, COLORREF color, HBRUSH brush )
{
if (brush) FIXME( "brush not supported\n" );
- if (style == PS_NULL) return get_stock_object( NULL_PEN );
+ if (style == PS_NULL) return GetStockObject( NULL_PEN );
return create_pen( style, width, color );
}
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c
index 6ec92552df1..696fc9d922d 100644
--- a/dlls/win32u/sysparams.c
+++ b/dlls/win32u/sysparams.c
@@ -2782,7 +2782,7 @@ static BOOL get_font_entry( union sysparam_all_entry *entry, UINT int_param, voi
debugstr_a( entry->hdr.regval ));
/* fall through */
case 0: /* use the default GUI font */
- NtGdiExtGetObjectW( get_stock_object( DEFAULT_GUI_FONT ), sizeof(font), &font );
+ NtGdiExtGetObjectW( GetStockObject( DEFAULT_GUI_FONT ), sizeof(font), &font );
font.lfHeight = map_from_system_dpi( font.lfHeight );
font.lfWeight = entry->font.weight;
entry->font.val = font;
@@ -2821,7 +2821,7 @@ static BOOL set_font_entry( union sysparam_all_entry *entry, UINT int_param, voi
/* initialize a font (binary) parameter */
static BOOL init_font_entry( union sysparam_all_entry *entry )
{
- NtGdiExtGetObjectW( get_stock_object( DEFAULT_GUI_FONT ), sizeof(entry->font.val), &entry->font.val );
+ NtGdiExtGetObjectW( GetStockObject( DEFAULT_GUI_FONT ), sizeof(entry->font.val), &entry->font.val );
entry->font.val.lfHeight = map_from_system_dpi( entry->font.val.lfHeight );
entry->font.val.lfWeight = entry->font.weight;
get_real_fontname( &entry->font.val, entry->font.fullname );
--
2.25.1