[PATCH v2 6/8] gdi32: Use NtGdiGetDIBitsInternal for GetDIBits.
Huw Davies
huw at codeweavers.com
Tue Aug 31 07:18:35 CDT 2021
From: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
---
dlls/gdi32/dib.c | 17 ++++-------------
dlls/gdi32/objects.c | 9 +++++++++
include/ntgdi.h | 3 +++
3 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c
index 5a8d29ae5bf..976e6060955 100644
--- a/dlls/gdi32/dib.c
+++ b/dlls/gdi32/dib.c
@@ -1190,22 +1190,13 @@ BITMAPINFO *copy_packed_dib( const BITMAPINFO *src_info, UINT usage )
}
/******************************************************************************
- * GetDIBits [GDI32.@]
+ * NtGdiGetDIBitsInternal (win32u.@)
*
* Retrieves bits of bitmap and copies to buffer.
- *
- * RETURNS
- * Success: Number of scan lines copied from bitmap
- * Failure: 0
*/
-INT WINAPI DECLSPEC_HOTPATCH GetDIBits(
- HDC hdc, /* [in] Handle to device context */
- HBITMAP hbitmap, /* [in] Handle to bitmap */
- UINT startscan, /* [in] First scan line to set in dest bitmap */
- UINT lines, /* [in] Number of scan lines to copy */
- LPVOID bits, /* [out] Address of array for bitmap bits */
- BITMAPINFO * info, /* [out] Address of structure with bitmap data */
- UINT coloruse) /* [in] RGB or palette index */
+INT WINAPI NtGdiGetDIBitsInternal( HDC hdc, HBITMAP hbitmap, UINT startscan, UINT lines,
+ void *bits, BITMAPINFO *info, UINT coloruse,
+ UINT max_bits, UINT max_info )
{
DC * dc;
BITMAPOBJ * bmp;
diff --git a/dlls/gdi32/objects.c b/dlls/gdi32/objects.c
index 58ac32ed576..03985737b51 100644
--- a/dlls/gdi32/objects.c
+++ b/dlls/gdi32/objects.c
@@ -724,6 +724,15 @@ UINT WINAPI GetSystemPaletteEntries( HDC hdc, UINT start, UINT count, PALETTEENT
return 0;
}
+/***********************************************************************
+ * GetDIBits (GDI32.@)
+ */
+INT WINAPI DECLSPEC_HOTPATCH GetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan, UINT lines,
+ void *bits, BITMAPINFO *info, UINT coloruse )
+{
+ return NtGdiGetDIBitsInternal( hdc, hbitmap, startscan, lines, bits, info, coloruse, 0, 0 );
+}
+
/***********************************************************************
* GetDIBColorTable (GDI32.@)
*/
diff --git a/include/ntgdi.h b/include/ntgdi.h
index 63f65e04794..fbe168a73bd 100644
--- a/include/ntgdi.h
+++ b/include/ntgdi.h
@@ -273,6 +273,9 @@ BOOL WINAPI NtGdiGetCharWidthW( HDC hdc, UINT first_char, UINT last_char, WC
BOOL WINAPI NtGdiGetColorAdjustment( HDC hdc, COLORADJUSTMENT *ca );
BOOL WINAPI NtGdiGetDCDword( HDC hdc, UINT method, DWORD *result );
BOOL WINAPI NtGdiGetDCPoint( HDC hdc, UINT method, POINT *result );
+INT WINAPI NtGdiGetDIBitsInternal( HDC hdc, HBITMAP hbitmap, UINT startscan, UINT lines,
+ void *bits, BITMAPINFO *info, UINT coloruse,
+ UINT max_bits, UINT max_info );
INT WINAPI NtGdiGetDeviceCaps( HDC hdc, INT cap );
BOOL WINAPI NtGdiGetDeviceGammaRamp( HDC hdc, void *ptr );
DWORD WINAPI NtGdiGetFontData( HDC hdc, DWORD table, DWORD offset, void *buffer, DWORD length );
--
2.23.0
More information about the wine-devel
mailing list