From 8744c10a389d2d8171c38ffed9828bec10200cea Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Sat, 16 Mar 2013 12:20:24 +0900 Subject: [PATCH] gdi32: Add support for disk-based metafiles to GetMetaFileBitsEx. --- dlls/gdi32/metafile.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/metafile.c b/dlls/gdi32/metafile.c index dbbffee9302..406728e0b2e 100644 --- a/dlls/gdi32/metafile.c +++ b/dlls/gdi32/metafile.c @@ -1088,17 +1088,27 @@ UINT WINAPI GetMetaFileBitsEx( HMETAFILE hmf, UINT nSize, LPVOID buf ) { METAHEADER *mh = GDI_GetObjPtr( hmf, OBJ_METAFILE ); UINT mfSize; + BOOL mf_copy = FALSE; TRACE("(%p,%d,%p)\n", hmf, nSize, buf); if (!mh) return 0; /* FIXME: error code */ if(mh->mtType == METAFILE_DISK) - FIXME("Disk-based metafile?\n"); + { + mh = MF_LoadDiskBasedMetaFile( mh ); + if (!mh) + { + GDI_ReleaseObj( hmf ); + return 0; + } + mf_copy = TRUE; + } mfSize = mh->mtSize * 2; if (buf) { if(mfSize > nSize) mfSize = nSize; memmove(buf, mh, mfSize); } + if (mf_copy) HeapFree( GetProcessHeap(), 0, mh ); GDI_ReleaseObj( hmf ); TRACE("returning size %d\n", mfSize); return mfSize;