diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index b4e178ce..55119fd6 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -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: diff --git a/patches/version-GetFileVersionInfoSizeExW/0001-version-Return-ERROR_FILE_NOT_FOUND-for-Win-9X-when-.patch b/patches/version-GetFileVersionInfoSizeExW/0001-version-Return-ERROR_FILE_NOT_FOUND-for-Win-9X-when-.patch new file mode 100644 index 00000000..9927b72f --- /dev/null +++ b/patches/version-GetFileVersionInfoSizeExW/0001-version-Return-ERROR_FILE_NOT_FOUND-for-Win-9X-when-.patch @@ -0,0 +1,31 @@ +From de85bfa7d218a6a4a938aefffda709dbec7e7b4f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +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 + diff --git a/patches/version-GetFileVersionInfoSizeExW/definition b/patches/version-GetFileVersionInfoSizeExW/definition new file mode 100644 index 00000000..c24ba953 --- /dev/null +++ b/patches/version-GetFileVersionInfoSizeExW/definition @@ -0,0 +1 @@ +Fixes: Return ERROR_FILE_NOT_FOUND for Win 9X when a file was not found in GetFileVersionInfoSizeEx