diff --git a/dlls/version/info.c b/dlls/version/info.c index 0ad288e1e8f..935d0c1a1a7 100644 --- a/dlls/version/info.c +++ b/dlls/version/info.c @@ -246,11 +246,9 @@ static DWORD VERSION_GetFileVersionInfo_PE( LPCWSTR filename, DWORD datasize, LP TRACE("%s\n", debugstr_w(filename)); - hModule = GetModuleHandleW(filename); - if(!hModule) + if (!GetModuleHandleExW(0, filename, &hModule)) hModule = LoadLibraryExW(filename, 0, LOAD_LIBRARY_AS_DATAFILE); - else - hModule = LoadLibraryExW(filename, 0, 0); + if(!hModule) { WARN("Could not load %s\n", debugstr_w(filename));