https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e6306db0c34ebc8699732…
commit e6306db0c34ebc8699732d484738a3c9ee34fb57
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Tue Sep 28 00:45:46 2021 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Tue Sep 28 00:48:24 2021 +0200
[GDI32] Fix build errors~~
---
win32ss/gdi/gdi32/wine/emfdc.c | 18 +++++++++---------
win32ss/gdi/gdi32/wine/gdi_private.h | 33 +++++++++++++++++++++++----------
win32ss/gdi/gdi32/wine/metadc.c | 32 ++++++++++++++++----------------
3 files changed, 48 insertions(+), 35 deletions(-)
diff --git a/win32ss/gdi/gdi32/wine/emfdc.c b/win32ss/gdi/gdi32/wine/emfdc.c
index a067b4b7c64..7a1f68c2311 100644
--- a/win32ss/gdi/gdi32/wine/emfdc.c
+++ b/win32ss/gdi/gdi32/wine/emfdc.c
@@ -133,8 +133,8 @@ static UINT get_bitmap_info( HDC *hdc, HBITMAP *bitmap, BITMAPINFO
*info )
}
else
{
- //unsigned char dib_info_buffer[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
- unsigned char dib_info_buffer[sizeof(BITMAPINFO) + 255 * sizeof(RGBQUAD)];
+ unsigned char dib_info_buffer[FIELD_OFFSET(BITMAPINFO, bmiColors)
+ + 256*RTL_FIELD_SIZE(BITMAPINFO, bmiColors)];
BITMAPINFO *dib_info = (BITMAPINFO *)dib_info_buffer;
BITMAP bmp = dib.dsBm;
HPALETTE palette;
@@ -275,10 +275,10 @@ static DWORD emfdc_create_brush( struct emf *emf, HBRUSH brush )
case BS_PATTERN:
case BS_DIBPATTERN:
{
- EMRCREATEDIBPATTERNBRUSHPT *emr;
- //char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )];
- char buffer[sizeof(BITMAPINFO) + 255 * sizeof(RGBQUAD)];
+ unsigned char buffer[FIELD_OFFSET(BITMAPINFO, bmiColors)
+ + 256*RTL_FIELD_SIZE(BITMAPINFO, bmiColors)];
BITMAPINFO *info = (BITMAPINFO *)buffer;
+ EMRCREATEDIBPATTERNBRUSHPT *emr;
DWORD info_size;
UINT usage;
@@ -1478,8 +1478,8 @@ BOOL EMFDC_MaskBlt( WINEDC *dc_attr, INT x_dst, INT y_dst, INT
width_dst, INT he
HDC hdc_src, INT x_src, INT y_src, HBITMAP mask,
INT x_mask, INT y_mask, DWORD rop )
{
- //unsigned char mask_info_buffer[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
- unsigned char mask_info_buffer[sizeof(BITMAPINFO) + 255 * sizeof(RGBQUAD)];
+ unsigned char mask_info_buffer[FIELD_OFFSET(BITMAPINFO, bmiColors)
+ + 256*RTL_FIELD_SIZE(BITMAPINFO, bmiColors)];
BITMAPINFO *mask_bits_info = (BITMAPINFO *)mask_info_buffer;
struct emf *emf = dc_attr->emf;
BITMAPINFO mask_info = {{ sizeof( mask_info.bmiHeader ) }};
@@ -1584,8 +1584,8 @@ err:
BOOL EMFDC_PlgBlt( WINEDC *dc_attr, const POINT *points, HDC hdc_src, INT x_src, INT
y_src,
INT width, INT height, HBITMAP mask, INT x_mask, INT y_mask )
{
- //unsigned char mask_info_buffer[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
- unsigned char mask_info_buffer[sizeof(BITMAPINFO) + 255 * sizeof(RGBQUAD)];
+ unsigned char mask_info_buffer[FIELD_OFFSET(BITMAPINFO, bmiColors)
+ + 256*RTL_FIELD_SIZE(BITMAPINFO, bmiColors)];
BITMAPINFO *mask_bits_info = (BITMAPINFO *)mask_info_buffer;
struct emf *emf = dc_attr->emf;
BITMAPINFO mask_info = {{ sizeof( mask_info.bmiHeader ) }};
diff --git a/win32ss/gdi/gdi32/wine/gdi_private.h b/win32ss/gdi/gdi32/wine/gdi_private.h
index de49fae2a47..2c8e2fc2ac4 100644
--- a/win32ss/gdi/gdi32/wine/gdi_private.h
+++ b/win32ss/gdi/gdi32/wine/gdi_private.h
@@ -27,15 +27,28 @@
#include "winbase.h"
#include "wingdi.h"
-#define GDILoObjType_LO_DC_TYPE 0x10000
-#define GDILoObjType_LO_FONT_TYPE 0xa0000
-#define GDILoObjType_LO_BRUSH_TYPE 0x100000
-#define GDILoObjType_LO_ALTDC_TYPE 0x210000
-#define GDILoObjType_LO_PEN_TYPE 0x300000
-#define GDILoObjType_LO_EXTPEN_TYPE 0x500000
-#define GDILoObjType_LO_METAFILE16_TYPE 0x260000
-#define GDILoObjType_LO_METAFILE_TYPE 0x460000
-#define GDILoObjType_LO_METADC16_TYPE 0x660000
+#ifndef _NTGDITYP_
+typedef enum GDILoObjType
+{
+ GDILoObjType_LO_BRUSH_TYPE = 0x100000,
+ GDILoObjType_LO_DC_TYPE = 0x10000,
+ GDILoObjType_LO_BITMAP_TYPE = 0x50000,
+ GDILoObjType_LO_PALETTE_TYPE = 0x80000,
+ GDILoObjType_LO_FONT_TYPE = 0xa0000,
+ GDILoObjType_LO_REGION_TYPE = 0x40000,
+ GDILoObjType_LO_ICMLCS_TYPE = 0x90000,
+ GDILoObjType_LO_CLIENTOBJ_TYPE = 0x60000,
+ GDILoObjType_LO_UMPD_TYPE = 0x110000,
+ GDILoObjType_LO_META_TYPE = 0x150000,
+ GDILoObjType_LO_ALTDC_TYPE = 0x210000,
+ GDILoObjType_LO_PEN_TYPE = 0x300000,
+ GDILoObjType_LO_EXTPEN_TYPE = 0x500000,
+ GDILoObjType_LO_DIBSECTION_TYPE = 0x250000,
+ GDILoObjType_LO_METAFILE16_TYPE = 0x260000,
+ GDILoObjType_LO_METAFILE_TYPE = 0x460000,
+ GDILoObjType_LO_METADC16_TYPE = 0x660000
+} GDILOOBJTYPE, *PGDILOOBJTYPE;
+#endif
#define GDI_HANDLE_TYPE_MASK 0x007f0000
#define GDI_HANDLE_GET_TYPE(h) \
@@ -50,7 +63,7 @@ BOOL APIENTRY NtGdiGetTransform(_In_ HDC hdc,_In_ DWORD iXform, _Out_
LPXFORM px
BOOL WINAPI GetBoundsRectAlt(HDC hdc,LPRECT prc,UINT flags);
BOOL WINAPI SetBoundsRectAlt(HDC hdc,LPRECT prc,UINT flags);
-HGDIOBJ WINAPI GdiCreateClientObj(_In_ PVOID pvObject,_In_ UINT eObjType);
+HGDIOBJ WINAPI GdiCreateClientObj(_In_ PVOID pvObject, _In_ GDILOOBJTYPE eObjType);
PVOID WINAPI GdiGetClientObjLink(_In_ HGDIOBJ hobj);
PVOID WINAPI GdiDeleteClientObj(_In_ HGDIOBJ hobj);
diff --git a/win32ss/gdi/gdi32/wine/metadc.c b/win32ss/gdi/gdi32/wine/metadc.c
index 48c66f02ab3..38ba8e6f641 100644
--- a/win32ss/gdi/gdi32/wine/metadc.c
+++ b/win32ss/gdi/gdi32/wine/metadc.c
@@ -114,8 +114,8 @@ static BOOL metadc_param1( HDC hdc, short func, short param )
static BOOL metadc_param2( HDC hdc, short func, short param1, short param2 )
{
- //char buffer[FIELD_OFFSET(METARECORD, rdParm[2])];
- char buffer[10];
+ unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm)
+ + 2*RTL_FIELD_SIZE(METARECORD, rdParm)];
METARECORD *mr = (METARECORD *)&buffer;
mr->rdSize = sizeof(buffer) / sizeof(WORD);
@@ -128,8 +128,8 @@ static BOOL metadc_param2( HDC hdc, short func, short param1, short
param2 )
static BOOL metadc_param4( HDC hdc, short func, short param1, short param2,
short param3, short param4 )
{
- //char buffer[FIELD_OFFSET(METARECORD, rdParm[4])];
- char buffer[14];
+ unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm)
+ + 4*RTL_FIELD_SIZE(METARECORD, rdParm)];
METARECORD *mr = (METARECORD *)&buffer;
mr->rdSize = sizeof(buffer) / sizeof(WORD);
@@ -144,8 +144,8 @@ static BOOL metadc_param4( HDC hdc, short func, short param1, short
param2,
static BOOL metadc_param5( HDC hdc, short func, short param1, short param2,
short param3, short param4, short param5 )
{
- //char buffer[FIELD_OFFSET(METARECORD, rdParm[5])];
- char buffer[16];
+ unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm)
+ + 5*RTL_FIELD_SIZE(METARECORD, rdParm)];
METARECORD *mr = (METARECORD *)&buffer;
mr->rdSize = sizeof(buffer) / sizeof(WORD);
@@ -162,8 +162,8 @@ static BOOL metadc_param6( HDC hdc, short func, short param1, short
param2,
short param3, short param4, short param5,
short param6 )
{
- //char buffer[FIELD_OFFSET(METARECORD, rdParm[6])];
- char buffer[18];
+ unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm)
+ + 6*RTL_FIELD_SIZE(METARECORD, rdParm)];
METARECORD *mr = (METARECORD *)&buffer;
mr->rdSize = sizeof(buffer) / sizeof(WORD);
@@ -181,8 +181,8 @@ static BOOL metadc_param8( HDC hdc, short func, short param1, short
param2,
short param3, short param4, short param5,
short param6, short param7, short param8)
{
- //char buffer[FIELD_OFFSET(METARECORD, rdParm[8])];
- char buffer[22];
+ unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm)
+ + 8*RTL_FIELD_SIZE(METARECORD, rdParm)];
METARECORD *mr = (METARECORD *)&buffer;
mr->rdSize = sizeof(buffer) / sizeof(WORD);
@@ -559,8 +559,8 @@ static INT16 metadc_create_brush( struct metadc *metadc, HBRUSH brush
)
case BS_PATTERN:
case BS_DIBPATTERN:
{
- //char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )];
- char buffer[sizeof(BITMAPINFO) + 255 * sizeof(RGBQUAD)];
+ unsigned char buffer[FIELD_OFFSET(BITMAPINFO, bmiColors)
+ + 256*RTL_FIELD_SIZE(BITMAPINFO, bmiColors)];
BITMAPINFO *dst_info, *src_info = (BITMAPINFO *)buffer;
DWORD info_size;
UINT usage;
@@ -1067,12 +1067,12 @@ static HBRUSH METADC_SelectBrush( HDC hdc, HBRUSH hbrush )
static UINT16 metadc_create_font( struct metadc *metadc, HFONT font, LOGFONTW *logfont )
{
- char buffer[sizeof(METARECORD) - 2 + sizeof(LOGFONT16)];
+ unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm) + sizeof(LOGFONT16)];
METARECORD *mr = (METARECORD *)&buffer;
LOGFONT16 *font16;
INT written;
- mr->rdSize = (sizeof(METARECORD) + sizeof(LOGFONT16) - 2) / 2;
+ mr->rdSize = sizeof(buffer) / sizeof(WORD);
mr->rdFunction = META_CREATEFONTINDIRECT;
font16 = (LOGFONT16 *)&mr->rdParm;
@@ -1124,8 +1124,8 @@ static HFONT METADC_SelectFont( HDC hdc, HFONT hfont )
static UINT16 metadc_create_pen( struct metadc *metadc, HPEN pen, LOGPEN16 *logpen )
{
- //char buffer[FIELD_OFFSET(METARECORD, rdParm[sizeof(*logpen) / sizeof(WORD)])];
- char buffer[sizeof(METARECORD) - 2 + sizeof(*logpen)];
+ unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm)
+ + (sizeof(*logpen) / sizeof(WORD)) * RTL_FIELD_SIZE(METARECORD, rdParm)];
METARECORD *mr = (METARECORD *)&buffer;
mr->rdSize = sizeof(buffer) / sizeof(WORD);