From 0d8d1f0447d8cce87617d32bcc23d588f4c85e86 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 21 Apr 2020 08:19:34 +1000 Subject: [PATCH] Rebase against f31a29b8d1ea478af28f14cdaf3db1515a932853 --- patches/patchinstall.sh | 2 +- ...-support-for-global-and-local-shared.patch | 48 +++++++++---------- ...all-NtOpenFile-through-syscall-thunk.patch | 20 ++++---- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index d76ce94c..a140ab3a 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "59987bc9ecdd0dbafd768a95c21a14884bc77c07" + echo "f31a29b8d1ea478af28f14cdaf3db1515a932853" } # Show version information diff --git a/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch b/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch index 299e6dca..333afbe9 100644 --- a/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch +++ b/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch @@ -1,4 +1,4 @@ -From 3881d5a6262c869f17318fdf7810a13138110e5a Mon Sep 17 00:00:00 2001 +From 86bfe6daff2fffab7c987b5c1becf154d660ad5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 19 Mar 2015 01:22:34 +0100 Subject: [PATCH] server: Implement support for global and local shared memory @@ -20,22 +20,22 @@ Subject: [PATCH] server: Implement support for global and local shared memory 12 files changed, 215 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 2394ce37113..4764d0db129 100644 +index d63aaae824f..1dfc421cbf7 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h -@@ -133,6 +133,7 @@ extern NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct o +@@ -131,6 +131,7 @@ extern int server_pipe( int fd[2] ) DECLSPEC_HIDDEN; + extern NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_attributes **ret, + data_size_t *ret_len ) DECLSPEC_HIDDEN; extern NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr ) DECLSPEC_HIDDEN; - extern int wait_select_reply( void *cookie ) DECLSPEC_HIDDEN; - extern void invoke_apc( const user_apc_t *apc ) DECLSPEC_HIDDEN; +extern void *server_get_shared_memory( HANDLE thread ) DECLSPEC_HIDDEN; /* module handling */ extern LIST_ENTRY tls_links DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c -index 9053ad2042c..02b6dca3605 100644 +index c0dd0f35fc3..19b88a32a5d 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c -@@ -1036,6 +1036,66 @@ done: +@@ -1061,6 +1061,66 @@ done: } @@ -102,7 +102,7 @@ index 9053ad2042c..02b6dca3605 100644 /*********************************************************************** * wine_server_fd_to_handle (NTDLL.@) * -@@ -1576,6 +1636,10 @@ size_t server_init_thread( void *entry_point, BOOL *suspend ) +@@ -1601,6 +1661,10 @@ size_t server_init_thread( void *entry_point, BOOL *suspend ) } SERVER_END_REQ; @@ -114,10 +114,10 @@ index 9053ad2042c..02b6dca3605 100644 ntdll_get_thread_data()->wow64_redir = is_wow64; diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 8ab42d65070..e79b43a748b 100644 +index 9c7b326bc09..c3959ae3166 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c -@@ -370,6 +370,7 @@ void exit_thread( int status ) +@@ -533,6 +533,7 @@ void exit_thread( int status ) void WINAPI RtlExitUserThread( ULONG status ) { static void *prev_teb; @@ -125,7 +125,7 @@ index 8ab42d65070..e79b43a748b 100644 sigset_t sigset; TEB *teb; -@@ -394,6 +395,9 @@ void WINAPI RtlExitUserThread( ULONG status ) +@@ -557,6 +558,9 @@ void WINAPI RtlExitUserThread( ULONG status ) LdrShutdownThread(); RtlFreeThreadActivationContextStack(); @@ -158,7 +158,7 @@ index ac5dcc6f8bc..5a845f424c2 100644 /* macros for server requests */ diff --git a/include/winternl.h b/include/winternl.h -index 2ac548764f2..9ca696d4ecc 100644 +index a6e5be3a261..68343276e6b 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -403,7 +403,7 @@ typedef struct _TEB @@ -171,10 +171,10 @@ index 2ac548764f2..9ca696d4ecc 100644 #ifdef _WIN64 PVOID DeallocationBStore; /* /1788 */ diff --git a/server/fd.c b/server/fd.c -index 39fb419f25f..a7cba834d46 100644 +index 405240e14d8..cc8df828a65 100644 --- a/server/fd.c +++ b/server/fd.c -@@ -2638,6 +2638,33 @@ DECL_HANDLER(write) +@@ -2704,6 +2704,33 @@ DECL_HANDLER(write) release_object( fd ); } @@ -228,10 +228,10 @@ index 7395814dadd..1ea6e8e8e8d 100644 extern void do_change_notify( int unix_fd ); diff --git a/server/main.c b/server/main.c -index efb205f5292..43297a3e93d 100644 +index 2b5065e1852..483a0c85580 100644 --- a/server/main.c +++ b/server/main.c -@@ -145,6 +145,7 @@ int main( int argc, char *argv[] ) +@@ -146,6 +146,7 @@ int main( int argc, char *argv[] ) init_signals(); init_directories(); init_registry(); @@ -341,7 +341,7 @@ index 6990a1913d7..3d794bfaaf9 100644 static int create_temp_file( file_pos_t size ) { diff --git a/server/protocol.def b/server/protocol.def -index 0830bc684a5..16aafab5b66 100644 +index 1ea80c8ba99..c2d671d4b15 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -69,6 +69,15 @@ struct request_max_size @@ -360,7 +360,7 @@ index 0830bc684a5..16aafab5b66 100644 /* debug event data */ typedef union -@@ -1329,6 +1338,12 @@ enum server_fd_type +@@ -1334,6 +1343,12 @@ enum server_fd_type @END @@ -374,10 +374,10 @@ index 0830bc684a5..16aafab5b66 100644 @REQ(flush) async_data_t async; /* async I/O parameters */ diff --git a/server/thread.c b/server/thread.c -index d3bbd8ecfa8..a1d24c160ac 100644 +index 6be0495a556..5b176f1b67d 100644 --- a/server/thread.c +++ b/server/thread.c -@@ -204,6 +204,8 @@ static inline void init_thread_structure( struct thread *thread ) +@@ -203,6 +203,8 @@ static inline void init_thread_structure( struct thread *thread ) thread->desc = NULL; thread->desc_len = 0; thread->exit_poll = NULL; @@ -386,7 +386,7 @@ index d3bbd8ecfa8..a1d24c160ac 100644 thread->creation_time = current_time; thread->exit_time = 0; -@@ -339,7 +341,10 @@ static void cleanup_thread( struct thread *thread ) +@@ -338,7 +340,10 @@ static void cleanup_thread( struct thread *thread ) thread->inflight[i].client = thread->inflight[i].server = -1; } } @@ -397,7 +397,7 @@ index d3bbd8ecfa8..a1d24c160ac 100644 thread->req_data = NULL; thread->reply_data = NULL; thread->request_fd = NULL; -@@ -350,6 +355,8 @@ static void cleanup_thread( struct thread *thread ) +@@ -348,6 +353,8 @@ static void cleanup_thread( struct thread *thread ) thread->desktop = 0; thread->desc = NULL; thread->desc_len = 0; @@ -407,7 +407,7 @@ index d3bbd8ecfa8..a1d24c160ac 100644 /* destroy a thread when its refcount is 0 */ diff --git a/server/thread.h b/server/thread.h -index 1256e0da49e..bc4ad79b110 100644 +index 7b4d4cb72ba..8029d65df44 100644 --- a/server/thread.h +++ b/server/thread.h @@ -91,6 +91,8 @@ struct thread @@ -420,5 +420,5 @@ index 1256e0da49e..bc4ad79b110 100644 struct thread_snapshot -- -2.26.0 +2.26.1 diff --git a/patches/winebuild-Fake_Dlls/0011-ntdll-Call-NtOpenFile-through-syscall-thunk.patch b/patches/winebuild-Fake_Dlls/0011-ntdll-Call-NtOpenFile-through-syscall-thunk.patch index f107149f..ea3940f4 100644 --- a/patches/winebuild-Fake_Dlls/0011-ntdll-Call-NtOpenFile-through-syscall-thunk.patch +++ b/patches/winebuild-Fake_Dlls/0011-ntdll-Call-NtOpenFile-through-syscall-thunk.patch @@ -1,4 +1,4 @@ -From ed1f5ed8e90ddfa5d9534edd11d9bdc86ba20a7a Mon Sep 17 00:00:00 2001 +From cba87bb5a4aea10f9f4c2044db8290479a83f17e Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 3 Jan 2020 17:39:08 +0300 Subject: [PATCH] ntdll: Call NtOpenFile through syscall thunk. @@ -37,7 +37,7 @@ index 1ca14827a79..6f3bc369f82 100644 { sxs_ai = *ai; diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c -index 624c534ce92..c29112d3b0f 100644 +index f02feb8c442..1dcc3d42db7 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -3010,7 +3010,7 @@ NTSTATUS DIR_get_unix_cwd( char **cwd ) @@ -50,10 +50,10 @@ index 624c534ce92..c29112d3b0f 100644 RtlFreeUnicodeString( &dirW ); if (status != STATUS_SUCCESS) goto done; diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 947ae103fcc..78a27fef94b 100644 +index 8a525c36a74..d964c296243 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -2372,7 +2372,7 @@ static NTSTATUS open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, +@@ -2565,7 +2565,7 @@ static NTSTATUS open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, attr.ObjectName = nt_name; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; @@ -63,7 +63,7 @@ index 947ae103fcc..78a27fef94b 100644 FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE ))) { diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c -index ff9d7136247..2efd47f0e0d 100644 +index a28f5d0f580..deab31be66f 100644 --- a/dlls/ntdll/locale.c +++ b/dlls/ntdll/locale.c @@ -662,7 +662,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file ) @@ -74,7 +74,7 @@ index ff9d7136247..2efd47f0e0d 100644 + status = __syscall_NtOpenFile( file, GENERIC_READ, &attr, &io, FILE_SHARE_READ, FILE_SYNCHRONOUS_IO_ALERT ); if (!status) TRACE( "found %s\n", debugstr_w( valueW.Buffer )); RtlFreeUnicodeString( &valueW ); - if (status != STATUS_OBJECT_NAME_NOT_FOUND) return status; + if (status != STATUS_OBJECT_NAME_NOT_FOUND && status != STATUS_OBJECT_PATH_NOT_FOUND) return status; @@ -686,7 +686,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file ) wcscat( valueW.Buffer, name ); valueW.Length = wcslen(valueW.Buffer) * sizeof(WCHAR); @@ -85,10 +85,10 @@ index ff9d7136247..2efd47f0e0d 100644 } RtlFreeUnicodeString( &valueW ); diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index c7865a28d47..63e03d88366 100644 +index 6bb50f8ddd6..75060f6d8e9 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h -@@ -336,4 +336,12 @@ static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len ) +@@ -348,4 +348,12 @@ static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len ) while (len--) *dst++ = (unsigned char)*src++; } @@ -115,7 +115,7 @@ index 32e1f951af5..71ae44dd498 100644 if (nts != STATUS_SUCCESS) goto out; diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c -index b38c5e21b83..0c8181df0c7 100644 +index 1beb4b9341d..55ff4a7da1b 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -1395,7 +1395,7 @@ static NTSTATUS get_pe_file_info( UNICODE_STRING *path, ULONG attributes, @@ -128,5 +128,5 @@ index b38c5e21b83..0c8181df0c7 100644 { BOOL is_64bit; -- -2.25.1 +2.26.1