Rebase against 17f052c36a414a05fcb6a6e67bd3aac824fbed3e.

This commit is contained in:
Alistair Leslie-Hughes
2024-07-02 11:15:09 +10:00
parent d1f022f686
commit 0d4b9f2f62
6 changed files with 79 additions and 72 deletions

View File

@@ -1,4 +1,4 @@
From 52baf4b2f68a78a2d0a0ad16fac8e25af70400ff Mon Sep 17 00:00:00 2001
From b083e23347c3f50112410d1c886eb17c75f34a4e Mon Sep 17 00:00:00 2001
From: Andrew Wesie <awesie@gmail.com>
Date: Fri, 24 Apr 2020 14:55:17 -0500
Subject: [PATCH] ntdll: Report unmodified WRITECOPY pages as shared.
@@ -13,10 +13,10 @@ Signed-off-by: Andrew Wesie <awesie@gmail.com>
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index 6c530304442..05d4d517aeb 100644
index b3d8b2f7a95..568a0cef74c 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -2441,6 +2441,8 @@ static NTSTATUS map_image_into_view( struct file_view *view, const WCHAR *filena
@@ -2897,6 +2897,8 @@ static NTSTATUS map_image_into_view( struct file_view *view, const WCHAR *filena
ptr + sec->VirtualAddress + file_size,
ptr + sec->VirtualAddress + end );
memset( ptr + sec->VirtualAddress + file_size, 0, end - file_size );
@@ -25,15 +25,15 @@ index 6c530304442..05d4d517aeb 100644
}
}
@@ -4420,7 +4422,7 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr,
}
@@ -5326,7 +5328,7 @@ static void fill_working_set_info( struct fill_working_set_info_data *d, struct
pagemap = d->pm_buffer[page - d->buffer_start];
p->VirtualAttributes.Valid = !(vprot & VPROT_GUARD) && (vprot & 0x0f) && (pagemap >> 63);
- p->VirtualAttributes.Shared = !is_view_valloc( view ) && ((pagemap >> 61) & 1);
+ p->VirtualAttributes.Shared = (!is_view_valloc( view ) && ((pagemap >> 61) & 1)) || ((view->protect & VPROT_WRITECOPY) && !(vprot & VPROT_WRITTEN));
if (p->VirtualAttributes.Shared && p->VirtualAttributes.Valid)
p->VirtualAttributes.ShareCount = 1; /* FIXME */
if (p->VirtualAttributes.Valid)
p->VirtualAttributes.Valid = !(vprot & VPROT_GUARD) && (vprot & 0x0f) && (pagemap >> 63);
- p->VirtualAttributes.Shared = !is_view_valloc( view ) && ((pagemap >> 61) & 1);
+ p->VirtualAttributes.Shared = (!is_view_valloc( view ) && ((pagemap >> 61) & 1)) || ((view->protect & VPROT_WRITECOPY) && !(vprot & VPROT_WRITTEN));
if (p->VirtualAttributes.Shared && p->VirtualAttributes.Valid)
p->VirtualAttributes.ShareCount = 1; /* FIXME */
if (p->VirtualAttributes.Valid)
--
2.35.1
2.43.0