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

@@ -39,11 +39,12 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
-----------------------------------
**Bug fixes and features included in the next upcoming release [4]:**
**Bug fixes and features included in the next upcoming release [5]:**
* Add implementation for msidb commandline tool
* Codepage conversion should fail when destination length is < 0
* Implement semi-stub for d3d8 swapchain effect D3DSWAPEFFECT_COPY_VSYNC ([Wine Bug #37587](https://bugs.winehq.org/show_bug.cgi?id=37587))
* Reduce stack usage of virtual memory functions ([Wine Bug #34558](https://bugs.winehq.org/show_bug.cgi?id=34558))
* Return STATUS_INVALID_DEVICE_REQUEST when trying to call NtReadFile on directory

1
debian/changelog vendored
View File

@@ -8,6 +8,7 @@ wine-staging (1.7.52) UNRELEASED; urgency=low
* Added patches for msidb commandline utility (to read and write *.msi files).
* Added patch to implement semi-stub for d3d8 swapchain effect
D3DSWAPEFFECT_COPY_VSYNC.
* Added patch to reduce stack usage of virtual memory functions.
* Removed patch to fix possible memory leak in netprofm init_networks (fixed
upstream).
* Removed patch for stub of dwmapi.DwmUpdateThumbnailProperties (accepted

View File

@@ -1,4 +1,4 @@
From dae71e69de99580ced403804e944c7a13e0519e9 Mon Sep 17 00:00:00 2001
From 25288a6031d1a4cf1a7e409eb06ac234d21761ac Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 21 Aug 2015 06:39:47 +0800
Subject: ntdll: Do not allow to deallocate thread stack for current thread.
@@ -14,10 +14,10 @@ Subject: ntdll: Do not allow to deallocate thread stack for current thread.
7 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 46776a6..14b47ac 100644
index cbd19db..6e25915 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -242,8 +242,18 @@ struct ntdll_thread_data
@@ -240,8 +240,18 @@ struct ntdll_thread_data
WINE_VM86_TEB_INFO vm86; /* 1fc vm86 private data */
void *exit_frame; /* 204 exit frame pointer */
#endif
@@ -37,7 +37,7 @@ index 46776a6..14b47ac 100644
{
return (struct ntdll_thread_data *)NtCurrentTeb()->SpareBytes1;
diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c
index cfb9df1..07c8b0a 100644
index 1f6da96..a82eb91 100644
--- a/dlls/ntdll/signal_arm.c
+++ b/dlls/ntdll/signal_arm.c
@@ -902,12 +902,19 @@ NTSTATUS signal_alloc_thread( TEB **teb )
@@ -61,7 +61,7 @@ index cfb9df1..07c8b0a 100644
NtFreeVirtualMemory( NtCurrentProcess(), (void **)&teb, &size, MEM_RELEASE );
}
diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c
index 7259831..09bdfe0 100644
index 3a41c84..3ad412a 100644
--- a/dlls/ntdll/signal_arm64.c
+++ b/dlls/ntdll/signal_arm64.c
@@ -776,12 +776,19 @@ NTSTATUS signal_alloc_thread( TEB **teb )
@@ -85,10 +85,10 @@ index 7259831..09bdfe0 100644
NtFreeVirtualMemory( NtCurrentProcess(), (void **)&teb, &size, MEM_RELEASE );
}
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index f550c63..1007358 100644
index 5c3aa819..28d9e29 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -2616,12 +2616,18 @@ void signal_free_thread( TEB *teb )
@@ -2367,12 +2367,18 @@ void signal_free_thread( TEB *teb )
SIZE_T size;
struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1;
@@ -109,7 +109,7 @@ index f550c63..1007358 100644
NtFreeVirtualMemory( NtCurrentProcess(), (void **)&teb, &size, MEM_RELEASE );
}
diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c
index d2e7819..c673d6e 100644
index 886da86..90644a4 100644
--- a/dlls/ntdll/signal_powerpc.c
+++ b/dlls/ntdll/signal_powerpc.c
@@ -982,12 +982,19 @@ NTSTATUS signal_alloc_thread( TEB **teb )
@@ -133,7 +133,7 @@ index d2e7819..c673d6e 100644
NtFreeVirtualMemory( NtCurrentProcess(), (void **)&teb, &size, MEM_RELEASE );
}
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index a1ee02d..1db9f27 100644
index 575a770..2ced91e 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -2732,12 +2732,19 @@ NTSTATUS signal_alloc_thread( TEB **teb )
@@ -157,19 +157,19 @@ index a1ee02d..1db9f27 100644
NtFreeVirtualMemory( NtCurrentProcess(), (void **)&teb, &size, MEM_RELEASE );
}
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 9d35693..b40674b 100644
index 020a6c0..98de9e6 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1486,6 +1486,8 @@ NTSTATUS virtual_alloc_thread_stack( TEB *teb, SIZE_T reserve_size, SIZE_T commi
@@ -1469,6 +1469,8 @@ NTSTATUS virtual_alloc_thread_stack( TEB *teb, SIZE_T reserve_size, SIZE_T commi
teb->DeallocationStack = view->base;
teb->Tib.StackBase = (char *)view->base + view->size;
teb->Tib.StackLimit = (char *)view->base + 2 * page_size;
+ ((struct ntdll_thread_data *)teb->SpareBytes1)->pthread_stack = view->base;
+
done:
server_leave_uninterrupted_section( &csVirtual, &sigset );
virtual_unlock();
return status;
@@ -2119,6 +2121,16 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
@@ -2060,6 +2062,16 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
/* Free the pages */
if (size || (base != view->base)) status = STATUS_INVALID_PARAMETER;
@@ -187,5 +187,5 @@ index 9d35693..b40674b 100644
{
delete_view( view );
--
2.5.0
2.5.1

View File

@@ -1 +1,2 @@
Fixes: Do not allow to deallocate thread stack for current thread
Depends: ntdll-Virtual_Memory_Stack

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

View File

@@ -0,0 +1,83 @@
From 4facab424747869e5e6d99a95c8b984e0bf1f6af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 26 Sep 2015 22:59:51 +0200
Subject: ntdll: Save stack in NtAllocateVirtualMemory by moving remote memory
allocation into separate function.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Michael Müller <michael@fds-team.de>
---
dlls/ntdll/virtual.c | 48 ++++++++++++++++++++++++++----------------------
1 file changed, 26 insertions(+), 22 deletions(-)
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 67857c6..020a6c0 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1862,6 +1862,31 @@ void virtual_set_large_address_space(void)
user_space_limit = working_set_limit = address_space_limit;
}
+static NTSTATUS allocate_memory_remote( HANDLE process, PVOID *ret, ULONG zero_bits,
+ SIZE_T *size_ptr, ULONG type, ULONG protect )
+{
+ NTSTATUS status;
+ apc_call_t call;
+ apc_result_t result;
+
+ memset( &call, 0, sizeof(call) );
+
+ call.virtual_alloc.type = APC_VIRTUAL_ALLOC;
+ call.virtual_alloc.addr = wine_server_client_ptr( *ret );
+ call.virtual_alloc.size = *size_ptr;
+ call.virtual_alloc.zero_bits = zero_bits;
+ call.virtual_alloc.op_type = type;
+ call.virtual_alloc.prot = protect;
+ status = server_queue_process_apc( process, &call, &result );
+ if (status != STATUS_SUCCESS) return status;
+
+ if (result.virtual_alloc.status == STATUS_SUCCESS)
+ {
+ *ret = wine_server_get_ptr( result.virtual_alloc.addr );
+ *size_ptr = result.virtual_alloc.size;
+ }
+ return result.virtual_alloc.status;
+}
/***********************************************************************
* NtAllocateVirtualMemory (NTDLL.@)
@@ -1882,28 +1907,7 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_
if (!size) return STATUS_INVALID_PARAMETER;
if (process != NtCurrentProcess())
- {
- apc_call_t call;
- apc_result_t result;
-
- memset( &call, 0, sizeof(call) );
-
- call.virtual_alloc.type = APC_VIRTUAL_ALLOC;
- call.virtual_alloc.addr = wine_server_client_ptr( *ret );
- call.virtual_alloc.size = *size_ptr;
- call.virtual_alloc.zero_bits = zero_bits;
- call.virtual_alloc.op_type = type;
- call.virtual_alloc.prot = protect;
- status = server_queue_process_apc( process, &call, &result );
- if (status != STATUS_SUCCESS) return status;
-
- if (result.virtual_alloc.status == STATUS_SUCCESS)
- {
- *ret = wine_server_get_ptr( result.virtual_alloc.addr );
- *size_ptr = result.virtual_alloc.size;
- }
- return result.virtual_alloc.status;
- }
+ return allocate_memory_remote( process, ret, zero_bits, size_ptr, type, protect );
/* Round parameters to a page boundary */
--
2.5.1

View File

@@ -0,0 +1 @@
Fixes: [34558] Reduce stack usage of virtual memory functions

View File

@@ -207,6 +207,7 @@ patch_enable_all ()
enable_ntdll_ThreadTime="$1"
enable_ntdll_Threading="$1"
enable_ntdll_User_Shared_Data="$1"
enable_ntdll_Virtual_Memory_Stack="$1"
enable_ntdll_WRITECOPY="$1"
enable_ntdll_WinSqm="$1"
enable_ntdll_WriteWatches="$1"
@@ -715,6 +716,9 @@ patch_enable ()
ntdll-User_Shared_Data)
enable_ntdll_User_Shared_Data="$2"
;;
ntdll-Virtual_Memory_Stack)
enable_ntdll_Virtual_Memory_Stack="$2"
;;
ntdll-WRITECOPY)
enable_ntdll_WRITECOPY="$2"
;;
@@ -1893,6 +1897,13 @@ if test "$enable_ntdll_NtQueryEaFile" -eq 1; then
enable_ntdll_Empty_Path=1
fi
if test "$enable_ntdll_Fix_Alignment" -eq 1; then
if test "$enable_ntdll_Virtual_Memory_Stack" -gt 1; then
abort "Patchset ntdll-Virtual_Memory_Stack disabled, but ntdll-Fix_Alignment depends on that."
fi
enable_ntdll_Virtual_Memory_Stack=1
fi
if test "$enable_ntdll_DllRedirects" -eq 1; then
if test "$enable_ntdll_Loader_Machine_Type" -gt 1; then
abort "Patchset ntdll-Loader_Machine_Type disabled, but ntdll-DllRedirects depends on that."
@@ -1900,6 +1911,13 @@ if test "$enable_ntdll_DllRedirects" -eq 1; then
enable_ntdll_Loader_Machine_Type=1
fi
if test "$enable_ntdll_Dealloc_Thread_Stack" -eq 1; then
if test "$enable_ntdll_Virtual_Memory_Stack" -gt 1; then
abort "Patchset ntdll-Virtual_Memory_Stack disabled, but ntdll-Dealloc_Thread_Stack depends on that."
fi
enable_ntdll_Virtual_Memory_Stack=1
fi
if test "$enable_ntdll_CLI_Images" -eq 1; then
if test "$enable_mscoree_CorValidateImage" -gt 1; then
abort "Patchset mscoree-CorValidateImage disabled, but ntdll-CLI_Images depends on that."
@@ -2010,6 +2028,13 @@ if test "$enable_ntdll_WRITECOPY" -eq 1; then
enable_ws2_32_WriteWatches=1
fi
if test "$enable_ws2_32_WriteWatches" -eq 1; then
if test "$enable_ntdll_Virtual_Memory_Stack" -gt 1; then
abort "Patchset ntdll-Virtual_Memory_Stack disabled, but ws2_32-WriteWatches depends on that."
fi
enable_ntdll_Virtual_Memory_Stack=1
fi
# If autoupdate is enabled then create a tempfile to keep track of all patches
if test "$enable_patchlist" -eq 1; then
@@ -2038,8 +2063,28 @@ if test "$enable_Compiler_Warnings" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-Virtual_Memory_Stack
# |
# | This patchset fixes the following Wine bugs:
# | * [#34558] Reduce stack usage of virtual memory functions
# |
# | Modified files:
# | * dlls/ntdll/virtual.c
# |
if test "$enable_ntdll_Virtual_Memory_Stack" -eq 1; then
patch_apply ntdll-Virtual_Memory_Stack/0001-ntdll-Reduce-stack-usage-by-storing-sigset-in-static.patch
patch_apply ntdll-Virtual_Memory_Stack/0002-ntdll-Save-stack-in-NtAllocateVirtualMemory-by-movin.patch
(
echo '+ { "Michael Müller", "ntdll: Reduce stack usage by storing sigset in static memory.", 1 },';
echo '+ { "Michael Müller", "ntdll: Save stack in NtAllocateVirtualMemory by moving remote memory allocation into separate function.", 1 },';
) >> "$patchlist"
fi
# Patchset ws2_32-WriteWatches
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * ntdll-Virtual_Memory_Stack
# |
# | Modified files:
# | * dlls/ntdll/ntdll.spec, dlls/ntdll/ntdll_misc.h, dlls/ntdll/signal_i386.c, dlls/ntdll/virtual.c, dlls/ws2_32/socket.c,
# | include/winternl.h
@@ -2056,7 +2101,7 @@ fi
# Patchset ntdll-WRITECOPY
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * ws2_32-WriteWatches
# | * ntdll-Virtual_Memory_Stack, ws2_32-WriteWatches
# |
# | This patchset fixes the following Wine bugs:
# | * [#29384] Voobly expects correct handling of WRITECOPY memory protection
@@ -2085,7 +2130,7 @@ fi
# Patchset Exagear
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * ws2_32-WriteWatches, ntdll-WRITECOPY
# | * ntdll-Virtual_Memory_Stack, ws2_32-WriteWatches, ntdll-WRITECOPY
# |
# | Modified files:
# | * configure.ac, dlls/ntdll/signal_i386.c, dlls/ntdll/virtual.c, server/ptrace.c
@@ -3878,6 +3923,9 @@ fi
# Patchset ntdll-Dealloc_Thread_Stack
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * ntdll-Virtual_Memory_Stack
# |
# | Modified files:
# | * dlls/ntdll/ntdll_misc.h, dlls/ntdll/signal_arm.c, dlls/ntdll/signal_arm64.c, dlls/ntdll/signal_i386.c,
# | dlls/ntdll/signal_powerpc.c, dlls/ntdll/signal_x86_64.c, dlls/ntdll/virtual.c
@@ -4000,6 +4048,9 @@ fi
# Patchset ntdll-Fix_Alignment
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * ntdll-Virtual_Memory_Stack
# |
# | This patchset fixes the following Wine bugs:
# | * [#33162] Ensure NtProtectVirtualMemory and NtCreateSection are on separate pages
# |
@@ -4277,7 +4328,7 @@ fi
# Patchset ntdll-WriteWatches
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * rpcrt4-Pipe_Transport, kernel32-Named_Pipe, ws2_32-WriteWatches
# | * rpcrt4-Pipe_Transport, kernel32-Named_Pipe, ntdll-Virtual_Memory_Stack, ws2_32-WriteWatches
# |
# | Modified files:
# | * dlls/ntdll/file.c

View File

@@ -1,4 +1,4 @@
From bbcb2837fc29e7823c89f408611dfc6c8700d058 Mon Sep 17 00:00:00 2001
From b7a6d8f0acb9dca71c277ded977d6cf60240dbba Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 18 Mar 2015 23:03:01 +0100
Subject: ntdll: Implement virtual_map_shared_memory.
@@ -6,11 +6,11 @@ Subject: ntdll: Implement virtual_map_shared_memory.
Preparation for shared memory wineserver communication.
---
dlls/ntdll/ntdll_misc.h | 1 +
dlls/ntdll/virtual.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 53 insertions(+)
dlls/ntdll/virtual.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+)
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 674fcbc..41ef5cb 100644
index cbd19db..7eded42 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -166,6 +166,7 @@ extern NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_S
@@ -22,10 +22,10 @@ index 674fcbc..41ef5cb 100644
extern BOOL virtual_handle_stack_fault( void *addr ) DECLSPEC_HIDDEN;
extern BOOL virtual_is_valid_code_address( const void *addr, SIZE_T size ) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 9d29c33..bfe7266 100644
index 91db4d6..8027556 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -2758,6 +2758,58 @@ done:
@@ -2734,6 +2734,57 @@ done:
/***********************************************************************
@@ -37,7 +37,6 @@ index 9d29c33..bfe7266 100644
+ SIZE_T size, mask = get_mask( zero_bits );
+ struct file_view *view;
+ unsigned int vprot;
+ sigset_t sigset;
+ NTSTATUS res;
+ int prot;
+
@@ -45,7 +44,7 @@ index 9d29c33..bfe7266 100644
+ if (size < *size_ptr)
+ return STATUS_INVALID_PARAMETER;
+
+ server_enter_uninterrupted_section( &csVirtual, &sigset );
+ virtual_lock();
+
+ get_vprot_flags( protect, &vprot, FALSE );
+ vprot |= VPROT_COMMITTED;
@@ -75,7 +74,7 @@ index 9d29c33..bfe7266 100644
+ }
+ }
+
+ server_leave_uninterrupted_section( &csVirtual, &sigset );
+ virtual_unlock();
+ return res;
+}
+
@@ -85,5 +84,5 @@ index 9d29c33..bfe7266 100644
* ZwUnmapViewOfSection (NTDLL.@)
*/
--
2.3.2
2.5.1

View File

@@ -1,4 +1,4 @@
From c81fa97c5fc573dd3bc40dcee861ad7c70abc4d9 Mon Sep 17 00:00:00 2001
From e09548baea24d9965e2beafc251bb69443424b25 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 3 Jan 2015 20:07:08 +0100
Subject: ntdll: Expose wine_uninterrupted_[read|write]_memory as exports.
@@ -12,10 +12,10 @@ Subject: ntdll: Expose wine_uninterrupted_[read|write]_memory as exports.
5 files changed, 34 insertions(+), 19 deletions(-)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 9355d04..c13a555 100644
index ca3561d..52e7276 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -1430,6 +1430,10 @@
@@ -1463,6 +1463,10 @@
# signal handling
@ cdecl __wine_set_signal_handler(long ptr)
@@ -27,7 +27,7 @@ index 9355d04..c13a555 100644
@ cdecl wine_nt_to_unix_file_name(ptr ptr long long)
@ cdecl wine_unix_to_nt_file_name(ptr ptr)
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 674fcbc..79eea52 100644
index cbd19db..f5b5339 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -172,8 +172,6 @@ extern BOOL virtual_is_valid_code_address( const void *addr, SIZE_T size ) DECLS
@@ -75,10 +75,10 @@ index 5c3aa819..cf20483 100644
{
context->Ecx = stack[0];
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index e5bf705..4392c3e 100644
index 020a6c0..eb8893b 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1672,13 +1672,14 @@ BOOL virtual_check_buffer_for_write( void *ptr, SIZE_T size )
@@ -1642,13 +1642,14 @@ BOOL virtual_check_buffer_for_write( void *ptr, SIZE_T size )
/***********************************************************************
@@ -95,8 +95,8 @@ index e5bf705..4392c3e 100644
+SIZE_T CDECL wine_uninterrupted_read_memory( const void *addr, void *buffer, SIZE_T size )
{
struct file_view *view;
sigset_t sigset;
@@ -1697,10 +1698,14 @@ SIZE_T virtual_uninterrupted_read_memory( const void *addr, void *buffer, SIZE_T
SIZE_T bytes_read = 0;
@@ -1666,10 +1667,14 @@ SIZE_T virtual_uninterrupted_read_memory( const void *addr, void *buffer, SIZE_T
while (bytes_read < size && (VIRTUAL_GetUnixProt( *p++ ) & PROT_READ))
{
SIZE_T block_size = min( size, page_size - ((UINT_PTR)addr & page_mask) );
@@ -114,7 +114,7 @@ index e5bf705..4392c3e 100644
bytes_read += block_size;
}
}
@@ -1711,13 +1716,14 @@ SIZE_T virtual_uninterrupted_read_memory( const void *addr, void *buffer, SIZE_T
@@ -1680,13 +1685,14 @@ SIZE_T virtual_uninterrupted_read_memory( const void *addr, void *buffer, SIZE_T
/***********************************************************************
@@ -131,8 +131,8 @@ index e5bf705..4392c3e 100644
+SIZE_T CDECL wine_uninterrupted_write_memory( void *addr, const void *buffer, SIZE_T size )
{
struct file_view *view;
sigset_t sigset;
@@ -1756,10 +1762,14 @@ SIZE_T virtual_uninterrupted_write_memory( void *addr, const void *buffer, SIZE_
SIZE_T bytes_written = 0;
@@ -1723,10 +1729,14 @@ SIZE_T virtual_uninterrupted_write_memory( void *addr, const void *buffer, SIZE_
}
block_size = min( size, page_size - ((UINT_PTR)addr & page_mask) );
@@ -151,10 +151,10 @@ index e5bf705..4392c3e 100644
}
}
diff --git a/include/winternl.h b/include/winternl.h
index 1a694da..02dda9a 100644
index 2b10f8d..bd7ba4e 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2605,6 +2605,9 @@ NTSYSAPI NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW,
@@ -2660,6 +2660,9 @@ NTSYSAPI NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW,
UINT disposition, BOOLEAN check_case );
NTSYSAPI NTSTATUS CDECL wine_unix_to_nt_file_name( const ANSI_STRING *name, UNICODE_STRING *nt );
@@ -165,5 +165,5 @@ index 1a694da..02dda9a 100644
/***********************************************************************
* Inline functions
--
2.3.0
2.5.1

View File

@@ -1,4 +1,5 @@
Fixes: Avoid race-conditions of async WSARecv() operations with write watches.
Fixes: Avoid race-conditions with write watches in WS2_async_accept.
Fixes: Basic handling of write watches triggered while we're on the signal stack.
Depends: ntdll-Virtual_Memory_Stack
Category: stable