Handle CreateMetaFileW(NULL) correctly.

This commit is contained in:
Mike McCormack 2003-06-24 02:34:42 +00:00 committed by Alexandre Julliard
parent f7f7bd0cfe
commit 69ac76d050
1 changed files with 2 additions and 0 deletions

View File

@ -263,6 +263,8 @@ HDC WINAPI CreateMetaFileW(LPCWSTR filename)
DWORD len; DWORD len;
HDC hReturnDC; HDC hReturnDC;
if (!filename) return CreateMetaFileA(NULL);
len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL ); len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL );
filenameA = HeapAlloc( GetProcessHeap(), 0, len ); filenameA = HeapAlloc( GetProcessHeap(), 0, len );
WideCharToMultiByte( CP_ACP, 0, filename, -1, filenameA, len, NULL, NULL ); WideCharToMultiByte( CP_ACP, 0, filename, -1, filenameA, len, NULL, NULL );