From 69ac76d050208f4724c91983c6a34b20e1141c52 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Tue, 24 Jun 2003 02:34:42 +0000 Subject: [PATCH] Handle CreateMetaFileW(NULL) correctly. --- dlls/gdi/mfdrv/init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/gdi/mfdrv/init.c b/dlls/gdi/mfdrv/init.c index ca4d45f1363..6097127e22e 100644 --- a/dlls/gdi/mfdrv/init.c +++ b/dlls/gdi/mfdrv/init.c @@ -263,6 +263,8 @@ HDC WINAPI CreateMetaFileW(LPCWSTR filename) DWORD len; HDC hReturnDC; + if (!filename) return CreateMetaFileA(NULL); + len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL ); filenameA = HeapAlloc( GetProcessHeap(), 0, len ); WideCharToMultiByte( CP_ACP, 0, filename, -1, filenameA, len, NULL, NULL );