From 966663a1d2af3d0f207b68caf41b8c9c122cb6b5 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 2 Jul 2021 12:38:47 +0200 Subject: [PATCH] gdi32: Introduce NtGdiSelectBrush. Signed-off-by: Jacek Caban Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/gdi32/brush.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/dlls/gdi32/brush.c b/dlls/gdi32/brush.c index 4f968a048ce..acb0e67199a 100644 --- a/dlls/gdi32/brush.c +++ b/dlls/gdi32/brush.c @@ -417,19 +417,15 @@ BOOL WINAPI FixBrushOrgEx( HDC hdc, INT x, INT y, LPPOINT oldorg ) /*********************************************************************** - * BRUSH_SelectObject + * NtGdiSelectBrush (win32u.@) */ -static HGDIOBJ BRUSH_SelectObject( HGDIOBJ handle, HDC hdc ) +HGDIOBJ WINAPI NtGdiSelectBrush( HDC hdc, HGDIOBJ handle ) { BRUSHOBJ *brush; HGDIOBJ ret = 0; - DC *dc = get_dc_ptr( hdc ); + DC *dc; - if (!dc) - { - SetLastError( ERROR_INVALID_HANDLE ); - return 0; - } + if (!(dc = get_dc_ptr( hdc ))) return 0; if ((brush = GDI_GetObjPtr( handle, OBJ_BRUSH ))) { @@ -457,6 +453,17 @@ static HGDIOBJ BRUSH_SelectObject( HGDIOBJ handle, HDC hdc ) } +/*********************************************************************** + * BRUSH_SelectObject + */ +static HGDIOBJ BRUSH_SelectObject( HGDIOBJ handle, HDC hdc ) +{ + HGDIOBJ ret = NtGdiSelectBrush( hdc, handle ); + if (!ret) SetLastError( ERROR_INVALID_HANDLE ); + return ret; +} + + /*********************************************************************** * BRUSH_DeleteObject */