Commit 83886f23 authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed GetModuleFileNameW return value.

Quiet dll loading error message.
parent 7f6ecdc2
...@@ -1057,15 +1057,15 @@ DWORD WINAPI GetModuleFileNameA( ...@@ -1057,15 +1057,15 @@ DWORD WINAPI GetModuleFileNameA(
/*********************************************************************** /***********************************************************************
* GetModuleFileNameW (KERNEL32.@) * GetModuleFileNameW (KERNEL32.@)
*/ */
DWORD WINAPI GetModuleFileNameW( HMODULE hModule, LPWSTR lpFileName, DWORD WINAPI GetModuleFileNameW( HMODULE hModule, LPWSTR lpFileName, DWORD size )
DWORD size )
{ {
LPSTR fnA = (char*)HeapAlloc( GetProcessHeap(), 0, size ); LPSTR fnA = HeapAlloc( GetProcessHeap(), 0, size * 2 );
DWORD res = GetModuleFileNameA( hModule, fnA, size ); if (!fnA) return 0;
GetModuleFileNameA( hModule, fnA, size * 2 );
if (size > 0 && !MultiByteToWideChar( CP_ACP, 0, fnA, -1, lpFileName, size )) if (size > 0 && !MultiByteToWideChar( CP_ACP, 0, fnA, -1, lpFileName, size ))
lpFileName[size-1] = 0; lpFileName[size-1] = 0;
HeapFree( GetProcessHeap(), 0, fnA ); HeapFree( GetProcessHeap(), 0, fnA );
return res; return strlenW(lpFileName);
} }
...@@ -1344,7 +1344,7 @@ WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags ) ...@@ -1344,7 +1344,7 @@ WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags )
if(GetLastError() != ERROR_FILE_NOT_FOUND) if(GetLastError() != ERROR_FILE_NOT_FOUND)
{ {
ERR("Loading of %s DLL %s failed (error %ld), check this file.\n", WARN("Loading of %s DLL %s failed (error %ld).\n",
filetype, filename, GetLastError()); filetype, filename, GetLastError());
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment