wine-staging/patches/gdiplus-GdipCreateMetafileFromStream/0005-gdiplus-Implement-GdipGetMetafileHeaderFromFile.patch

47 lines
1.3 KiB
Diff

From 87e34fa7456d8055ac95b2452cda95cee1856310 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Tue, 10 May 2016 13:02:45 +0800
Subject: gdiplus: Implement GdipGetMetafileHeaderFromFile.
---
dlls/gdiplus/metafile.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c
index 2164d42..c4bd727 100644
--- a/dlls/gdiplus/metafile.c
+++ b/dlls/gdiplus/metafile.c
@@ -1084,19 +1084,21 @@ GpStatus WINGDIPAPI GdipGetMetafileHeaderFromWmf(HMETAFILE hwmf,
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromFile(GDIPCONST WCHAR *filename,
MetafileHeader *header)
{
- static int calls;
+ GpStatus status;
+ GpMetafile *metafile;
TRACE("(%s,%p)\n", debugstr_w(filename), header);
- if(!filename || !header)
+ if (!filename || !header)
return InvalidParameter;
- if(!(calls++))
- FIXME("not implemented\n");
-
- memset(header, 0, sizeof(MetafileHeader));
-
- return Ok;
+ status = GdipCreateMetafileFromFile(filename, &metafile);
+ if (status == Ok)
+ {
+ status = GdipGetMetafileHeaderFromMetafile(metafile, header);
+ GdipDisposeImage(&metafile->image);
+ }
+ return status;
}
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromStream(IStream *stream,
--
2.8.0