Added patch to reduce stack usage of virtual memory functions.

This commit is contained in:
Sebastian Lackner
2015-09-26 23:38:49 +02:00
parent 2f4c5ae81e
commit f64d5ad94d
13 changed files with 740 additions and 51 deletions

View File

@@ -1,20 +1,20 @@
From 9f83442a212635a7921420c56c217df0c0e46fc4 Mon Sep 17 00:00:00 2001
From 134f935483d49fad68e814d21a30f483f606d386 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 20 Aug 2014 19:21:18 +0200
Subject: ntdll: Move NtProtectVirtualMemory and NtCreateSection to separate
pages on x86. (try 2)
---
dlls/ntdll/virtual.c | 7 +++++++
1 file changed, 7 insertions(+)
dlls/ntdll/virtual.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 4819d2d..63ba0a3 100644
index 020a6c0..592d65f 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -150,6 +150,13 @@ static void *preload_reserve_end;
static BOOL use_locks;
static BOOL force_exec_prot; /* whether to force PROT_EXEC on all PROT_READ mmaps */
@@ -170,6 +170,14 @@ static void virtual_unlock(void)
else RtlLeaveCriticalSection( &csVirtual );
}
+#if defined(__i386__)
+NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *size_ptr,
@@ -23,9 +23,10 @@ index 4819d2d..63ba0a3 100644
+ const LARGE_INTEGER *size, ULONG protect,
+ ULONG sec_flags, HANDLE file ) DECLSPEC_ALIGN(4096);
+#endif
+
/***********************************************************************
* VIRTUAL_GetProtStr
*/
--
1.9.1
2.5.1

View File

@@ -1,2 +1,3 @@
Fixes: [33162] Ensure NtProtectVirtualMemory and NtCreateSection are on separate pages
Depends: ntdll-Virtual_Memory_Stack
Category: stable