mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-09-13 09:17:20 -07:00
Rebase against 3149d27220acaf276bfa651e040ff006edcd6944.
This commit is contained in:
parent
cd4d265f07
commit
7bcf1f6358
@ -1,4 +1,4 @@
|
||||
From 94bf6ec892be0a018d4529456c47df34efdb99ce Mon Sep 17 00:00:00 2001
|
||||
From 6fbb8f079b1024d742f2cc34425e6099e23f2f39 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <pgofman@codeweavers.com>
|
||||
Date: Thu, 10 Nov 2022 18:53:10 -0600
|
||||
Subject: [PATCH] ntdll: Support MEM_RESERVE_PLACEHOLDER in
|
||||
@ -10,10 +10,10 @@ Based on a patch by Nikolay Sivov.
|
||||
1 file changed, 24 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index 66256a4712f..5bea8ba8322 100644
|
||||
index f078e114b4c..6204ed5a452 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -3918,13 +3918,18 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ
|
||||
@@ -3891,13 +3891,18 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ
|
||||
|
||||
/* Compute the alloc type flags */
|
||||
|
||||
@ -34,7 +34,7 @@ index 66256a4712f..5bea8ba8322 100644
|
||||
/* Reserve the memory */
|
||||
|
||||
server_enter_uninterrupted_section( &virtual_mutex, &sigset );
|
||||
@@ -3935,6 +3940,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ
|
||||
@@ -3908,6 +3913,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ
|
||||
{
|
||||
if (type & MEM_COMMIT) vprot |= VPROT_COMMITTED;
|
||||
if (type & MEM_WRITE_WATCH) vprot |= VPROT_WRITEWATCH;
|
||||
@ -42,7 +42,7 @@ index 66256a4712f..5bea8ba8322 100644
|
||||
if (protect & PAGE_NOCACHE) vprot |= SEC_NOCACHE;
|
||||
|
||||
if (vprot & VPROT_WRITECOPY) status = STATUS_INVALID_PAGE_PROTECTION;
|
||||
@@ -3954,6 +3960,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ
|
||||
@@ -3927,6 +3933,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ
|
||||
{
|
||||
if (!(view = find_view( base, size ))) status = STATUS_NOT_MAPPED_VIEW;
|
||||
else if (view->protect & SEC_FILE) status = STATUS_ALREADY_COMMITTED;
|
||||
@ -50,7 +50,7 @@ index 66256a4712f..5bea8ba8322 100644
|
||||
else if (!(status = set_protection( view, base, size, protect )) && (view->protect & SEC_RESERVE))
|
||||
{
|
||||
SERVER_START_REQ( add_mapping_committed_range )
|
||||
@@ -3987,6 +3994,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ
|
||||
@@ -3960,6 +3967,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ
|
||||
NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG_PTR zero_bits,
|
||||
SIZE_T *size_ptr, ULONG type, ULONG protect )
|
||||
{
|
||||
@ -58,8 +58,8 @@ index 66256a4712f..5bea8ba8322 100644
|
||||
ULONG_PTR limit;
|
||||
|
||||
TRACE("%p %p %08lx %x %08x\n", process, *ret, *size_ptr, (int)type, (int)protect );
|
||||
@@ -3998,6 +4006,12 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG_PTR z
|
||||
if (!is_wow64 && zero_bits >= 32) return STATUS_INVALID_PARAMETER_3;
|
||||
@@ -3971,6 +3979,12 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG_PTR z
|
||||
if (!is_old_wow64() && zero_bits >= 32) return STATUS_INVALID_PARAMETER_3;
|
||||
#endif
|
||||
|
||||
+ if (type & ~type_mask)
|
||||
@ -71,7 +71,7 @@ index 66256a4712f..5bea8ba8322 100644
|
||||
if (process != NtCurrentProcess())
|
||||
{
|
||||
apc_call_t call;
|
||||
@@ -4040,6 +4054,8 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s
|
||||
@@ -4013,6 +4027,8 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s
|
||||
ULONG protect, MEM_EXTENDED_PARAMETER *parameters,
|
||||
ULONG count )
|
||||
{
|
||||
@ -80,7 +80,7 @@ index 66256a4712f..5bea8ba8322 100644
|
||||
ULONG_PTR limit = 0;
|
||||
ULONG_PTR align = 0;
|
||||
|
||||
@@ -4048,6 +4064,12 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s
|
||||
@@ -4021,6 +4037,12 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s
|
||||
|
||||
if (count && !parameters) return STATUS_INVALID_PARAMETER;
|
||||
|
||||
@ -94,5 +94,5 @@ index 66256a4712f..5bea8ba8322 100644
|
||||
{
|
||||
MEM_ADDRESS_REQUIREMENTS *r = NULL;
|
||||
--
|
||||
2.38.1
|
||||
2.40.0
|
||||
|
||||
|
@ -1 +1 @@
|
||||
fd99bd4e247a879e8cb186212d1dc66268aa0888
|
||||
3149d27220acaf276bfa651e040ff006edcd6944
|
||||
|
Loading…
Reference in New Issue
Block a user