Commit 55cc226d authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Set last error values compatible with Win9x implementation

of GetFileVersionInfoSize, Quicken installer depends on it.
parent 81a049bd
...@@ -512,6 +512,17 @@ DWORD WINAPI GetFileVersionInfoSizeW( LPCWSTR filename, LPDWORD handle ) ...@@ -512,6 +512,17 @@ DWORD WINAPI GetFileVersionInfoSizeW( LPCWSTR filename, LPDWORD handle )
if (handle) *handle = 0; if (handle) *handle = 0;
if (!filename)
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
if (!*filename)
{
SetLastError(ERROR_BAD_PATHNAME);
return 0;
}
len = VERSION_GetFileVersionInfo_PE(filename, 0, NULL); len = VERSION_GetFileVersionInfo_PE(filename, 0, NULL);
/* 0xFFFFFFFF means: file is a PE module, but VERSION_INFO not found */ /* 0xFFFFFFFF means: file is a PE module, but VERSION_INFO not found */
if(len == 0xFFFFFFFF) if(len == 0xFFFFFFFF)
...@@ -531,7 +542,12 @@ DWORD WINAPI GetFileVersionInfoSizeW( LPCWSTR filename, LPDWORD handle ) ...@@ -531,7 +542,12 @@ DWORD WINAPI GetFileVersionInfoSizeW( LPCWSTR filename, LPDWORD handle )
len = VERSION_GetFileVersionInfo_16(filenameA, 0, NULL); len = VERSION_GetFileVersionInfo_16(filenameA, 0, NULL);
HeapFree( GetProcessHeap(), 0, filenameA ); HeapFree( GetProcessHeap(), 0, filenameA );
/* 0xFFFFFFFF means: file exists, but VERSION_INFO not found */ /* 0xFFFFFFFF means: file exists, but VERSION_INFO not found */
if (!len || len == 0xFFFFFFFF) if (!len)
{
SetLastError(ERROR_FILE_NOT_FOUND);
return 0;
}
if (len == 0xFFFFFFFF)
{ {
SetLastError(ERROR_RESOURCE_DATA_NOT_FOUND); SetLastError(ERROR_RESOURCE_DATA_NOT_FOUND);
return 0; return 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