https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d4b2c97b6713cccfab009…
commit d4b2c97b6713cccfab009bb0b75d2ad5ca38910b
Author: James Tabor <james.tabor(a)reactos.org>
AuthorDate: Mon Sep 27 17:30:40 2021 -0500
Commit: James Tabor <james.tabor(a)reactos.org>
CommitDate: Mon Sep 27 17:30:40 2021 -0500
[GDI32] Fix msvc build errors.
---
win32ss/gdi/gdi32/wine/emfdc.c | 12 ++++++++----
win32ss/gdi/gdi32/wine/metadc.c | 21 ++++++++++++++-------
2 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/win32ss/gdi/gdi32/wine/emfdc.c b/win32ss/gdi/gdi32/wine/emfdc.c
index b300e0efea8..a067b4b7c64 100644
--- a/win32ss/gdi/gdi32/wine/emfdc.c
+++ b/win32ss/gdi/gdi32/wine/emfdc.c
@@ -133,7 +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[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
+ unsigned char dib_info_buffer[sizeof(BITMAPINFO) + 255 * sizeof(RGBQUAD)];
BITMAPINFO *dib_info = (BITMAPINFO *)dib_info_buffer;
BITMAP bmp = dib.dsBm;
HPALETTE palette;
@@ -275,7 +276,8 @@ static DWORD emfdc_create_brush( struct emf *emf, HBRUSH brush )
case BS_DIBPATTERN:
{
EMRCREATEDIBPATTERNBRUSHPT *emr;
- char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )];
+ //char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )];
+ char buffer[sizeof(BITMAPINFO) + 255 * sizeof(RGBQUAD)];
BITMAPINFO *info = (BITMAPINFO *)buffer;
DWORD info_size;
UINT usage;
@@ -1476,7 +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[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
+ unsigned char mask_info_buffer[sizeof(BITMAPINFO) + 255 * sizeof(RGBQUAD)];
BITMAPINFO *mask_bits_info = (BITMAPINFO *)mask_info_buffer;
struct emf *emf = dc_attr->emf;
BITMAPINFO mask_info = {{ sizeof( mask_info.bmiHeader ) }};
@@ -1581,7 +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[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
+ unsigned char mask_info_buffer[sizeof(BITMAPINFO) + 255 * sizeof(RGBQUAD)];
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/metadc.c b/win32ss/gdi/gdi32/wine/metadc.c
index c5bff94416e..48c66f02ab3 100644
--- a/win32ss/gdi/gdi32/wine/metadc.c
+++ b/win32ss/gdi/gdi32/wine/metadc.c
@@ -114,7 +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[FIELD_OFFSET(METARECORD, rdParm[2])];
+ char buffer[10];
METARECORD *mr = (METARECORD *)&buffer;
mr->rdSize = sizeof(buffer) / sizeof(WORD);
@@ -127,7 +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[FIELD_OFFSET(METARECORD, rdParm[4])];
+ char buffer[14];
METARECORD *mr = (METARECORD *)&buffer;
mr->rdSize = sizeof(buffer) / sizeof(WORD);
@@ -142,7 +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[FIELD_OFFSET(METARECORD, rdParm[5])];
+ char buffer[16];
METARECORD *mr = (METARECORD *)&buffer;
mr->rdSize = sizeof(buffer) / sizeof(WORD);
@@ -159,7 +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[FIELD_OFFSET(METARECORD, rdParm[6])];
+ char buffer[18];
METARECORD *mr = (METARECORD *)&buffer;
mr->rdSize = sizeof(buffer) / sizeof(WORD);
@@ -177,7 +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[FIELD_OFFSET(METARECORD, rdParm[8])];
+ char buffer[22];
METARECORD *mr = (METARECORD *)&buffer;
mr->rdSize = sizeof(buffer) / sizeof(WORD);
@@ -554,7 +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[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )];
+ char buffer[sizeof(BITMAPINFO) + 255 * sizeof(RGBQUAD)];
BITMAPINFO *dst_info, *src_info = (BITMAPINFO *)buffer;
DWORD info_size;
UINT usage;
@@ -1118,7 +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[FIELD_OFFSET(METARECORD, rdParm[sizeof(*logpen) / sizeof(WORD)])];
+ char buffer[sizeof(METARECORD) - 2 + sizeof(*logpen)];
METARECORD *mr = (METARECORD *)&buffer;
mr->rdSize = sizeof(buffer) / sizeof(WORD);