From 093f3b98188ed382ad50d8db739f5fe098cfeeee Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 24 Jun 2016 11:53:34 +0200 Subject: [PATCH] gdiplus-GdipCreateMetafileFromStream: Update patchset and implement GdipCreateMetafileFromFile. --- ...Implement-GdipCreateMetafileFromFile.patch | 41 +++++++++++++++++++ patches/patchinstall.sh | 2 + 2 files changed, 43 insertions(+) create mode 100644 patches/gdiplus-GdipCreateMetafileFromStream/0006-gdiplus-Implement-GdipCreateMetafileFromFile.patch diff --git a/patches/gdiplus-GdipCreateMetafileFromStream/0006-gdiplus-Implement-GdipCreateMetafileFromFile.patch b/patches/gdiplus-GdipCreateMetafileFromStream/0006-gdiplus-Implement-GdipCreateMetafileFromFile.patch new file mode 100644 index 00000000..ded3252d --- /dev/null +++ b/patches/gdiplus-GdipCreateMetafileFromStream/0006-gdiplus-Implement-GdipCreateMetafileFromFile.patch @@ -0,0 +1,41 @@ +From 0bfed12f7c720bc7a929bd8c8b249b47b949aeb3 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +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 + diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 4ddf0063..296c8bf3 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -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