Added CreateDIBPatternBrushPt (GDI32.35) with minor documentation updates.
diff --git a/objects/brush.c b/objects/brush.c index 2bed591..2f3fd7e 100644 --- a/objects/brush.c +++ b/objects/brush.c
@@ -132,8 +132,22 @@ /*********************************************************************** * CreateDIBPatternBrush32 (GDI32.34) + * + * Create a logical brush which has the pattern specified by the DIB + * + * Function call is for compatability only. CreateDIBPatternBrushPt should be used. + * + * RETURNS + * + * Handle to a logical brush on success, NULL on failure. + * + * BUGS + * */ -HBRUSH32 WINAPI CreateDIBPatternBrush32( HGLOBAL32 hbitmap, UINT32 coloruse ) +HBRUSH32 WINAPI CreateDIBPatternBrush32( + HGLOBAL32 hbitmap, /* Global object containg BITMAPINFO structure */ + UINT32 coloruse /* Specifies color format, if provided */ +) { LOGBRUSH32 logbrush = { BS_DIBPATTERN, coloruse, 0 }; BITMAPINFO *info, *newInfo; @@ -166,6 +180,50 @@ /*********************************************************************** + * CreateDIBPatternBrushPt32 (GDI32.35) + * + * Create a logical brush which has the pattern specified by the DIB + * + * RETURNS + * + * Handle to a logical brush on success, NULL on failure. + * + * BUGS + * + */ +HBRUSH32 WINAPI CreateDIBPatternBrushPt32( + BITMAPINFO *info, /* Pointer to a BITMAPINFO structure */ + UINT32 coloruse /* Specifies color format, if provided */ +) +{ + LOGBRUSH32 logbrush = { BS_DIBPATTERN, coloruse, 0 }; + BITMAPINFO *newInfo; + INT32 size; + + TRACE(gdi, "%04x\n", info ); + + /* Make a copy of the bitmap */ + + + if (info->bmiHeader.biCompression) + size = info->bmiHeader.biSizeImage; + else + size = (info->bmiHeader.biWidth * info->bmiHeader.biBitCount + 31) / 32 + * 8 * info->bmiHeader.biHeight; + size += DIB_BitmapInfoSize( info, coloruse ); + + if (!(logbrush.lbHatch = (INT32)GlobalAlloc16( GMEM_MOVEABLE, size ))) + { + return 0; + } + newInfo = (BITMAPINFO *) GlobalLock16( (HGLOBAL16)logbrush.lbHatch ); + memcpy( newInfo, info, size ); + GlobalUnlock16( (HGLOBAL16)logbrush.lbHatch ); + return CreateBrushIndirect32( &logbrush ); +} + + +/*********************************************************************** * CreateSolidBrush (GDI.66) */ HBRUSH16 WINAPI CreateSolidBrush16( COLORREF color )
diff --git a/relay32/gdi32.spec b/relay32/gdi32.spec index 9c09252..83b6083 100644 --- a/relay32/gdi32.spec +++ b/relay32/gdi32.spec
@@ -37,7 +37,7 @@ 32 stdcall CreateDCA(str str str ptr) CreateDC32A 33 stdcall CreateDCW(wstr wstr wstr ptr) CreateDC32W 34 stdcall CreateDIBPatternBrush(long long) CreateDIBPatternBrush32 - 35 stub CreateDIBPatternBrushPt + 35 stdcall CreateDIBPatternBrushPt(long long) CreateDIBPatternBrushPt32 36 stdcall CreateDIBSection(long ptr long ptr long long) CreateDIBSection32 37 stdcall CreateDIBitmap(long ptr long ptr ptr long) CreateDIBitmap32 38 stdcall CreateDiscardableBitmap(long long long) CreateDiscardableBitmap32