Jacek Caban : gdi32: Use NtGdiCreateDIBSection for CreateDIBSection.

Alexandre Julliard julliard at winehq.org
Tue Aug 31 15:40:23 CDT 2021


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Aug 31 13:18:37 2021 +0100

gdi32: Use NtGdiCreateDIBSection for CreateDIBSection.

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/bitblt.c  | 2 +-
 dlls/gdi32/bitmap.c  | 2 +-
 dlls/gdi32/dib.c     | 7 ++++---
 dlls/gdi32/objects.c | 9 +++++++++
 include/ntgdi.h      | 3 +++
 5 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c
index 7f66d2f66fe..497e8a59f24 100644
--- a/dlls/gdi32/bitblt.c
+++ b/dlls/gdi32/bitblt.c
@@ -877,7 +877,7 @@ BOOL WINAPI GdiTransparentBlt( HDC hdcDest, int xDest, int yDest, int widthDest,
         info.bmiHeader.biPlanes = 1;
         info.bmiHeader.biBitCount = 24;
         info.bmiHeader.biCompression = BI_RGB;
-        bmpWork = CreateDIBSection( 0, &info, DIB_RGB_COLORS, NULL, NULL, 0 );
+        bmpWork = NtGdiCreateDIBSection( 0, NULL, 0, &info, DIB_RGB_COLORS, 0, 0, 0, NULL );
     }
     else bmpWork = NtGdiCreateCompatibleBitmap( hdcDest, widthDest, heightDest );
     oldWork = NtGdiSelectBitmap(hdcWork, bmpWork);
diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c
index 472efdec295..db6a4c44c84 100644
--- a/dlls/gdi32/bitmap.c
+++ b/dlls/gdi32/bitmap.c
@@ -76,7 +76,7 @@ HBITMAP WINAPI NtGdiCreateCompatibleBitmap( HDC hdc, INT width, INT height )
             memcpy( bi->bmiColors, dib.dsBitfields, sizeof(dib.dsBitfields) );
         else if (dib.dsBmih.biBitCount <= 8)  /* copy the color table */
             NtGdiDoPalette( hdc, 0, 256, bi->bmiColors, NtGdiGetDIBColorTable, FALSE );
-        return CreateDIBSection( hdc, bi, DIB_RGB_COLORS, NULL, NULL, 0 );
+        return NtGdiCreateDIBSection( hdc, NULL, 0, bi, DIB_RGB_COLORS, 0, 0, 0, NULL );
 
     default:
         return 0;
diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c
index fa736223aae..68ca1c31664 100644
--- a/dlls/gdi32/dib.c
+++ b/dlls/gdi32/dib.c
@@ -1460,10 +1460,11 @@ HBITMAP WINAPI NtGdiCreateDIBitmapInternal( HDC hdc, INT width, INT height, DWOR
 
 
 /***********************************************************************
- *           CreateDIBSection    (GDI32.@)
+ *           NtGdiCreateDIBSection    (win32u.@)
  */
-HBITMAP WINAPI DECLSPEC_HOTPATCH CreateDIBSection(HDC hdc, const BITMAPINFO *bmi, UINT usage,
-                                                  void **bits, HANDLE section, DWORD offset)
+HBITMAP WINAPI NtGdiCreateDIBSection( HDC hdc, HANDLE section, DWORD offset, const BITMAPINFO *bmi,
+                                      UINT usage, UINT header_size, ULONG flags,
+                                      ULONG_PTR color_space, void **bits )
 {
     char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )];
     BITMAPINFO *info = (BITMAPINFO *)buffer;
diff --git a/dlls/gdi32/objects.c b/dlls/gdi32/objects.c
index 055994a1680..d1d9cdb1e35 100644
--- a/dlls/gdi32/objects.c
+++ b/dlls/gdi32/objects.c
@@ -753,6 +753,15 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header, DWORD in
                                         0, 0, 0, 0 );
 }
 
+/***********************************************************************
+ *           CreateDIBSection    (GDI32.@)
+ */
+HBITMAP WINAPI DECLSPEC_HOTPATCH CreateDIBSection( HDC hdc, const BITMAPINFO *bmi, UINT usage,
+                                                   void **bits, HANDLE section, DWORD offset )
+{
+    return NtGdiCreateDIBSection( hdc, section, offset, bmi, usage, 0, 0, 0, bits );
+}
+
 /***********************************************************************
  *           GetDIBits    (win32u.@)
  */
diff --git a/include/ntgdi.h b/include/ntgdi.h
index 72427a20295..f03b12a09ae 100644
--- a/include/ntgdi.h
+++ b/include/ntgdi.h
@@ -222,6 +222,9 @@ HBITMAP  WINAPI NtGdiCreateDIBitmapInternal( HDC hdc, INT width, INT height, DWO
                                              const void *bits, const BITMAPINFO *data,
                                              UINT coloruse, UINT max_info, UINT max_bits,
                                              ULONG flags, HANDLE xform );
+HBITMAP  WINAPI NtGdiCreateDIBSection( HDC hdc, HANDLE section, DWORD offset, const BITMAPINFO *bmi,
+                                       UINT usage, UINT header_size, ULONG flags,
+                                       ULONG_PTR color_space, void **bits );
 HPALETTE WINAPI NtGdiCreateHalftonePalette( HDC hdc );
 HBRUSH   WINAPI NtGdiCreateHatchBrushInternal( INT style, COLORREF color, BOOL pen );
 HDC      WINAPI NtGdiCreateMetafileDC( HDC hdc );




More information about the wine-cvs mailing list