ole32: Add support for saving DIBs to CONTENTS streams.

Signed-off-by: Sergio Gómez Del Real <sdelreal@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sergio Gómez Del Real 2017-12-06 10:52:24 -05:00 committed by Alexandre Julliard
parent 07af05fa80
commit 65b3d01fae
1 changed files with 13 additions and 0 deletions

View File

@ -823,6 +823,19 @@ static HRESULT save_dib(DataCacheEntry *entry, BOOL contents, IStream *stream)
if (hr == S_OK && data_size)
hr = IStream_Write(stream, bmi, data_size, NULL);
}
else
{
BITMAPFILEHEADER bmp_fhdr;
bmp_fhdr.bfType = 0x4d42;
bmp_fhdr.bfSize = data_size + sizeof(BITMAPFILEHEADER);
bmp_fhdr.bfReserved1 = bmp_fhdr.bfReserved2 = 0;
if (data_size)
bmp_fhdr.bfOffBits = bitmap_info_size(bmi, DIB_RGB_COLORS) + sizeof(BITMAPFILEHEADER);
hr = IStream_Write(stream, &bmp_fhdr, sizeof(BITMAPFILEHEADER), NULL);
if (hr == S_OK && data_size)
hr = IStream_Write(stream, bmi, data_size, NULL);
}
end:
if (bmi) GlobalUnlock(entry->stgmedium.u.hGlobal);