From 3769778917b2cea0590ffb50e1174e354235174c Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 9 Sep 2016 13:42:43 -0500 Subject: [PATCH] gdiplus: Implement GdipCreateMetafileFromStream. Signed-off-by: Vincent Povirk Signed-off-by: Alexandre Julliard --- dlls/gdiplus/metafile.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c index 71d89ae9999..b3b46827bc9 100644 --- a/dlls/gdiplus/metafile.c +++ b/dlls/gdiplus/metafile.c @@ -1917,8 +1917,21 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromFile(GDIPCONST WCHAR *file, GpStatus WINGDIPAPI GdipCreateMetafileFromStream(IStream *stream, GpMetafile **metafile) { - FIXME("(%p, %p): stub\n", stream, metafile); - return NotImplemented; + GpStatus stat; + + TRACE("%p %p\n", stream, metafile); + + stat = GdipLoadImageFromStream(stream, (GpImage **)metafile); + if (stat != Ok) return stat; + + if ((*metafile)->image.type != ImageTypeMetafile) + { + GdipDisposeImage(&(*metafile)->image); + *metafile = NULL; + return GenericError; + } + + return Ok; } GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit(GpMetafile *metafile,