Commit a8b007da authored by Alexandre Julliard's avatar Alexandre Julliard

kernelbase: Fix error value for PE files without resource.

Avoids spurious "dll is missing" messages from winetest.
parent f143af50
......@@ -775,7 +775,7 @@ DWORD WINAPI GetFileVersionInfoSizeExW( DWORD flags, LPCWSTR filename, LPDWORD r
if (flags & ~FILE_VER_GET_LOCALISED)
FIXME("flags 0x%lx ignored\n", flags & ~FILE_VER_GET_LOCALISED);
if ((hModule = LoadLibraryExW( filename, 0, LOAD_LIBRARY_AS_DATAFILE )))
if ((hModule = LoadLibraryExW( filename, 0, LOAD_LIBRARY_AS_IMAGE_RESOURCE )))
{
HRSRC hRsrc = NULL;
if (!(flags & FILE_VER_GET_LOCALISED))
......@@ -794,8 +794,7 @@ DWORD WINAPI GetFileVersionInfoSizeExW( DWORD flags, LPCWSTR filename, LPDWORD r
}
FreeLibrary( hModule );
}
if (magic == 1)
else
{
HANDLE handle = CreateFileW( filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, 0 );
......@@ -881,7 +880,7 @@ BOOL WINAPI GetFileVersionInfoExW( DWORD flags, LPCWSTR filename, DWORD ignored,
if (flags & ~FILE_VER_GET_LOCALISED)
FIXME("flags 0x%lx ignored\n", flags & ~FILE_VER_GET_LOCALISED);
if ((hModule = LoadLibraryExW( filename, 0, LOAD_LIBRARY_AS_DATAFILE )))
if ((hModule = LoadLibraryExW( filename, 0, LOAD_LIBRARY_AS_IMAGE_RESOURCE )))
{
HRSRC hRsrc = NULL;
if (!(flags & FILE_VER_GET_LOCALISED))
......@@ -903,8 +902,7 @@ BOOL WINAPI GetFileVersionInfoExW( DWORD flags, LPCWSTR filename, DWORD ignored,
}
FreeLibrary( hModule );
}
if (magic == 1)
else
{
HANDLE handle = CreateFileW( filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, 0 );
......
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