wine-staging/patches/gdiplus-GdipCreateMetafileFromStream/0006-gdiplus-Implement-GdipCreateMetafileFromFile.patch

42 lines
1.2 KiB
Diff
Raw Normal View History

From 0bfed12f7c720bc7a929bd8c8b249b47b949aeb3 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 22 Jun 2016 16:19:59 +0800
Subject: gdiplus: Implement GdipCreateMetafileFromFile.
---
dlls/gdiplus/metafile.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c
index 6b9ee73..a3933b0 100644
--- a/dlls/gdiplus/metafile.c
+++ b/dlls/gdiplus/metafile.c
@@ -1227,8 +1227,22 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmfFile(GDIPCONST WCHAR *file,
GpStatus WINGDIPAPI GdipCreateMetafileFromFile(GDIPCONST WCHAR *file,
GpMetafile **metafile)
{
- FIXME("(%p, %p): stub\n", file, metafile);
- return NotImplemented;
+ GpStatus status;
+ IStream *stream;
+
+ TRACE("(%p, %p)\n", file, metafile);
+
+ if (!file || !metafile) return InvalidParameter;
+
+ *metafile = NULL;
+
+ status = GdipCreateStreamOnFile(file, GENERIC_READ, &stream);
+ if (status == Ok)
+ {
+ status = GdipCreateMetafileFromStream(stream, metafile);
+ IStream_Release(stream);
+ }
+ return status;
}
GpStatus WINGDIPAPI GdipCreateMetafileFromStream(IStream *stream,
--
2.8.0