Fixed GetModuleFileNameW return value.

Quiet dll loading error message.
This commit is contained in:
Alexandre Julliard 2002-07-05 01:27:19 +00:00
parent 7f6ecdc2ef
commit 83886f23fa
1 changed files with 7 additions and 7 deletions

View File

@ -1057,15 +1057,15 @@ DWORD WINAPI GetModuleFileNameA(
/***********************************************************************
* GetModuleFileNameW (KERNEL32.@)
*/
DWORD WINAPI GetModuleFileNameW( HMODULE hModule, LPWSTR lpFileName,
DWORD size )
DWORD WINAPI GetModuleFileNameW( HMODULE hModule, LPWSTR lpFileName, DWORD size )
{
LPSTR fnA = (char*)HeapAlloc( GetProcessHeap(), 0, size );
DWORD res = GetModuleFileNameA( hModule, fnA, size );
LPSTR fnA = HeapAlloc( GetProcessHeap(), 0, size * 2 );
if (!fnA) return 0;
GetModuleFileNameA( hModule, fnA, size * 2 );
if (size > 0 && !MultiByteToWideChar( CP_ACP, 0, fnA, -1, lpFileName, size ))
lpFileName[size-1] = 0;
HeapFree( GetProcessHeap(), 0, fnA );
return res;
return strlenW(lpFileName);
}
@ -1344,8 +1344,8 @@ WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags )
if(GetLastError() != ERROR_FILE_NOT_FOUND)
{
ERR("Loading of %s DLL %s failed (error %ld), check this file.\n",
filetype, filename, GetLastError());
WARN("Loading of %s DLL %s failed (error %ld).\n",
filetype, filename, GetLastError());
break;
}
}