Added patch to return ERROR_FILE_NOT_FOUND for Win 9X when a file was not found in GetFileVersionInfoSizeEx.

This commit is contained in:
Sebastian Lackner 2016-03-02 23:34:19 +01:00
parent b7c7a94d42
commit 35f38e546c
3 changed files with 48 additions and 0 deletions

View File

@ -331,6 +331,7 @@ patch_enable_all ()
enable_user32_WM_MDICALCCHILDSCROLL="$1"
enable_user32_WndProc="$1"
enable_uxtheme_GTK_Theming="$1"
enable_version_GetFileVersionInfoSizeExW="$1"
enable_version_VerFindFileA="$1"
enable_version_VerQueryValue="$1"
enable_wbemdisp_ISWbemSecurity="$1"
@ -1150,6 +1151,9 @@ patch_enable ()
uxtheme-GTK_Theming)
enable_uxtheme_GTK_Theming="$2"
;;
version-GetFileVersionInfoSizeExW)
enable_version_GetFileVersionInfoSizeExW="$2"
;;
version-VerFindFileA)
enable_version_VerFindFileA="$2"
;;
@ -6693,6 +6697,18 @@ if test "$enable_uxtheme_GTK_Theming" -eq 1; then
) >> "$patchlist"
fi
# Patchset version-GetFileVersionInfoSizeExW
# |
# | Modified files:
# | * dlls/version/version.c
# |
if test "$enable_version_GetFileVersionInfoSizeExW" -eq 1; then
patch_apply version-GetFileVersionInfoSizeExW/0001-version-Return-ERROR_FILE_NOT_FOUND-for-Win-9X-when-.patch
(
echo '+ { "Michael Müller", "version: Return ERROR_FILE_NOT_FOUND for Win 9X when a file was not found in GetFileVersionInfoSizeEx.", 1 },';
) >> "$patchlist"
fi
# Patchset version-VerFindFileA
# |
# | Modified files:

View File

@ -0,0 +1,31 @@
From de85bfa7d218a6a4a938aefffda709dbec7e7b4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 2 Mar 2016 22:59:57 +0100
Subject: version: Return ERROR_FILE_NOT_FOUND for Win 9X when a file was not
found in GetFileVersionInfoSizeEx.
---
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 43f5c18..71bfc67 100644
--- a/dlls/version/version.c
+++ b/dlls/version/version.c
@@ -694,7 +694,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;
}
}
--
2.7.1

View File

@ -0,0 +1 @@
Fixes: Return ERROR_FILE_NOT_FOUND for Win 9X when a file was not found in GetFileVersionInfoSizeEx