Rebase against f56e409c2feb62056eb133e53fe398eadd0a503e.

This commit is contained in:
Alistair Leslie-Hughes
2020-06-17 10:03:04 +10:00
parent 32fcc0d75b
commit 984d402240
12 changed files with 221 additions and 170 deletions

View File

@@ -1,4 +1,4 @@
From 7e13aba360d1dd4d5a09f5b9a624dfa4e61d3ddf Mon Sep 17 00:00:00 2001
From 51d9c664ba86df86b3fb02a281642b5940cef430 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 11 May 2017 05:32:55 +0200
Subject: [PATCH] winebuild: Generate syscall thunks for ntdll exports.
@@ -22,10 +22,10 @@ Based on a patch by Erich E. Hoover.
14 files changed, 221 insertions(+), 32 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index a09c17e3b50..d22fd0141c0 100644
index 99bcff94b3e..06cdf5cd350 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -3812,6 +3812,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule)
@@ -4020,6 +4020,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule)
return ret;
}
@@ -33,7 +33,7 @@ index a09c17e3b50..d22fd0141c0 100644
/******************************************************************
* LdrInitializeThunk (NTDLL.@)
@@ -3828,6 +3829,8 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow
@@ -4037,6 +4038,8 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow
WINE_MODREF *wm;
LPCWSTR load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer;
@@ -65,7 +65,7 @@ index 21cc1b3ead4..18be5693a7d 100644
}
return unix_funcs->NtGetContextThread( handle, context );
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index a5e6faa461a..51938bf84cc 100644
index 1389a542cde..54796476e25 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -1643,6 +1643,8 @@ static void test_thread_context(void)
@@ -78,10 +78,10 @@ index a5e6faa461a..51938bf84cc 100644
ok( context.SegCs == LOWORD(expect.SegCs), "wrong SegCs %08x/%08x\n", context.SegCs, expect.SegCs );
ok( context.SegDs == LOWORD(expect.SegDs), "wrong SegDs %08x/%08x\n", context.SegDs, expect.SegDs );
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 5a6809638ae..c6988ce08e3 100644
index 64dee4d0c12..2a22f1ca137 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -170,6 +170,14 @@ int __cdecl __wine_dbg_output( const char *str )
@@ -220,6 +220,14 @@ int __cdecl __wine_dbg_output( const char *str )
return unix_funcs->dbg_output( str );
}
@@ -96,7 +96,7 @@ index 5a6809638ae..c6988ce08e3 100644
/***********************************************************************
* thread_init
@@ -181,7 +189,7 @@ int __cdecl __wine_dbg_output( const char *str )
@@ -231,7 +239,7 @@ int __cdecl __wine_dbg_output( const char *str )
TEB *thread_init( SIZE_T *info_size, BOOL *suspend )
{
TEB *teb = unix_funcs->init_threading( &nb_threads, &__wine_ldt_copy, info_size, suspend, &server_cpus,
@@ -106,7 +106,7 @@ index 5a6809638ae..c6988ce08e3 100644
peb = teb->Peb;
peb->FastPebLock = &peb_lock;
diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c
index 0470f5eaa8a..55afc1748ef 100644
index 34cf12885d9..212ebda0443 100644
--- a/dlls/ntdll/unix/thread.c
+++ b/dlls/ntdll/unix/thread.c
@@ -85,7 +85,7 @@ static void pthread_exit_wrapper( int status )
@@ -127,10 +127,10 @@ index 0470f5eaa8a..55afc1748ef 100644
thread_data->request_fd = -1;
thread_data->reply_fd = -1;
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index 0d1d0e5025f..ac792801283 100644
index f19c8924008..e668c8e6fbb 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -111,7 +111,7 @@ extern void CDECL server_release_fd( HANDLE handle, int unix_fd ) DECLSPEC_HIDDE
@@ -108,7 +108,7 @@ extern void CDECL server_release_fd( HANDLE handle, int unix_fd ) DECLSPEC_HIDDE
extern void CDECL server_init_process_done( void *relay ) DECLSPEC_HIDDEN;
extern TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size,
BOOL *suspend, unsigned int *cpus, BOOL *wow64,
@@ -140,19 +140,19 @@ index 0d1d0e5025f..ac792801283 100644
extern void CDECL DECLSPEC_NORETURN exit_process( int status ) DECLSPEC_HIDDEN;
extern NTSTATUS CDECL get_thread_ldt_entry( HANDLE handle, void *data, ULONG len, ULONG *ret_len ) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h
index dd5c3e3784e..dae93ab1632 100644
index dbe68a1b486..b09f4942f05 100644
--- a/dlls/ntdll/unixlib.h
+++ b/dlls/ntdll/unixlib.h
@@ -28,7 +28,7 @@ struct ldt_copy;
struct msghdr;
/* increment this when you change the function table */
-#define NTDLL_UNIXLIB_VERSION 47
+#define NTDLL_UNIXLIB_VERSION 48
-#define NTDLL_UNIXLIB_VERSION 52
+#define NTDLL_UNIXLIB_VERSION 53
struct unix_funcs
{
@@ -253,7 +253,7 @@ struct unix_funcs
@@ -281,7 +281,7 @@ struct unix_funcs
/* thread/process functions */
TEB * (CDECL *init_threading)( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size,
@@ -162,10 +162,10 @@ index dd5c3e3784e..dae93ab1632 100644
void (CDECL *exit_process)( int status );
NTSTATUS (CDECL *get_thread_ldt_entry)( HANDLE handle, void *data, ULONG len, ULONG *ret_len );
diff --git a/include/winternl.h b/include/winternl.h
index 04e5dd1f62f..2b9a12cbb31 100644
index 4f5ce4d0cfe..7d69a448e89 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -359,7 +359,7 @@ typedef struct _TEB
@@ -360,7 +360,7 @@ typedef struct _TEB
PVOID CsrClientThread; /* 03c/0070 */
PVOID Win32ThreadInfo; /* 040/0078 */
ULONG Win32ClientInfo[31]; /* 044/0080 used for user32 private data in Wine */

View File

@@ -1,4 +1,4 @@
From b37d55d71b294fb96cb4816f2cb3f2448731e115 Mon Sep 17 00:00:00 2001
From 88dc845f605a87a97247d4d2c795722afeba41dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 7 Sep 2017 00:38:09 +0200
Subject: [PATCH] tools/winebuild: Add syscall thunks for 64 bit.
@@ -15,10 +15,10 @@ Subject: [PATCH] tools/winebuild: Add syscall thunks for 64 bit.
8 files changed, 305 insertions(+), 14 deletions(-)
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
index 95939ba6bde..ae5462f6e55 100644
index 1f525194ce7..21af7b4ce7a 100644
--- a/dlls/kernel32/tests/loader.c
+++ b/dlls/kernel32/tests/loader.c
@@ -1573,7 +1573,7 @@ static void test_filenames(void)
@@ -1574,7 +1574,7 @@ static void test_filenames(void)
static void test_FakeDLL(void)
{
@@ -27,7 +27,7 @@ index 95939ba6bde..ae5462f6e55 100644
NTSTATUS (WINAPI *pNtSetEvent)(HANDLE, ULONG *) = NULL;
IMAGE_EXPORT_DIRECTORY *dir;
HMODULE module = GetModuleHandleA("ntdll.dll");
@@ -1615,8 +1615,13 @@ static void test_FakeDLL(void)
@@ -1616,8 +1616,13 @@ static void test_FakeDLL(void)
dll_func = (BYTE *)GetProcAddress(module, func_name);
ok(dll_func != NULL, "%s: GetProcAddress returned NULL\n", func_name);
@@ -42,7 +42,7 @@ index 95939ba6bde..ae5462f6e55 100644
todo_wine ok(0, "%s: Export is a stub-function, skipping\n", func_name);
continue;
diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c
index 55afc1748ef..0bffa4029c1 100644
index 212ebda0443..0279690806c 100644
--- a/dlls/ntdll/unix/thread.c
+++ b/dlls/ntdll/unix/thread.c
@@ -110,7 +110,7 @@ TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZ
@@ -55,23 +55,23 @@ index 55afc1748ef..0bffa4029c1 100644
NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 );
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index ac792801283..b7b66b6b440 100644
index e668c8e6fbb..19196dbb296 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -176,7 +176,7 @@ extern void virtual_init(void) DECLSPEC_HIDDEN;
@@ -171,7 +171,7 @@ extern ULONG_PTR get_system_affinity_mask(void) DECLSPEC_HIDDEN;
extern TEB *virtual_alloc_first_teb(void) DECLSPEC_HIDDEN;
extern NTSTATUS virtual_alloc_teb( TEB **ret_teb ) DECLSPEC_HIDDEN;
extern void virtual_free_teb( TEB *teb ) DECLSPEC_HIDDEN;
-extern void virtual_map_user_shared_data(void) DECLSPEC_HIDDEN;
+extern void virtual_map_user_shared_data(void *) DECLSPEC_HIDDEN;
extern NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err, BOOL on_signal_stack ) DECLSPEC_HIDDEN;
extern BOOL virtual_is_valid_code_address( const void *addr, SIZE_T size ) DECLSPEC_HIDDEN;
extern int virtual_handle_stack_fault( void *addr ) DECLSPEC_HIDDEN;
extern unsigned int virtual_locked_server_call( void *req_ptr ) DECLSPEC_HIDDEN;
extern ssize_t virtual_locked_read( int fd, void *addr, size_t size ) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index b656a62c154..9b415fe5058 100644
index a3b2cb2c477..5cf4eb626c0 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -2588,14 +2588,14 @@ TEB *virtual_alloc_first_teb(void)
@@ -2771,14 +2771,14 @@ TEB *virtual_alloc_first_teb(void)
TEB *teb;
PEB *peb;
NTSTATUS status;
@@ -88,7 +88,7 @@ index b656a62c154..9b415fe5058 100644
if (status)
{
ERR( "wine: failed to map the shared user data: %08x\n", status );
@@ -2791,7 +2791,7 @@ void virtual_clear_thread_stack( void *stack_end )
@@ -2976,7 +2976,7 @@ void virtual_clear_thread_stack( void *stack_end )
/***********************************************************************
* virtual_map_user_shared_data
*/
@@ -97,7 +97,7 @@ index b656a62c154..9b415fe5058 100644
{
static const WCHAR wine_usdW[] = {'\\','K','e','r','n','e','l','O','b','j','e','c','t','s',
'\\','_','_','w','i','n','e','_','u','s','e','r','_','s','h','a','r','e','d','_','d','a','t','a',0};
@@ -2814,6 +2814,11 @@ void virtual_map_user_shared_data(void)
@@ -2999,6 +2999,11 @@ void virtual_map_user_shared_data(void)
ERR( "failed to remap the process USD: %d\n", res );
exit(1);
}