gdi32: Allocate extra DWORD for EMR_CREATEDIBPATTERNBRUSHPT records.
Like for EMR_CREATEMONOBRUSH. Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
08d377c02f
commit
d94d1a8b26
|
@ -197,9 +197,16 @@ static DWORD emfdc_create_brush( struct emf *emf, HBRUSH brush )
|
||||||
info_size = get_dib_info_size( info, usage );
|
info_size = get_dib_info_size( info, usage );
|
||||||
|
|
||||||
emr = HeapAlloc( GetProcessHeap(), 0,
|
emr = HeapAlloc( GetProcessHeap(), 0,
|
||||||
sizeof(EMRCREATEDIBPATTERNBRUSHPT)+info_size+info->bmiHeader.biSizeImage );
|
sizeof(EMRCREATEDIBPATTERNBRUSHPT) + sizeof(DWORD) +
|
||||||
|
info_size+info->bmiHeader.biSizeImage );
|
||||||
if(!emr) break;
|
if(!emr) break;
|
||||||
|
|
||||||
|
/* FIXME: There is an extra DWORD written by native before the BMI.
|
||||||
|
* Not sure what it's meant to contain.
|
||||||
|
*/
|
||||||
|
emr->offBmi = sizeof( EMRCREATEDIBPATTERNBRUSHPT ) + sizeof(DWORD);
|
||||||
|
*(DWORD *)(emr + 1) = 0x20000000;
|
||||||
|
|
||||||
if (logbrush.lbStyle == BS_PATTERN && info->bmiHeader.biBitCount == 1)
|
if (logbrush.lbStyle == BS_PATTERN && info->bmiHeader.biBitCount == 1)
|
||||||
{
|
{
|
||||||
/* Presumably to reduce the size of the written EMF, MS supports an
|
/* Presumably to reduce the size of the written EMF, MS supports an
|
||||||
|
@ -211,16 +218,11 @@ static DWORD emfdc_create_brush( struct emf *emf, HBRUSH brush )
|
||||||
*/
|
*/
|
||||||
emr->emr.iType = EMR_CREATEMONOBRUSH;
|
emr->emr.iType = EMR_CREATEMONOBRUSH;
|
||||||
usage = DIB_PAL_MONO;
|
usage = DIB_PAL_MONO;
|
||||||
/* FIXME: There is an extra DWORD written by native before the BMI.
|
|
||||||
* Not sure what it's meant to contain.
|
|
||||||
*/
|
|
||||||
emr->offBmi = sizeof( EMRCREATEDIBPATTERNBRUSHPT ) + sizeof(DWORD);
|
|
||||||
emr->cbBmi = sizeof( BITMAPINFOHEADER );
|
emr->cbBmi = sizeof( BITMAPINFOHEADER );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
emr->emr.iType = EMR_CREATEDIBPATTERNBRUSHPT;
|
emr->emr.iType = EMR_CREATEDIBPATTERNBRUSHPT;
|
||||||
emr->offBmi = sizeof( EMRCREATEDIBPATTERNBRUSHPT );
|
|
||||||
emr->cbBmi = info_size;
|
emr->cbBmi = info_size;
|
||||||
}
|
}
|
||||||
emr->ihBrush = index = emfdc_add_handle( emf, brush );
|
emr->ihBrush = index = emfdc_add_handle( emf, brush );
|
||||||
|
|
Loading…
Reference in New Issue