Signed-off-by: Sergio Gómez Del Real sdelreal@codeweavers.com --- dlls/ole32/datacache.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index f46f71215d..945d2fea95 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -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);