From 3d15623eafc08b292911fd3f5f1ffd3dad01c62e Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 22 Nov 2022 10:32:11 +1100 Subject: [PATCH] Rebase against ae73e09a8d071eaa33fafe785e8295384b9e64a7. --- ...4-ntdll-Implement-NtReleaseSemaphore.patch | 10 +++---- .../0008-ntdll-Implement-NtSetEvent.patch | 14 +++++----- .../0009-ntdll-Implement-NtResetEvent.patch | 19 ++++++------- ...0024-ntdll-Implement-NtReleaseMutant.patch | 14 +++++----- ...0029-ntdll-Implement-NtOpenSemaphore.patch | 24 ++++++++--------- .../0052-ntdll-Implement-NtPulseEvent.patch | 14 +++++----- ...-CS-functions-for-threadpool-locking.patch | 12 ++++----- ...M_RESERVE_PLACEHOLDER-in-NtAllocateV.patch | 27 ++++++++++--------- ...M_REPLACE_PLACEHOLDER-in-NtAllocateV.patch | 20 +++++++------- ...M_REPLACE_PLACEHOLDER-in-virtual_map.patch | 8 +++--- ...M_COALESCE_PLACEHOLDERS-in-NtFreeVir.patch | 8 +++--- ...r-out-unmap_view_of_section-function.patch | 14 +++++----- ...M_PRESERVE_PLACEHOLDER-in-NtUnmapVie.patch | 26 +++++++++--------- ...Wine-frames-during-exception-process.patch | 20 +++++++------- patches/patchinstall.sh | 2 +- ...networking.connectivity-Add-stub-dll.patch | 12 ++++----- staging/upstream-commit | 2 +- 17 files changed, 124 insertions(+), 122 deletions(-) diff --git a/patches/eventfd_synchronization/0004-ntdll-Implement-NtReleaseSemaphore.patch b/patches/eventfd_synchronization/0004-ntdll-Implement-NtReleaseSemaphore.patch index 4cdea40b..85d1e90b 100644 --- a/patches/eventfd_synchronization/0004-ntdll-Implement-NtReleaseSemaphore.patch +++ b/patches/eventfd_synchronization/0004-ntdll-Implement-NtReleaseSemaphore.patch @@ -1,4 +1,4 @@ -From 4c255f91363e09892de43bf5f3b991ef5ccce3b2 Mon Sep 17 00:00:00 2001 +From 06faa163af3dd5fa6e4794bf244c662533a88b69 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 12:16:34 -0500 Subject: [PATCH] ntdll: Implement NtReleaseSemaphore(). @@ -90,12 +90,12 @@ index a50a755149a..09838e95535 100644 /* We have to synchronize on the fd cache mutex so that our calls to receive_fd diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c -index 72cbf92f93c..db992f3a9ad 100644 +index fff4970549b..fbd28292524 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c -@@ -348,6 +348,9 @@ NTSTATUS WINAPI NtReleaseSemaphore( HANDLE handle, ULONG count, ULONG *previous +@@ -359,6 +359,9 @@ NTSTATUS WINAPI NtReleaseSemaphore( HANDLE handle, ULONG count, ULONG *previous { - NTSTATUS ret; + unsigned int ret; + if (do_esync()) + return esync_release_semaphore( handle, count, previous ); @@ -104,5 +104,5 @@ index 72cbf92f93c..db992f3a9ad 100644 { req->handle = wine_server_obj_handle( handle ); -- -2.33.0 +2.38.1 diff --git a/patches/eventfd_synchronization/0008-ntdll-Implement-NtSetEvent.patch b/patches/eventfd_synchronization/0008-ntdll-Implement-NtSetEvent.patch index 285449af..ca4f2e1e 100644 --- a/patches/eventfd_synchronization/0008-ntdll-Implement-NtSetEvent.patch +++ b/patches/eventfd_synchronization/0008-ntdll-Implement-NtSetEvent.patch @@ -1,4 +1,4 @@ -From bb4f401e45ff4017600e8037ceb69456c2c0171d Mon Sep 17 00:00:00 2001 +From ff044319027197bb9a1f20a19f01d8c299835818 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 14:46:24 -0500 Subject: [PATCH] ntdll: Implement NtSetEvent(). @@ -10,10 +10,10 @@ Subject: [PATCH] ntdll: Implement NtSetEvent(). 3 files changed, 20 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c -index e440e9baa4a..b8fb27edf38 100644 +index 059d7fd9ca6..410cfd3c2ce 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c -@@ -316,6 +316,21 @@ NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, +@@ -314,6 +314,21 @@ NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, return create_esync( type, handle, access, attr, initial, 0 ); } @@ -48,15 +48,15 @@ index d9c7df967f8..b585af047ee 100644 extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c -index f3ced2d63b6..686255d4d99 100644 +index 7be736927b2..8e793941711 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c -@@ -429,8 +429,12 @@ NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT +@@ -440,8 +440,12 @@ NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT */ NTSTATUS WINAPI NtSetEvent( HANDLE handle, LONG *prev_state ) { + /* This comment is a dummy to make sure this patch applies in the right place. */ - NTSTATUS ret; + unsigned int ret; + if (do_esync()) + return esync_set_event( handle ); @@ -65,5 +65,5 @@ index f3ced2d63b6..686255d4d99 100644 { req->handle = wine_server_obj_handle( handle ); -- -2.29.2 +2.38.1 diff --git a/patches/eventfd_synchronization/0009-ntdll-Implement-NtResetEvent.patch b/patches/eventfd_synchronization/0009-ntdll-Implement-NtResetEvent.patch index 2ed5e7d3..e589f760 100644 --- a/patches/eventfd_synchronization/0009-ntdll-Implement-NtResetEvent.patch +++ b/patches/eventfd_synchronization/0009-ntdll-Implement-NtResetEvent.patch @@ -1,4 +1,4 @@ -From 68e3e5a72ce9776371df909163ac40cb2a2aa887 Mon Sep 17 00:00:00 2001 +From c1c004fcfb9d38086fd682e64aca7fd6aaad4cc9 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 14:51:21 -0500 Subject: [PATCH] ntdll: Implement NtResetEvent(). @@ -6,14 +6,14 @@ Subject: [PATCH] ntdll: Implement NtResetEvent(). --- dlls/ntdll/unix/esync.c | 15 +++++++++++++++ dlls/ntdll/unix/esync.h | 1 + - dlls/ntdll/unix/sync.c | 4 ++++ - 3 files changed, 20 insertions(+) + dlls/ntdll/unix/sync.c | 5 +++++ + 3 files changed, 21 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c -index b8fb27edf38..97d468b2449 100644 +index 410cfd3c2ce..80eb3773ee4 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c -@@ -331,6 +331,21 @@ NTSTATUS esync_set_event( HANDLE handle ) +@@ -329,6 +329,21 @@ NTSTATUS esync_set_event( HANDLE handle ) return STATUS_SUCCESS; } @@ -48,22 +48,23 @@ index b585af047ee..8480a213b2a 100644 extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c -index bb36254acdc..b0f53d4677b 100644 +index 8e793941711..f57a825872b 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c -@@ -507,8 +507,12 @@ NTSTATUS WINAPI NtSetEvent( HANDLE handle, LONG *prev_state ) +@@ -463,8 +463,13 @@ NTSTATUS WINAPI NtSetEvent( HANDLE handle, LONG *prev_state ) */ NTSTATUS WINAPI NtResetEvent( HANDLE handle, LONG *prev_state ) { + /* This comment is a dummy to make sure this patch applies in the right place. */ - NTSTATUS ret; + unsigned int ret; + if (do_esync()) + return esync_reset_event( handle ); ++ + SERVER_START_REQ( event_op ) { req->handle = wine_server_obj_handle( handle ); -- -2.29.2 +2.38.1 diff --git a/patches/eventfd_synchronization/0024-ntdll-Implement-NtReleaseMutant.patch b/patches/eventfd_synchronization/0024-ntdll-Implement-NtReleaseMutant.patch index ca8319d5..e09adcab 100644 --- a/patches/eventfd_synchronization/0024-ntdll-Implement-NtReleaseMutant.patch +++ b/patches/eventfd_synchronization/0024-ntdll-Implement-NtReleaseMutant.patch @@ -1,4 +1,4 @@ -From 5b4a4557f47415d9a78185a3be8b0a9d7d6bdc33 Mon Sep 17 00:00:00 2001 +From 24a1dd64bee6e9140d6f05241c03f572bb464436 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:37:49 -0500 Subject: [PATCH] ntdll: Implement NtReleaseMutant(). @@ -10,10 +10,10 @@ Subject: [PATCH] ntdll: Implement NtReleaseMutant(). 3 files changed, 38 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c -index df9eb2696a1..48482a31ea2 100644 +index 350b1ffb756..ded71e631f7 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c -@@ -431,6 +431,40 @@ NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access, +@@ -424,6 +424,40 @@ NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access, return create_esync( ESYNC_MUTEX, handle, access, attr, initial ? 0 : 1, 0 ); } @@ -67,12 +67,12 @@ index 38ebefc9eed..e69c46ca462 100644 extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, BOOLEAN alertable, const LARGE_INTEGER *timeout ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c -index 56292db271a..1a19bb78a9c 100644 +index 2640320587e..620d013751f 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c -@@ -648,6 +648,9 @@ NTSTATUS WINAPI NtReleaseMutant( HANDLE handle, LONG *prev_count ) +@@ -609,6 +609,9 @@ NTSTATUS WINAPI NtReleaseMutant( HANDLE handle, LONG *prev_count ) { - NTSTATUS ret; + unsigned int ret; + if (do_esync()) + return esync_release_mutex( handle, prev_count ); @@ -81,5 +81,5 @@ index 56292db271a..1a19bb78a9c 100644 { req->handle = wine_server_obj_handle( handle ); -- -2.28.0 +2.38.1 diff --git a/patches/eventfd_synchronization/0029-ntdll-Implement-NtOpenSemaphore.patch b/patches/eventfd_synchronization/0029-ntdll-Implement-NtOpenSemaphore.patch index 161aa39d..c605ab5c 100644 --- a/patches/eventfd_synchronization/0029-ntdll-Implement-NtOpenSemaphore.patch +++ b/patches/eventfd_synchronization/0029-ntdll-Implement-NtOpenSemaphore.patch @@ -1,4 +1,4 @@ -From 7f04be3dd881287f1a74b7fe5829fa5917afa054 Mon Sep 17 00:00:00 2001 +From fd251549dc6a59073937ba74b195f9dc7a892616 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:56:09 -0500 Subject: [PATCH] ntdll: Implement NtOpenSemaphore(). @@ -12,10 +12,10 @@ Subject: [PATCH] ntdll: Implement NtOpenSemaphore(). 5 files changed, 96 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c -index 6d8653cd107..8e7e50ce777 100644 +index cdf5f602695..583afebb17c 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c -@@ -336,6 +336,45 @@ static NTSTATUS create_esync( enum esync_type type, HANDLE *handle, ACCESS_MASK +@@ -329,6 +329,45 @@ static NTSTATUS create_esync( enum esync_type type, HANDLE *handle, ACCESS_MASK return ret; } @@ -61,7 +61,7 @@ index 6d8653cd107..8e7e50ce777 100644 extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max) { -@@ -345,6 +384,14 @@ extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, +@@ -338,6 +377,14 @@ extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access, return create_esync( ESYNC_SEMAPHORE, handle, access, attr, initial, max ); } @@ -90,11 +90,11 @@ index bee08ff857f..2738e8b7f87 100644 extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c -index a51462abeac..36322f6afb6 100644 +index ce3061a7f31..dd8ed16f868 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c -@@ -353,6 +353,10 @@ NTSTATUS WINAPI NtOpenSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJEC - NTSTATUS ret; +@@ -301,6 +301,10 @@ NTSTATUS WINAPI NtOpenSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJEC + unsigned int ret; *handle = 0; + @@ -105,10 +105,10 @@ index a51462abeac..36322f6afb6 100644 SERVER_START_REQ( open_semaphore ) diff --git a/server/esync.c b/server/esync.c -index 913104e3dd4..da97c6c140b 100644 +index 3f1c61bc1f0..eca9b6aa67d 100644 --- a/server/esync.c +++ b/server/esync.c -@@ -412,6 +412,37 @@ DECL_HANDLER(create_esync) +@@ -410,6 +410,37 @@ DECL_HANDLER(create_esync) if (root) release_object( root ); } @@ -147,10 +147,10 @@ index 913104e3dd4..da97c6c140b 100644 * server. The client should only read from (i.e. wait on) this object. */ DECL_HANDLER(get_esync_fd) diff --git a/server/protocol.def b/server/protocol.def -index 776d3d72dc2..575cf291bb0 100644 +index 40bdd8a70b4..acd90615cf7 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -3750,6 +3750,18 @@ enum esync_type +@@ -3812,6 +3812,18 @@ enum esync_type unsigned int shm_idx; @END @@ -170,5 +170,5 @@ index 776d3d72dc2..575cf291bb0 100644 @REQ(get_esync_fd) obj_handle_t handle; /* handle to the object */ -- -2.30.2 +2.38.1 diff --git a/patches/eventfd_synchronization/0052-ntdll-Implement-NtPulseEvent.patch b/patches/eventfd_synchronization/0052-ntdll-Implement-NtPulseEvent.patch index dd6b7ce3..1374958c 100644 --- a/patches/eventfd_synchronization/0052-ntdll-Implement-NtPulseEvent.patch +++ b/patches/eventfd_synchronization/0052-ntdll-Implement-NtPulseEvent.patch @@ -1,4 +1,4 @@ -From bb81fa475b3aa206fe1e8ff914d41de292aa9807 Mon Sep 17 00:00:00 2001 +From 1d7cb4fe562903aa56abe64c97d0d84357b67f49 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 17:56:40 -0500 Subject: [PATCH] ntdll: Implement NtPulseEvent(). @@ -10,10 +10,10 @@ Subject: [PATCH] ntdll: Implement NtPulseEvent(). 3 files changed, 29 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c -index 91a85253a83..d7511f39601 100644 +index ff0210f3cd4..3a47b5aa39e 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c -@@ -607,6 +607,31 @@ NTSTATUS esync_reset_event( HANDLE handle ) +@@ -600,6 +600,31 @@ NTSTATUS esync_reset_event( HANDLE handle ) return STATUS_SUCCESS; } @@ -58,12 +58,12 @@ index 18788fa273b..188304f3be7 100644 extern NTSTATUS esync_reset_event( HANDLE handle ) DECLSPEC_HIDDEN; extern NTSTATUS esync_set_event( HANDLE handle ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c -index acec96c0a3c..051c672bd12 100644 +index 4c745b3b72e..4025a7a3a2f 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c -@@ -549,6 +549,9 @@ NTSTATUS WINAPI NtPulseEvent( HANDLE handle, LONG *prev_state ) +@@ -509,6 +509,9 @@ NTSTATUS WINAPI NtPulseEvent( HANDLE handle, LONG *prev_state ) { - NTSTATUS ret; + unsigned int ret; + if (do_esync()) + return esync_pulse_event( handle ); @@ -72,5 +72,5 @@ index acec96c0a3c..051c672bd12 100644 { req->handle = wine_server_obj_handle( handle ); -- -2.28.0 +2.38.1 diff --git a/patches/ntdll-CriticalSection/0004-ntdll-Use-fast-CS-functions-for-threadpool-locking.patch b/patches/ntdll-CriticalSection/0004-ntdll-Use-fast-CS-functions-for-threadpool-locking.patch index ab3f70ca..951b9029 100644 --- a/patches/ntdll-CriticalSection/0004-ntdll-Use-fast-CS-functions-for-threadpool-locking.patch +++ b/patches/ntdll-CriticalSection/0004-ntdll-Use-fast-CS-functions-for-threadpool-locking.patch @@ -1,4 +1,4 @@ -From 27019592a4f4aa7134f605093b5d83fe3764dcf5 Mon Sep 17 00:00:00 2001 +From 6d5610f8950d0319dbec724ef4d1f0ed140a97ec Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 5 Aug 2017 03:39:37 +0200 Subject: [PATCH] ntdll: Use fast CS functions for threadpool locking. @@ -8,7 +8,7 @@ Subject: [PATCH] ntdll: Use fast CS functions for threadpool locking. 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c -index 421d1ade133..71771dd2987 100644 +index 99525f831e1..36d1351aedc 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -1063,7 +1063,7 @@ static void CALLBACK timerqueue_thread_proc( void *param ) @@ -326,7 +326,7 @@ index 421d1ade133..71771dd2987 100644 if (cancel_pending) @@ -2928,10 +2928,10 @@ VOID WINAPI TpSetPoolMaxThreads( TP_POOL *pool, DWORD maximum ) - TRACE( "%p %u\n", pool, maximum ); + TRACE( "%p %lu\n", pool, maximum ); - RtlEnterCriticalSection( &this->cs ); + enter_critical_section( &this->cs ); @@ -339,7 +339,7 @@ index 421d1ade133..71771dd2987 100644 /*********************************************************************** @@ -2944,7 +2944,7 @@ BOOL WINAPI TpSetPoolMinThreads( TP_POOL *pool, DWORD minimum ) - TRACE( "%p %u\n", pool, minimum ); + TRACE( "%p %lu\n", pool, minimum ); - RtlEnterCriticalSection( &this->cs ); + enter_critical_section( &this->cs ); @@ -357,7 +357,7 @@ index 421d1ade133..71771dd2987 100644 @@ -2975,7 +2975,7 @@ VOID WINAPI TpSetTimer( TP_TIMER *timer, LARGE_INTEGER *timeout, LONG period, LO - TRACE( "%p %p %u %u\n", timer, timeout, period, window_length ); + TRACE( "%p %p %lu %lu\n", timer, timeout, period, window_length ); - RtlEnterCriticalSection( &timerqueue.cs ); + enter_critical_section( &timerqueue.cs ); @@ -392,5 +392,5 @@ index 421d1ade133..71771dd2987 100644 /*********************************************************************** -- -2.37.2 +2.38.1 diff --git a/patches/ntdll-Placeholders/0011-ntdll-Support-MEM_RESERVE_PLACEHOLDER-in-NtAllocateV.patch b/patches/ntdll-Placeholders/0011-ntdll-Support-MEM_RESERVE_PLACEHOLDER-in-NtAllocateV.patch index 6cd17a73..1df890e6 100644 --- a/patches/ntdll-Placeholders/0011-ntdll-Support-MEM_RESERVE_PLACEHOLDER-in-NtAllocateV.patch +++ b/patches/ntdll-Placeholders/0011-ntdll-Support-MEM_RESERVE_PLACEHOLDER-in-NtAllocateV.patch @@ -1,4 +1,4 @@ -From 3bf6197ee235a2686b026cd3f544919d06d31743 Mon Sep 17 00:00:00 2001 +From 94bf6ec892be0a018d4529456c47df34efdb99ce Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 10 Nov 2022 18:53:10 -0600 Subject: [PATCH] ntdll: Support MEM_RESERVE_PLACEHOLDER in @@ -6,14 +6,14 @@ Subject: [PATCH] ntdll: Support MEM_RESERVE_PLACEHOLDER in Based on a patch by Nikolay Sivov. --- - dlls/ntdll/unix/virtual.c | 25 +++++++++++++++++++++++-- - 1 file changed, 23 insertions(+), 2 deletions(-) + dlls/ntdll/unix/virtual.c | 26 ++++++++++++++++++++++++-- + 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index eb1d186e11c..27de38f8dfd 100644 +index 66256a4712f..5bea8ba8322 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -3922,13 +3922,17 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ +@@ -3918,13 +3918,18 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ /* Compute the alloc type flags */ @@ -21,7 +21,7 @@ index eb1d186e11c..27de38f8dfd 100644 - (type & ~(MEM_COMMIT | MEM_RESERVE | MEM_TOP_DOWN | MEM_WRITE_WATCH | MEM_RESET))) + if (!(type & (MEM_COMMIT | MEM_RESERVE | MEM_RESET))) { - WARN("called with wrong alloc type flags (%08x) !\n", type); + WARN("called with wrong alloc type flags (%08x) !\n", (int)type); return STATUS_INVALID_PARAMETER; } @@ -30,10 +30,11 @@ index eb1d186e11c..27de38f8dfd 100644 + WARN("Wrong protect %#x for placeholder.\n", protect); + return STATUS_INVALID_PARAMETER; + } ++ /* Reserve the memory */ server_enter_uninterrupted_section( &virtual_mutex, &sigset ); -@@ -3939,6 +3943,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ +@@ -3935,6 +3940,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; @@ -41,7 +42,7 @@ index eb1d186e11c..27de38f8dfd 100644 if (protect & PAGE_NOCACHE) vprot |= SEC_NOCACHE; if (vprot & VPROT_WRITECOPY) status = STATUS_INVALID_PAGE_PROTECTION; -@@ -3958,6 +3963,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ +@@ -3954,6 +3960,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; @@ -49,15 +50,15 @@ index eb1d186e11c..27de38f8dfd 100644 else if (!(status = set_protection( view, base, size, protect )) && (view->protect & SEC_RESERVE)) { SERVER_START_REQ( add_mapping_committed_range ) -@@ -3991,6 +3997,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ +@@ -3987,6 +3994,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 ) { + static const ULONG type_mask = MEM_COMMIT | MEM_RESERVE | MEM_TOP_DOWN | MEM_WRITE_WATCH | MEM_RESET; ULONG_PTR limit; - TRACE("%p %p %08lx %x %08x\n", process, *ret, *size_ptr, type, protect ); -@@ -4002,6 +4009,12 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG_PTR z + 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; #endif @@ -70,7 +71,7 @@ index eb1d186e11c..27de38f8dfd 100644 if (process != NtCurrentProcess()) { apc_call_t call; -@@ -4044,6 +4057,8 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s +@@ -4040,6 +4054,8 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s ULONG protect, MEM_EXTENDED_PARAMETER *parameters, ULONG count ) { @@ -79,7 +80,7 @@ index eb1d186e11c..27de38f8dfd 100644 ULONG_PTR limit = 0; ULONG_PTR align = 0; -@@ -4051,6 +4066,12 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s +@@ -4048,6 +4064,12 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s if (count && !parameters) return STATUS_INVALID_PARAMETER; diff --git a/patches/ntdll-Placeholders/0012-ntdll-Support-MEM_REPLACE_PLACEHOLDER-in-NtAllocateV.patch b/patches/ntdll-Placeholders/0012-ntdll-Support-MEM_REPLACE_PLACEHOLDER-in-NtAllocateV.patch index ea129dac..c42aa568 100644 --- a/patches/ntdll-Placeholders/0012-ntdll-Support-MEM_REPLACE_PLACEHOLDER-in-NtAllocateV.patch +++ b/patches/ntdll-Placeholders/0012-ntdll-Support-MEM_REPLACE_PLACEHOLDER-in-NtAllocateV.patch @@ -1,4 +1,4 @@ -From ef6b2b0ec45bbbb34dc8ced866c0e4c442157aa5 Mon Sep 17 00:00:00 2001 +From 15d43de746bf26b783e4b357fbc23dfa7247c78a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 10 Nov 2022 18:58:26 -0600 Subject: [PATCH] ntdll: Support MEM_REPLACE_PLACEHOLDER in @@ -9,10 +9,10 @@ Subject: [PATCH] ntdll: Support MEM_REPLACE_PLACEHOLDER in 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index 27de38f8dfd..3019c3699be 100644 +index 5bea8ba8322..4d8dd54554c 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -124,6 +124,7 @@ struct file_view +@@ -125,6 +125,7 @@ struct file_view /* per-mapping protection flags */ #define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */ #define VPROT_PLACEHOLDER 0x0400 @@ -20,7 +20,7 @@ index 27de38f8dfd..3019c3699be 100644 /* Conversion from VPROT_* to Win32 flags */ static const BYTE VIRTUAL_Win32Flags[16] = -@@ -2013,6 +2014,31 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, +@@ -2011,6 +2012,31 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, void *ptr; NTSTATUS status; @@ -52,7 +52,7 @@ index 27de38f8dfd..3019c3699be 100644 if (base) { if (is_beyond_limit( base, size, address_space_limit )) -@@ -3898,7 +3924,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ +@@ -3894,7 +3920,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ if (*ret) { @@ -61,7 +61,7 @@ index 27de38f8dfd..3019c3699be 100644 base = ROUND_ADDR( *ret, granularity_mask ); else base = ROUND_ADDR( *ret, page_mask ); -@@ -3922,7 +3948,8 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ +@@ -3918,7 +3944,8 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ /* Compute the alloc type flags */ @@ -69,9 +69,9 @@ index 27de38f8dfd..3019c3699be 100644 + if (!(type & (MEM_COMMIT | MEM_RESERVE | MEM_RESET)) + || (type & MEM_REPLACE_PLACEHOLDER && !(type & MEM_RESERVE))) { - WARN("called with wrong alloc type flags (%08x) !\n", type); + WARN("called with wrong alloc type flags (%08x) !\n", (int)type); return STATUS_INVALID_PARAMETER; -@@ -3948,7 +3975,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ +@@ -3945,7 +3972,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ if (vprot & VPROT_WRITECOPY) status = STATUS_INVALID_PAGE_PROTECTION; else if (is_dos_memory) status = allocate_dos_memory( &view, vprot ); @@ -80,7 +80,7 @@ index 27de38f8dfd..3019c3699be 100644 align ? align - 1 : granularity_mask ); if (status == STATUS_SUCCESS) base = view->base; -@@ -4058,7 +4085,7 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s +@@ -4055,7 +4082,7 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s ULONG count ) { static const ULONG type_mask = MEM_COMMIT | MEM_RESERVE | MEM_TOP_DOWN | MEM_WRITE_WATCH @@ -89,7 +89,7 @@ index 27de38f8dfd..3019c3699be 100644 ULONG_PTR limit = 0; ULONG_PTR align = 0; -@@ -4211,6 +4238,12 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si +@@ -4209,6 +4236,12 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si if (size && (char *)view->base + view->size - base < size) status = STATUS_UNABLE_TO_FREE_VM; else if (!size && base != view->base) status = STATUS_FREE_VM_NOT_AT_BASE; diff --git a/patches/ntdll-Placeholders/0013-ntdll-Support-MEM_REPLACE_PLACEHOLDER-in-virtual_map.patch b/patches/ntdll-Placeholders/0013-ntdll-Support-MEM_REPLACE_PLACEHOLDER-in-virtual_map.patch index e281d61a..1e5cf52b 100644 --- a/patches/ntdll-Placeholders/0013-ntdll-Support-MEM_REPLACE_PLACEHOLDER-in-virtual_map.patch +++ b/patches/ntdll-Placeholders/0013-ntdll-Support-MEM_REPLACE_PLACEHOLDER-in-virtual_map.patch @@ -1,4 +1,4 @@ -From e37d37263677edfded8696ff09bc76768582e24b Mon Sep 17 00:00:00 2001 +From f44017255bb3f5858d3393ed29ad6415ec307896 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 10 Nov 2022 19:01:50 -0600 Subject: [PATCH] ntdll: Support MEM_REPLACE_PLACEHOLDER in @@ -10,10 +10,10 @@ Based on a patch by Nikolay Sivov. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index 3019c3699be..d07e980f5a7 100644 +index 4d8dd54554c..60203bd4380 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -2721,7 +2721,8 @@ static NTSTATUS virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_PTR z +@@ -2719,7 +2719,8 @@ static unsigned int virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_P server_enter_uninterrupted_section( &virtual_mutex, &sigset ); @@ -22,7 +22,7 @@ index 3019c3699be..d07e980f5a7 100644 + vprot, get_zero_bits_mask( zero_bits ), 0 ); if (res) goto done; - TRACE( "handle=%p size=%lx offset=%x%08x\n", handle, size, offset.u.HighPart, offset.u.LowPart ); + TRACE( "handle=%p size=%lx offset=%s\n", handle, size, wine_dbgstr_longlong(offset.QuadPart) ); -- 2.38.1 diff --git a/patches/ntdll-Placeholders/0015-ntdll-Support-MEM_COALESCE_PLACEHOLDERS-in-NtFreeVir.patch b/patches/ntdll-Placeholders/0015-ntdll-Support-MEM_COALESCE_PLACEHOLDERS-in-NtFreeVir.patch index 15f9a7b9..3c62e0a3 100644 --- a/patches/ntdll-Placeholders/0015-ntdll-Support-MEM_COALESCE_PLACEHOLDERS-in-NtFreeVir.patch +++ b/patches/ntdll-Placeholders/0015-ntdll-Support-MEM_COALESCE_PLACEHOLDERS-in-NtFreeVir.patch @@ -1,4 +1,4 @@ -From af2c08ba11cf85941505fc8016d4d4811575be31 Mon Sep 17 00:00:00 2001 +From b7bd1f2c2c63573e47b07f178711586a1f37d765 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 10 Nov 2022 19:02:50 -0600 Subject: [PATCH] ntdll: Support MEM_COALESCE_PLACEHOLDERS in @@ -78,10 +78,10 @@ index b41f42ac9d1..11ccca2ffb4 100644 addr1 = NULL; size = 0x10000; diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index d07e980f5a7..ced198c0463 100644 +index 60203bd4380..226c99c5512 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -4341,6 +4341,30 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si +@@ -4339,6 +4339,30 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si *size_ptr = size; } } @@ -111,7 +111,7 @@ index d07e980f5a7..ced198c0463 100644 + } else { - WARN("called with wrong free type flags (%08x) !\n", type); + WARN("called with wrong free type flags (%08x) !\n", (int)type); -- 2.38.1 diff --git a/patches/ntdll-Placeholders/0016-ntdll-Factor-out-unmap_view_of_section-function.patch b/patches/ntdll-Placeholders/0016-ntdll-Factor-out-unmap_view_of_section-function.patch index 5d1debb2..f3b99968 100644 --- a/patches/ntdll-Placeholders/0016-ntdll-Factor-out-unmap_view_of_section-function.patch +++ b/patches/ntdll-Placeholders/0016-ntdll-Factor-out-unmap_view_of_section-function.patch @@ -1,4 +1,4 @@ -From d8506b129723188bee9daf779a19f3334459205d Mon Sep 17 00:00:00 2001 +From 3106c711fd02bdbdcac1361a389a651494d2f3b3 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 11 Nov 2022 12:41:31 -0600 Subject: [PATCH] ntdll: Factor out unmap_view_of_section() function. @@ -8,10 +8,10 @@ Subject: [PATCH] ntdll: Factor out unmap_view_of_section() function. 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index ced198c0463..219dfe8bb94 100644 +index 226c99c5512..d96facb6aa3 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -5012,11 +5012,7 @@ NTSTATUS WINAPI NtMapViewOfSectionEx( HANDLE handle, HANDLE process, PVOID *addr +@@ -5009,11 +5009,7 @@ NTSTATUS WINAPI NtMapViewOfSectionEx( HANDLE handle, HANDLE process, PVOID *addr return NtMapViewOfSection( handle, process, addr_ptr, 0, 0, offset_ptr, size_ptr, ViewShare, alloc_type, protect ); } @@ -23,8 +23,8 @@ index ced198c0463..219dfe8bb94 100644 +NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr ) { struct file_view *view; - NTSTATUS status = STATUS_NOT_MAPPED_VIEW; -@@ -5073,6 +5069,15 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr ) + unsigned int status = STATUS_NOT_MAPPED_VIEW; +@@ -5070,6 +5066,15 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr ) return status; } @@ -40,10 +40,10 @@ index ced198c0463..219dfe8bb94 100644 /*********************************************************************** * NtUnmapViewOfSectionEx (NTDLL.@) * ZwUnmapViewOfSectionEx (NTDLL.@) -@@ -5080,7 +5085,7 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr ) +@@ -5077,7 +5082,7 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr ) NTSTATUS WINAPI NtUnmapViewOfSectionEx( HANDLE process, PVOID addr, ULONG flags ) { - if (flags) FIXME("Ignoring flags %#x.\n", flags); + if (flags) FIXME("Ignoring flags %#x.\n", (int)flags); - return NtUnmapViewOfSection( process, addr ); + return unmap_view_of_section( process, addr ); } diff --git a/patches/ntdll-Placeholders/0017-ntdll-Support-MEM_PRESERVE_PLACEHOLDER-in-NtUnmapVie.patch b/patches/ntdll-Placeholders/0017-ntdll-Support-MEM_PRESERVE_PLACEHOLDER-in-NtUnmapVie.patch index 39c730c0..01955f04 100644 --- a/patches/ntdll-Placeholders/0017-ntdll-Support-MEM_PRESERVE_PLACEHOLDER-in-NtUnmapVie.patch +++ b/patches/ntdll-Placeholders/0017-ntdll-Support-MEM_PRESERVE_PLACEHOLDER-in-NtUnmapVie.patch @@ -1,4 +1,4 @@ -From 34f2b170598cff223c936c8150ff551955e2b888 Mon Sep 17 00:00:00 2001 +From cd27d91f8c74141651568af082c29c09ec6ade52 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 11 Nov 2022 12:54:19 -0600 Subject: [PATCH] ntdll: Support MEM_PRESERVE_PLACEHOLDER in @@ -114,10 +114,10 @@ index 0d75c6e2dda..5221a102863 100644 hmod = GetModuleHandleA("ntdll.dll"); diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c -index 630abe74c80..cba874ee6a8 100644 +index f23a3d383f6..77eb2c0aaeb 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c -@@ -572,7 +572,7 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO +@@ -553,7 +553,7 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO result->type = call->type; addr = wine_server_get_ptr( call->unmap_view.addr ); if ((ULONG_PTR)addr == call->unmap_view.addr) @@ -127,10 +127,10 @@ index 630abe74c80..cba874ee6a8 100644 result->unmap_view.status = STATUS_INVALID_PARAMETER; break; diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index 219dfe8bb94..84a4e331ad7 100644 +index d96facb6aa3..881f7fd8f59 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -5012,7 +5012,7 @@ NTSTATUS WINAPI NtMapViewOfSectionEx( HANDLE handle, HANDLE process, PVOID *addr +@@ -5009,7 +5009,7 @@ NTSTATUS WINAPI NtMapViewOfSectionEx( HANDLE handle, HANDLE process, PVOID *addr return NtMapViewOfSection( handle, process, addr_ptr, 0, 0, offset_ptr, size_ptr, ViewShare, alloc_type, protect ); } @@ -138,8 +138,8 @@ index 219dfe8bb94..84a4e331ad7 100644 +static NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr, ULONG flags ) { struct file_view *view; - NTSTATUS status = STATUS_NOT_MAPPED_VIEW; -@@ -5027,6 +5027,7 @@ NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr ) + unsigned int status = STATUS_NOT_MAPPED_VIEW; +@@ -5024,6 +5024,7 @@ NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr ) call.unmap_view.type = APC_UNMAP_VIEW; call.unmap_view.addr = wine_server_client_ptr( addr ); @@ -147,7 +147,7 @@ index 219dfe8bb94..84a4e331ad7 100644 status = server_queue_process_apc( process, &call, &result ); if (status == STATUS_SUCCESS) status = result.unmap_view.status; return status; -@@ -5035,6 +5036,11 @@ NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr ) +@@ -5032,6 +5033,11 @@ NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr ) server_enter_uninterrupted_section( &virtual_mutex, &sigset ); if ((view = find_view( addr, 0 )) && !is_view_valloc( view )) { @@ -159,7 +159,7 @@ index 219dfe8bb94..84a4e331ad7 100644 if (view->protect & VPROT_SYSTEM) { struct builtin_module *builtin; -@@ -5061,10 +5067,21 @@ NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr ) +@@ -5058,10 +5064,21 @@ NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr ) if (!status) { if (view->protect & SEC_IMAGE) release_builtin_module( view->base ); @@ -182,7 +182,7 @@ index 219dfe8bb94..84a4e331ad7 100644 server_leave_uninterrupted_section( &virtual_mutex, &sigset ); return status; } -@@ -5075,7 +5092,7 @@ NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr ) +@@ -5072,7 +5089,7 @@ NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr ) */ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr ) { @@ -191,17 +191,17 @@ index 219dfe8bb94..84a4e331ad7 100644 } /*********************************************************************** -@@ -5085,7 +5102,7 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr ) +@@ -5082,7 +5099,7 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr ) NTSTATUS WINAPI NtUnmapViewOfSectionEx( HANDLE process, PVOID addr, ULONG flags ) { - if (flags) FIXME("Ignoring flags %#x.\n", flags); + if (flags) FIXME("Ignoring flags %#x.\n", (int)flags); - return unmap_view_of_section( process, addr ); + return unmap_view_of_section( process, addr, flags ); } /****************************************************************************** diff --git a/server/protocol.def b/server/protocol.def -index 9a832cd3a06..35408413249 100644 +index e3e9d3641aa..825c25693cc 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -602,6 +602,7 @@ typedef union diff --git a/patches/ntdll-wine-frames/0001-ntdll-Don-t-use-Wine-frames-during-exception-process.patch b/patches/ntdll-wine-frames/0001-ntdll-Don-t-use-Wine-frames-during-exception-process.patch index cb0ec283..44661c0f 100644 --- a/patches/ntdll-wine-frames/0001-ntdll-Don-t-use-Wine-frames-during-exception-process.patch +++ b/patches/ntdll-wine-frames/0001-ntdll-Don-t-use-Wine-frames-during-exception-process.patch @@ -1,4 +1,4 @@ -From b2c573c7d371f760d92b7490fd1aca002e2f18c6 Mon Sep 17 00:00:00 2001 +From ed725c78b5deb6c482a60ac26eda5f5d58ab531c Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 26 Oct 2021 19:07:26 +0300 Subject: [PATCH] ntdll: Don't use Wine frames during exception processing on @@ -10,10 +10,10 @@ CW-Bug-ID: #19570 1 file changed, 46 insertions(+), 19 deletions(-) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c -index b1ab4933b93..3d163fbc6ea 100644 +index ac543338893..f2c7cad5675 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c -@@ -347,15 +347,32 @@ __ASM_GLOBAL_FUNC( RtlCaptureContext, +@@ -348,15 +348,32 @@ __ASM_GLOBAL_FUNC( RtlCaptureContext, "fxsave 0x100(%rcx)\n\t" /* context->FltSave */ "ret" ); @@ -48,7 +48,7 @@ index b1ab4933b93..3d163fbc6ea 100644 /********************************************************************** * call_handler * -@@ -364,19 +381,19 @@ static DWORD __cdecl nested_exception_handler( EXCEPTION_RECORD *rec, EXCEPTION_ +@@ -365,19 +382,19 @@ static DWORD __cdecl nested_exception_handler( EXCEPTION_RECORD *rec, EXCEPTION_ */ static DWORD call_handler( EXCEPTION_RECORD *rec, CONTEXT *context, DISPATCHER_CONTEXT *dispatch ) { @@ -62,7 +62,7 @@ index b1ab4933b93..3d163fbc6ea 100644 dispatch->LanguageHandler, rec, (void *)dispatch->EstablisherFrame, dispatch->ContextRecord, dispatch ); - res = dispatch->LanguageHandler( rec, (void *)dispatch->EstablisherFrame, context, dispatch ); + res = exception_handler_call_wrapper( rec, (void *)dispatch->EstablisherFrame, context, dispatch ); - TRACE_(seh)( "handler at %p returned %u\n", dispatch->LanguageHandler, res ); + TRACE_(seh)( "handler at %p returned %lu\n", dispatch->LanguageHandler, res ); rec->ExceptionFlags &= EH_NONCONTINUABLE; - __wine_pop_frame( &frame ); @@ -74,7 +74,7 @@ index b1ab4933b93..3d163fbc6ea 100644 return res; } -@@ -990,7 +1007,8 @@ PVOID WINAPI RtlVirtualUnwind( ULONG type, ULONG64 base, ULONG64 pc, +@@ -992,7 +1009,8 @@ PVOID WINAPI RtlVirtualUnwind( ULONG type, ULONG64 base, ULONG64 pc, struct unwind_exception_frame { @@ -84,7 +84,7 @@ index b1ab4933b93..3d163fbc6ea 100644 DISPATCHER_CONTEXT *dispatch; }; -@@ -999,7 +1017,7 @@ struct unwind_exception_frame +@@ -1001,7 +1019,7 @@ struct unwind_exception_frame * * Handler for exceptions happening while calling an unwind handler. */ @@ -93,7 +93,7 @@ index b1ab4933b93..3d163fbc6ea 100644 CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher ) { struct unwind_exception_frame *unwind_frame = (struct unwind_exception_frame *)frame; -@@ -1019,27 +1037,36 @@ static DWORD __cdecl unwind_exception_handler( EXCEPTION_RECORD *rec, EXCEPTION_ +@@ -1021,27 +1039,36 @@ static DWORD __cdecl unwind_exception_handler( EXCEPTION_RECORD *rec, EXCEPTION_ return ExceptionCollidedUnwind; } @@ -132,7 +132,7 @@ index b1ab4933b93..3d163fbc6ea 100644 dispatch->LanguageHandler, rec, (void *)dispatch->EstablisherFrame, dispatch->ContextRecord, dispatch ); - res = dispatch->LanguageHandler( rec, (void *)dispatch->EstablisherFrame, dispatch->ContextRecord, dispatch ); + res = unwind_handler_call_wrapper( rec, (void *)dispatch->EstablisherFrame, dispatch->ContextRecord, dispatch ); - TRACE( "handler %p returned %x\n", dispatch->LanguageHandler, res ); + TRACE( "handler %p returned %lx\n", dispatch->LanguageHandler, res ); - __wine_pop_frame( &frame.frame ); - @@ -140,5 +140,5 @@ index b1ab4933b93..3d163fbc6ea 100644 { case ExceptionContinueSearch: -- -2.35.1 +2.38.1 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index f2477b4f..18b1a426 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "5d1820c40bd93e6810f072a39745ee739ba99b81" + echo "ae73e09a8d071eaa33fafe785e8295384b9e64a7" } # Show version information diff --git a/patches/windows.networking.connectivity-new-dll/0003-windows.networking.connectivity-Add-stub-dll.patch b/patches/windows.networking.connectivity-new-dll/0003-windows.networking.connectivity-Add-stub-dll.patch index cb58d177..7ffc25d3 100644 --- a/patches/windows.networking.connectivity-new-dll/0003-windows.networking.connectivity-Add-stub-dll.patch +++ b/patches/windows.networking.connectivity-new-dll/0003-windows.networking.connectivity-Add-stub-dll.patch @@ -1,4 +1,4 @@ -From 417cc7a6b991c2fab85bb37609f7a7cc286174e1 Mon Sep 17 00:00:00 2001 +From c5e833ecb1f1e4aef1b146d22230b39459d6f459 Mon Sep 17 00:00:00 2001 From: Esdras Tarsis Date: Wed, 2 Sep 2020 23:41:19 -0300 Subject: [PATCH] windows.networking.connectivity: Add stub dll. @@ -16,12 +16,12 @@ Signed-off-by: Esdras Tarsis create mode 100644 dlls/windows.networking.connectivity/windows.networking.connectivity_main.c diff --git a/configure.ac b/configure.ac -index 280882ecb57..b27930474a9 100644 +index 93d32a2dfae..125784d0396 100644 --- a/configure.ac +++ b/configure.ac -@@ -3147,6 +3147,7 @@ WINE_CONFIG_MAKEFILE(dlls/windows.media.devices/tests) - WINE_CONFIG_MAKEFILE(dlls/windows.media.speech) - WINE_CONFIG_MAKEFILE(dlls/windows.media.speech/tests) +@@ -3201,6 +3201,7 @@ WINE_CONFIG_MAKEFILE(dlls/windows.media.speech/tests) + WINE_CONFIG_MAKEFILE(dlls/windows.media) + WINE_CONFIG_MAKEFILE(dlls/windows.media/tests) WINE_CONFIG_MAKEFILE(dlls/windows.networking) +WINE_CONFIG_MAKEFILE(dlls/windows.networking.connectivity) WINE_CONFIG_MAKEFILE(dlls/windowscodecs) @@ -93,5 +93,5 @@ index 00000000000..96ff0ea5af2 +} \ No newline at end of file -- -2.35.1 +2.38.1 diff --git a/staging/upstream-commit b/staging/upstream-commit index e1959d0e..b4c918c4 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -5d1820c40bd93e6810f072a39745ee739ba99b81 +ae73e09a8d071eaa33fafe785e8295384b9e64a7