Alexandre Julliard : server: Move the ldt_copy pointer to the init_first_thread request.

Alexandre Julliard julliard at winehq.org
Tue Feb 2 15:52:09 CST 2021


Module: wine
Branch: master
Commit: d514c64a8c06d893901538f83fde98add3e2eda7
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d514c64a8c06d893901538f83fde98add3e2eda7

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Feb  2 10:26:20 2021 +0100

server: Move the ldt_copy pointer to the init_first_thread request.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/unix/server.c       |  6 +++---
 include/wine/server_protocol.h |  6 +++---
 server/process.c               |  1 -
 server/protocol.def            |  2 +-
 server/request.h               | 14 +++++++-------
 server/thread.c                |  1 +
 server/trace.c                 |  2 +-
 7 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c
index c04a4273d4b..7b469959f66 100644
--- a/dlls/ntdll/unix/server.c
+++ b/dlls/ntdll/unix/server.c
@@ -1535,6 +1535,9 @@ size_t server_init_process(void)
         req->unix_tid    = get_unix_tid();
         req->teb         = wine_server_client_ptr( NtCurrentTeb() );
         req->peb         = wine_server_client_ptr( NtCurrentTeb()->Peb );
+#ifdef __i386__
+        req->ldt_copy    = wine_server_client_ptr( &__wine_ldt_copy );
+#endif
         req->reply_fd    = reply_pipe;
         req->wait_fd     = ntdll_get_thread_data()->wait_fd[1];
         req->debug_level = (TRACE_ON(server) != 0);
@@ -1611,9 +1614,6 @@ void server_init_process_done(void)
     SERVER_START_REQ( init_process_done )
     {
         req->module   = wine_server_client_ptr( peb->ImageBaseAddress );
-#ifdef __i386__
-        req->ldt_copy = wine_server_client_ptr( &__wine_ldt_copy );
-#endif
         req->entry    = wine_server_client_ptr( entry );
         req->gui      = (nt->OptionalHeader.Subsystem != IMAGE_SUBSYSTEM_WINDOWS_CUI);
         status = wine_server_call( req );
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index 64b2ad78e87..59787c07c9a 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -881,7 +881,6 @@ struct init_process_done_request
     struct request_header __header;
     int          gui;
     mod_handle_t module;
-    client_ptr_t ldt_copy;
     client_ptr_t entry;
 };
 struct init_process_done_reply
@@ -901,10 +900,11 @@ struct init_first_thread_request
     int          debug_level;
     client_ptr_t teb;
     client_ptr_t peb;
+    client_ptr_t ldt_copy;
     int          reply_fd;
     int          wait_fd;
     client_cpu_t cpu;
-    char __pad_52[4];
+    char __pad_60[4];
 };
 struct init_first_thread_reply
 {
@@ -6229,7 +6229,7 @@ union generic_reply
 
 /* ### protocol_version begin ### */
 
-#define SERVER_PROTOCOL_VERSION 663
+#define SERVER_PROTOCOL_VERSION 664
 
 /* ### protocol_version end ### */
 
diff --git a/server/process.c b/server/process.c
index 5c4e47434a0..7da33178f6d 100644
--- a/server/process.c
+++ b/server/process.c
@@ -1369,7 +1369,6 @@ DECL_HANDLER(init_process_done)
     list_remove( &dll->entry );
     list_add_head( &process->dlls, &dll->entry );
 
-    process->ldt_copy = req->ldt_copy;
     process->start_time = current_time;
     current->entry_point = req->entry;
 
diff --git a/server/protocol.def b/server/protocol.def
index 2da77f419bb..c43218ea737 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -863,7 +863,6 @@ typedef struct
 @REQ(init_process_done)
     int          gui;          /* is it a GUI process? */
     mod_handle_t module;       /* main module base address */
-    client_ptr_t ldt_copy;     /* address of LDT copy (in thread address space) */
     client_ptr_t entry;        /* process entry point */
 @REPLY
     int          suspend;      /* is process suspended? */
@@ -877,6 +876,7 @@ typedef struct
     int          debug_level;  /* new debug level */
     client_ptr_t teb;          /* TEB of new thread (in process address space) */
     client_ptr_t peb;          /* PEB of new process (in process address space) */
+    client_ptr_t ldt_copy;     /* address of LDT copy (in process address space) */
     int          reply_fd;     /* fd for reply pipe */
     int          wait_fd;      /* fd for blocking calls pipe */
     client_cpu_t cpu;          /* CPU that this thread is running on */
diff --git a/server/request.h b/server/request.h
index 22d767649dc..a12242ce868 100644
--- a/server/request.h
+++ b/server/request.h
@@ -745,9 +745,8 @@ C_ASSERT( FIELD_OFFSET(struct get_startup_info_reply, info_size) == 8 );
 C_ASSERT( sizeof(struct get_startup_info_reply) == 16 );
 C_ASSERT( FIELD_OFFSET(struct init_process_done_request, gui) == 12 );
 C_ASSERT( FIELD_OFFSET(struct init_process_done_request, module) == 16 );
-C_ASSERT( FIELD_OFFSET(struct init_process_done_request, ldt_copy) == 24 );
-C_ASSERT( FIELD_OFFSET(struct init_process_done_request, entry) == 32 );
-C_ASSERT( sizeof(struct init_process_done_request) == 40 );
+C_ASSERT( FIELD_OFFSET(struct init_process_done_request, entry) == 24 );
+C_ASSERT( sizeof(struct init_process_done_request) == 32 );
 C_ASSERT( FIELD_OFFSET(struct init_process_done_reply, suspend) == 8 );
 C_ASSERT( sizeof(struct init_process_done_reply) == 16 );
 C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, unix_pid) == 12 );
@@ -755,10 +754,11 @@ C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, unix_tid) == 16 );
 C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, debug_level) == 20 );
 C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, teb) == 24 );
 C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, peb) == 32 );
-C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, reply_fd) == 40 );
-C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, wait_fd) == 44 );
-C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, cpu) == 48 );
-C_ASSERT( sizeof(struct init_first_thread_request) == 56 );
+C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, ldt_copy) == 40 );
+C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, reply_fd) == 48 );
+C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, wait_fd) == 52 );
+C_ASSERT( FIELD_OFFSET(struct init_first_thread_request, cpu) == 56 );
+C_ASSERT( sizeof(struct init_first_thread_request) == 64 );
 C_ASSERT( FIELD_OFFSET(struct init_first_thread_reply, pid) == 8 );
 C_ASSERT( FIELD_OFFSET(struct init_first_thread_reply, tid) == 12 );
 C_ASSERT( FIELD_OFFSET(struct init_first_thread_reply, server_start) == 16 );
diff --git a/server/thread.c b/server/thread.c
index 105e301fc43..b9d78c8c5c6 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -1434,6 +1434,7 @@ DECL_HANDLER(init_first_thread)
     current->unix_tid = req->unix_tid;
     current->teb      = req->teb;
     process->peb      = req->peb;
+    process->ldt_copy = req->ldt_copy;
     process->cpu      = req->cpu;
 
     if (!process->parent_id)
diff --git a/server/trace.c b/server/trace.c
index ae0e9ab859c..bc09a5fc959 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -1383,7 +1383,6 @@ static void dump_init_process_done_request( const struct init_process_done_reque
 {
     fprintf( stderr, " gui=%d", req->gui );
     dump_uint64( ", module=", &req->module );
-    dump_uint64( ", ldt_copy=", &req->ldt_copy );
     dump_uint64( ", entry=", &req->entry );
 }
 
@@ -1399,6 +1398,7 @@ static void dump_init_first_thread_request( const struct init_first_thread_reque
     fprintf( stderr, ", debug_level=%d", req->debug_level );
     dump_uint64( ", teb=", &req->teb );
     dump_uint64( ", peb=", &req->peb );
+    dump_uint64( ", ldt_copy=", &req->ldt_copy );
     fprintf( stderr, ", reply_fd=%d", req->reply_fd );
     fprintf( stderr, ", wait_fd=%d", req->wait_fd );
     dump_client_cpu( ", cpu=", &req->cpu );




More information about the wine-cvs mailing list