server: Use the thread entry point field to pass the PEB in the initial thread.
This commit is contained in:
parent
e861d8be43
commit
b06a919c3c
|
@ -1026,7 +1026,6 @@ size_t server_init_thread( void *entry_point )
|
||||||
req->unix_pid = getpid();
|
req->unix_pid = getpid();
|
||||||
req->unix_tid = get_unix_tid();
|
req->unix_tid = get_unix_tid();
|
||||||
req->teb = wine_server_client_ptr( NtCurrentTeb() );
|
req->teb = wine_server_client_ptr( NtCurrentTeb() );
|
||||||
req->peb = wine_server_client_ptr( NtCurrentTeb()->Peb );
|
|
||||||
req->entry = wine_server_client_ptr( entry_point );
|
req->entry = wine_server_client_ptr( entry_point );
|
||||||
req->reply_fd = reply_pipe[1];
|
req->reply_fd = reply_pipe[1];
|
||||||
req->wait_fd = ntdll_get_thread_data()->wait_fd[1];
|
req->wait_fd = ntdll_get_thread_data()->wait_fd[1];
|
||||||
|
|
|
@ -294,7 +294,7 @@ HANDLE thread_init(void)
|
||||||
|
|
||||||
/* setup the server connection */
|
/* setup the server connection */
|
||||||
server_init_process();
|
server_init_process();
|
||||||
info_size = server_init_thread( NULL );
|
info_size = server_init_thread( peb );
|
||||||
|
|
||||||
/* create the process heap */
|
/* create the process heap */
|
||||||
if (!(peb->ProcessHeap = RtlCreateHeap( HEAP_GROWABLE, NULL, 0, 0, NULL, NULL )))
|
if (!(peb->ProcessHeap = RtlCreateHeap( HEAP_GROWABLE, NULL, 0, 0, NULL, NULL )))
|
||||||
|
|
|
@ -567,7 +567,6 @@ struct init_thread_request
|
||||||
client_ptr_t entry;
|
client_ptr_t entry;
|
||||||
int reply_fd;
|
int reply_fd;
|
||||||
int wait_fd;
|
int wait_fd;
|
||||||
client_ptr_t peb;
|
|
||||||
};
|
};
|
||||||
struct init_thread_reply
|
struct init_thread_reply
|
||||||
{
|
{
|
||||||
|
@ -5215,6 +5214,6 @@ union generic_reply
|
||||||
struct set_window_layered_info_reply set_window_layered_info_reply;
|
struct set_window_layered_info_reply set_window_layered_info_reply;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SERVER_PROTOCOL_VERSION 381
|
#define SERVER_PROTOCOL_VERSION 382
|
||||||
|
|
||||||
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
|
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
|
||||||
|
|
|
@ -551,10 +551,9 @@ typedef union
|
||||||
int unix_tid; /* Unix tid of new thread */
|
int unix_tid; /* Unix tid of new thread */
|
||||||
int debug_level; /* new debug level */
|
int debug_level; /* new debug level */
|
||||||
client_ptr_t teb; /* TEB of new thread (in thread address space) */
|
client_ptr_t teb; /* TEB of new thread (in thread address space) */
|
||||||
client_ptr_t entry; /* thread entry point (in thread address space) */
|
client_ptr_t entry; /* entry point or PEB if initial thread (in thread address space) */
|
||||||
int reply_fd; /* fd for reply pipe */
|
int reply_fd; /* fd for reply pipe */
|
||||||
int wait_fd; /* fd for blocking calls pipe */
|
int wait_fd; /* fd for blocking calls pipe */
|
||||||
client_ptr_t peb; /* address of PEB (in thread address space) */
|
|
||||||
@REPLY
|
@REPLY
|
||||||
process_id_t pid; /* process id of the new thread's process */
|
process_id_t pid; /* process id of the new thread's process */
|
||||||
thread_id_t tid; /* thread id of the new thread */
|
thread_id_t tid; /* thread id of the new thread */
|
||||||
|
|
|
@ -663,7 +663,6 @@ C_ASSERT( FIELD_OFFSET(struct init_thread_request, teb) == 24 );
|
||||||
C_ASSERT( FIELD_OFFSET(struct init_thread_request, entry) == 32 );
|
C_ASSERT( FIELD_OFFSET(struct init_thread_request, entry) == 32 );
|
||||||
C_ASSERT( FIELD_OFFSET(struct init_thread_request, reply_fd) == 40 );
|
C_ASSERT( FIELD_OFFSET(struct init_thread_request, reply_fd) == 40 );
|
||||||
C_ASSERT( FIELD_OFFSET(struct init_thread_request, wait_fd) == 44 );
|
C_ASSERT( FIELD_OFFSET(struct init_thread_request, wait_fd) == 44 );
|
||||||
C_ASSERT( FIELD_OFFSET(struct init_thread_request, peb) == 48 );
|
|
||||||
C_ASSERT( FIELD_OFFSET(struct init_thread_reply, pid) == 8 );
|
C_ASSERT( FIELD_OFFSET(struct init_thread_reply, pid) == 8 );
|
||||||
C_ASSERT( FIELD_OFFSET(struct init_thread_reply, tid) == 12 );
|
C_ASSERT( FIELD_OFFSET(struct init_thread_reply, tid) == 12 );
|
||||||
C_ASSERT( FIELD_OFFSET(struct init_thread_reply, server_start) == 16 );
|
C_ASSERT( FIELD_OFFSET(struct init_thread_reply, server_start) == 16 );
|
||||||
|
|
|
@ -1031,7 +1031,7 @@ DECL_HANDLER(init_thread)
|
||||||
if (!(current->wait_fd = create_anonymous_fd( &thread_fd_ops, wait_fd, ¤t->obj, 0 )))
|
if (!(current->wait_fd = create_anonymous_fd( &thread_fd_ops, wait_fd, ¤t->obj, 0 )))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!is_valid_address(req->teb) || !is_valid_address(req->peb))
|
if (!is_valid_address(req->teb))
|
||||||
{
|
{
|
||||||
set_error( STATUS_INVALID_PARAMETER );
|
set_error( STATUS_INVALID_PARAMETER );
|
||||||
return;
|
return;
|
||||||
|
@ -1044,7 +1044,7 @@ DECL_HANDLER(init_thread)
|
||||||
if (!process->peb) /* first thread, initialize the process too */
|
if (!process->peb) /* first thread, initialize the process too */
|
||||||
{
|
{
|
||||||
process->unix_pid = current->unix_pid;
|
process->unix_pid = current->unix_pid;
|
||||||
process->peb = req->peb;
|
process->peb = req->entry;
|
||||||
reply->info_size = init_process( current );
|
reply->info_size = init_process( current );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -991,9 +991,7 @@ static void dump_init_thread_request( const struct init_thread_request *req )
|
||||||
dump_uint64( &req->entry );
|
dump_uint64( &req->entry );
|
||||||
fprintf( stderr, "," );
|
fprintf( stderr, "," );
|
||||||
fprintf( stderr, " reply_fd=%d,", req->reply_fd );
|
fprintf( stderr, " reply_fd=%d,", req->reply_fd );
|
||||||
fprintf( stderr, " wait_fd=%d,", req->wait_fd );
|
fprintf( stderr, " wait_fd=%d", req->wait_fd );
|
||||||
fprintf( stderr, " peb=" );
|
|
||||||
dump_uint64( &req->peb );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dump_init_thread_reply( const struct init_thread_reply *req )
|
static void dump_init_thread_reply( const struct init_thread_reply *req )
|
||||||
|
|
Loading…
Reference in New Issue