gdiplus-GdipCreateMetafileFromStream: Update patchset and implement GdipCreateMetafileFromFile.

This commit is contained in:
Sebastian Lackner 2016-06-24 11:53:34 +02:00
parent c8299873fb
commit 093f3b9818
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,41 @@
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

View File

@ -3736,12 +3736,14 @@ if test "$enable_gdiplus_GdipCreateMetafileFromStream" -eq 1; then
patch_apply gdiplus-GdipCreateMetafileFromStream/0003-gdiplus-Implement-GdipGetMetafileHeaderFromWmf.patch
patch_apply gdiplus-GdipCreateMetafileFromStream/0004-gdiplus-Implement-GdipGetMetafileHeaderFromStream.patch
patch_apply gdiplus-GdipCreateMetafileFromStream/0005-gdiplus-Implement-GdipGetMetafileHeaderFromFile.patch
patch_apply gdiplus-GdipCreateMetafileFromStream/0006-gdiplus-Implement-GdipCreateMetafileFromFile.patch
(
echo '+ { "Dmitry Timoshkov", "gdiplus: Implement GdipCreateMetafileFromStream.", 1 },';
echo '+ { "Dmitry Timoshkov", "gdiplus: Implement GdipGetMetafileHeaderFromMetafile.", 1 },';
echo '+ { "Dmitry Timoshkov", "gdiplus: Implement GdipGetMetafileHeaderFromWmf.", 1 },';
echo '+ { "Dmitry Timoshkov", "gdiplus: Implement GdipGetMetafileHeaderFromStream.", 1 },';
echo '+ { "Dmitry Timoshkov", "gdiplus: Implement GdipGetMetafileHeaderFromFile.", 1 },';
echo '+ { "Dmitry Timoshkov", "gdiplus: Implement GdipCreateMetafileFromFile.", 1 },';
) >> "$patchlist"
fi