Re: version: Fix error in win 9x mode when a file was not found in GetFileVersionInfoSize.
On 28.04.2017 18:03, Sebastian Lackner wrote:
From: Michael Müller <michael(a)fds-team.de>
Signed-off-by: Michael Müller <michael(a)fds-team.de> Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> --- dlls/version/version.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/version/version.c b/dlls/version/version.c index ed060c82b6..3ab53026e8 100644 --- a/dlls/version/version.c +++ b/dlls/version/version.c @@ -705,7 +705,12 @@ DWORD WINAPI GetFileVersionInfoSizeExW( DWORD flags, LPCWSTR filename, LPDWORD h return (len * 2) + 4;
default: - SetLastError( lzfd == HFILE_ERROR ? ofs.nErrCode : ERROR_RESOURCE_DATA_NOT_FOUND ); + if (lzfd == HFILE_ERROR) + SetLastError(ofs.nErrCode); + else if (GetVersion() & 0x80000000) + SetLastError(ERROR_FILE_NOT_FOUND); + else + SetLastError(ERROR_RESOURCE_DATA_NOT_FOUND); return 0; } }
What depends on this? Is this function actually exported on Win9x? If not this fixup should happen in actual affected export I think.
Nikolay Sivov <bunglehead(a)gmail.com> wrote:
@@ -705,7 +705,12 @@ DWORD WINAPI GetFileVersionInfoSizeExW( DWORD flags, LPCWSTR filename, LPDWORD h return (len * 2) + 4;
default: - SetLastError( lzfd == HFILE_ERROR ? ofs.nErrCode : ERROR_RESOURCE_DATA_NOT_FOUND ); + if (lzfd == HFILE_ERROR) + SetLastError(ofs.nErrCode); + else if (GetVersion() & 0x80000000) + SetLastError(ERROR_FILE_NOT_FOUND); + else + SetLastError(ERROR_RESOURCE_DATA_NOT_FOUND); return 0; } }
What depends on this? Is this function actually exported on Win9x? If not this fixup should happen in actual affected export I think.
While GetFileVersionInfoSizeExW is not exported in win9x indeed, GetFileVersionInfoSizeW is exported, and since GetFileVersionInfoSizeW is just a forward to GetFileVersionInfoSizeExW it shouldn't matter in practice where win9x specific behaviour is actually implemented. -- Dmitry.
participants (2)
-
Dmitry Timoshkov -
Nikolay Sivov