Module: wine Branch: master Commit: 270f7bed600236c33286d0431f120b23c0c7ea4d URL: https://source.winehq.org/git/wine.git/?a=commit;h=270f7bed600236c33286d0431...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Jul 5 13:40:58 2021 +0200
gdi32: Introduce NtGdiCreateBitmap.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/gdi32/bitmap.c | 8 ++++---- dlls/gdi32/objects.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index cebe2dea644..c5a7ef9ca76 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -91,12 +91,12 @@ HBITMAP WINAPI CreateCompatibleBitmap( HDC hdc, INT width, INT height)
/****************************************************************************** - * CreateBitmap [GDI32.@] + * NtGdiCreateBitmap (win32u.@) * * Creates a bitmap with the specified info. */ -HBITMAP WINAPI CreateBitmap( INT width, INT height, UINT planes, - UINT bpp, const void *bits ) +HBITMAP WINAPI NtGdiCreateBitmap( INT width, INT height, UINT planes, + UINT bpp, const void *bits ) { BITMAPOBJ *bmpobj; HBITMAP hbitmap; @@ -110,7 +110,7 @@ HBITMAP WINAPI CreateBitmap( INT width, INT height, UINT planes, }
if (!width || !height) - return GetStockObject( DEFAULT_BITMAP ); + return 0;
if (height < 0) height = -height; diff --git a/dlls/gdi32/objects.c b/dlls/gdi32/objects.c index 1567a02b128..a7d565e32ed 100644 --- a/dlls/gdi32/objects.c +++ b/dlls/gdi32/objects.c @@ -201,3 +201,17 @@ HBITMAP WINAPI CreateBitmapIndirect( const BITMAP *bmp ) return CreateBitmap( bmp->bmWidth, bmp->bmHeight, bmp->bmPlanes, bmp->bmBitsPixel, bmp->bmBits ); } + +/****************************************************************************** + * CreateBitmap (GDI32.@) + * + * Creates a bitmap with the specified info. + */ +HBITMAP WINAPI CreateBitmap( INT width, INT height, UINT planes, + UINT bpp, const void *bits ) +{ + if (!width || !height) + return GetStockObject( STOCK_LAST + 1 ); /* default 1x1 bitmap */ + + return NtGdiCreateBitmap( width, height, planes, bpp, bits ); +}