Jacek Caban : gdi32: Introduce NtGdiCreateBitmap.

Alexandre Julliard julliard at winehq.org
Mon Jul 5 16:24:19 CDT 2021


Module: wine
Branch: master
Commit: 270f7bed600236c33286d0431f120b23c0c7ea4d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=270f7bed600236c33286d0431f120b23c0c7ea4d

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Jul  5 13:40:58 2021 +0200

gdi32: Introduce NtGdiCreateBitmap.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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 );
+}




More information about the wine-cvs mailing list