From 9b9d2c756643a5118a1f369a3225e08dabd703c0 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 27 Feb 2016 05:11:25 +0100 Subject: [PATCH] Added patch to avoid reassigning default handles after they got closed. --- ...-not-reassign-default-handles-after-.patch | 25 +++++++++++++++++++ patches/krnl386.exe16-_lclose16/definition | 1 + patches/patchinstall.sh | 19 ++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 patches/krnl386.exe16-_lclose16/0001-krnl386.exe16-Do-not-reassign-default-handles-after-.patch create mode 100644 patches/krnl386.exe16-_lclose16/definition diff --git a/patches/krnl386.exe16-_lclose16/0001-krnl386.exe16-Do-not-reassign-default-handles-after-.patch b/patches/krnl386.exe16-_lclose16/0001-krnl386.exe16-Do-not-reassign-default-handles-after-.patch new file mode 100644 index 00000000..f4fd8fe5 --- /dev/null +++ b/patches/krnl386.exe16-_lclose16/0001-krnl386.exe16-Do-not-reassign-default-handles-after-.patch @@ -0,0 +1,25 @@ +From 8acd785888b9324994f0477d6d2f2bdcd3b91219 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 27 Feb 2016 03:20:34 +0100 +Subject: krnl386.exe16: Do not reassign default handles after they got closed. + +--- + dlls/krnl386.exe16/file.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/krnl386.exe16/file.c b/dlls/krnl386.exe16/file.c +index b66b753..9b720ef 100644 +--- a/dlls/krnl386.exe16/file.c ++++ b/dlls/krnl386.exe16/file.c +@@ -363,7 +363,7 @@ HFILE16 WINAPI _lclose16( HFILE16 hFile ) + } + TRACE("%d (handle32=%p)\n", hFile, dos_handles[hFile] ); + CloseHandle( dos_handles[hFile] ); +- dos_handles[hFile] = 0; ++ dos_handles[hFile] = (hFile < 5) ? INVALID_HANDLE_VALUE : 0; + return 0; + } + +-- +2.7.1 + diff --git a/patches/krnl386.exe16-_lclose16/definition b/patches/krnl386.exe16-_lclose16/definition new file mode 100644 index 00000000..09964e69 --- /dev/null +++ b/patches/krnl386.exe16-_lclose16/definition @@ -0,0 +1 @@ +Fixes: [19184] Do not reassign default handles after they got closed diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index f00207c9..48a217db 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -177,6 +177,7 @@ patch_enable_all () enable_kernel32_VerifyVersionInfo="$1" enable_krnl386_exe16_GDT_LDT_Emulation="$1" enable_krnl386_exe16_Invalid_Console_Handles="$1" + enable_krnl386_exe16__lclose16="$1" enable_libs_Debug_Channel="$1" enable_libs_Unicode_Collation="$1" enable_makedep_PARENTSPEC="$1" @@ -679,6 +680,9 @@ patch_enable () krnl386.exe16-Invalid_Console_Handles) enable_krnl386_exe16_Invalid_Console_Handles="$2" ;; + krnl386.exe16-_lclose16) + enable_krnl386_exe16__lclose16="$2" + ;; libs-Debug_Channel) enable_libs_Debug_Channel="$2" ;; @@ -4219,6 +4223,21 @@ if test "$enable_krnl386_exe16_Invalid_Console_Handles" -eq 1; then ) >> "$patchlist" fi +# Patchset krnl386.exe16-_lclose16 +# | +# | This patchset fixes the following Wine bugs: +# | * [#19184] Do not reassign default handles after they got closed +# | +# | Modified files: +# | * dlls/krnl386.exe16/file.c +# | +if test "$enable_krnl386_exe16__lclose16" -eq 1; then + patch_apply krnl386.exe16-_lclose16/0001-krnl386.exe16-Do-not-reassign-default-handles-after-.patch + ( + echo '+ { "Michael Müller", "krnl386.exe16: Do not reassign default handles after they got closed.", 1 },'; + ) >> "$patchlist" +fi + # Patchset libs-Debug_Channel # | # | Modified files: