diff --git a/patches/ntdll-NtUnmapViewOfSection/0001-ntdll-Don-t-fail-in-NtUnmapViewOfSection-when-trying.patch b/patches/ntdll-NtUnmapViewOfSection/0001-ntdll-Don-t-fail-in-NtUnmapViewOfSection-when-trying.patch new file mode 100644 index 00000000..a3f44d5a --- /dev/null +++ b/patches/ntdll-NtUnmapViewOfSection/0001-ntdll-Don-t-fail-in-NtUnmapViewOfSection-when-trying.patch @@ -0,0 +1,45 @@ +From 3748f23616bf25fb2f599f7896d8437614918ce0 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Mon, 9 Oct 2017 14:18:30 +0200 +Subject: ntdll: Don't fail in NtUnmapViewOfSection when trying to unmap + builtin view. + +Fixes a regression introduced in a557934c76c0e0bed6b73e5c8f79a0df059ff2de. +--- + dlls/ntdll/virtual.c | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c +index f33579840a2..04862237bb9 100644 +--- a/dlls/ntdll/virtual.c ++++ b/dlls/ntdll/virtual.c +@@ -3071,13 +3071,21 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr ) + server_enter_uninterrupted_section( &csVirtual, &sigset ); + if ((view = VIRTUAL_FindView( addr, 0 )) && !is_view_valloc( view )) + { +- SERVER_START_REQ( unmap_view ) ++ if (view->protect & VPROT_SYSTEM) + { +- req->base = wine_server_client_ptr( view->base ); +- status = wine_server_call( req ); ++ delete_view( view ); ++ status = STATUS_SUCCESS; ++ } ++ else ++ { ++ SERVER_START_REQ( unmap_view ) ++ { ++ req->base = wine_server_client_ptr( view->base ); ++ status = wine_server_call( req ); ++ } ++ SERVER_END_REQ; ++ if (!status) delete_view( view ); + } +- SERVER_END_REQ; +- if (!status) delete_view( view ); + } + server_leave_uninterrupted_section( &csVirtual, &sigset ); + return status; +-- +2.14.1 + diff --git a/patches/ntdll-NtUnmapViewOfSection/definition b/patches/ntdll-NtUnmapViewOfSection/definition new file mode 100644 index 00000000..b5b7e126 --- /dev/null +++ b/patches/ntdll-NtUnmapViewOfSection/definition @@ -0,0 +1 @@ +Fixes: [43860] Don't fail in NtUnmapViewOfSection when trying to unmap builtin view diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 77d52d5c..c75d9d23 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -273,6 +273,7 @@ patch_enable_all () enable_ntdll_NtSetInformationToken="$1" enable_ntdll_NtSetLdtEntries="$1" enable_ntdll_NtSuspendProcess="$1" + enable_ntdll_NtUnmapViewOfSection="$1" enable_ntdll_Pipe_SpecialCharacters="$1" enable_ntdll_ProcessImageFileNameWin32="$1" enable_ntdll_ProcessPriorityClass="$1" @@ -1102,6 +1103,9 @@ patch_enable () ntdll-NtSuspendProcess) enable_ntdll_NtSuspendProcess="$2" ;; + ntdll-NtUnmapViewOfSection) + enable_ntdll_NtUnmapViewOfSection="$2" + ;; ntdll-Pipe_SpecialCharacters) enable_ntdll_Pipe_SpecialCharacters="$2" ;; @@ -6816,6 +6820,21 @@ if test "$enable_ntdll_NtSuspendProcess" -eq 1; then ) >> "$patchlist" fi +# Patchset ntdll-NtUnmapViewOfSection +# | +# | This patchset fixes the following Wine bugs: +# | * [#43860] Don't fail in NtUnmapViewOfSection when trying to unmap builtin view +# | +# | Modified files: +# | * dlls/ntdll/virtual.c +# | +if test "$enable_ntdll_NtUnmapViewOfSection" -eq 1; then + patch_apply ntdll-NtUnmapViewOfSection/0001-ntdll-Don-t-fail-in-NtUnmapViewOfSection-when-trying.patch + ( + printf '%s\n' '+ { "Sebastian Lackner", "ntdll: Don'\''t fail in NtUnmapViewOfSection when trying to unmap builtin view.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ntdll-ProcessImageFileNameWin32 # | # | Modified files: