wine-staging/patches/ntdll-NtUnmapViewOfSection/0001-ntdll-Don-t-fail-in-NtUnmapViewOfSection-when-trying.patch

46 lines
1.5 KiB
Diff

From 3748f23616bf25fb2f599f7896d8437614918ce0 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
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