diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c index 08dde2fec62..1e48d07703b 100644 --- a/dlls/gdiplus/metafile.c +++ b/dlls/gdiplus/metafile.c @@ -1817,6 +1817,39 @@ static GpStatus metafile_deserialize_image(const BYTE *record_data, UINT data_si } break; } + case ImageDataTypeMetafile: + { + EmfPlusMetafile *metafiledata = &data->ImageData.metafile; + + if (data_size <= FIELD_OFFSET(EmfPlusMetafile, MetafileData)) + return InvalidParameter; + data_size -= FIELD_OFFSET(EmfPlusMetafile, MetafileData); + + switch (metafiledata->Type) { + case MetafileTypeEmf: + case MetafileTypeEmfPlusOnly: + case MetafileTypeEmfPlusDual: + { + HENHMETAFILE hemf; + + hemf = SetEnhMetaFileBits(data_size, metafiledata->MetafileData); + + if (!hemf) + return GenericError; + + status = GdipCreateMetafileFromEmf(hemf, TRUE, (GpMetafile**)image); + + if (status != Ok) + DeleteEnhMetaFile(hemf); + + break; + } + default: + FIXME("metafile type %d not supported.\n", metafiledata->Type); + return NotImplemented; + } + break; + } default: FIXME("image type %d not supported.\n", data->Type); return NotImplemented;