server: Use the thread entry point field to pass the PEB in the initial thread.

This commit is contained in:
Alexandre Julliard 2009-04-03 14:30:34 +02:00
parent e861d8be43
commit b06a919c3c
7 changed files with 6 additions and 12 deletions

View File

@ -1026,7 +1026,6 @@ size_t server_init_thread( void *entry_point )
req->unix_pid = getpid();
req->unix_tid = get_unix_tid();
req->teb = wine_server_client_ptr( NtCurrentTeb() );
req->peb = wine_server_client_ptr( NtCurrentTeb()->Peb );
req->entry = wine_server_client_ptr( entry_point );
req->reply_fd = reply_pipe[1];
req->wait_fd = ntdll_get_thread_data()->wait_fd[1];

View File

@ -294,7 +294,7 @@ HANDLE thread_init(void)
/* setup the server connection */
server_init_process();
info_size = server_init_thread( NULL );
info_size = server_init_thread( peb );
/* create the process heap */
if (!(peb->ProcessHeap = RtlCreateHeap( HEAP_GROWABLE, NULL, 0, 0, NULL, NULL )))

View File

@ -567,7 +567,6 @@ struct init_thread_request
client_ptr_t entry;
int reply_fd;
int wait_fd;
client_ptr_t peb;
};
struct init_thread_reply
{
@ -5215,6 +5214,6 @@ union generic_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 */

View File

@ -551,10 +551,9 @@ typedef union
int unix_tid; /* Unix tid of new thread */
int debug_level; /* new debug level */
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 wait_fd; /* fd for blocking calls pipe */
client_ptr_t peb; /* address of PEB (in thread address space) */
@REPLY
process_id_t pid; /* process id of the new thread's process */
thread_id_t tid; /* thread id of the new thread */

View File

@ -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, reply_fd) == 40 );
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, tid) == 12 );
C_ASSERT( FIELD_OFFSET(struct init_thread_reply, server_start) == 16 );

View File

@ -1031,7 +1031,7 @@ DECL_HANDLER(init_thread)
if (!(current->wait_fd = create_anonymous_fd( &thread_fd_ops, wait_fd, &current->obj, 0 )))
return;
if (!is_valid_address(req->teb) || !is_valid_address(req->peb))
if (!is_valid_address(req->teb))
{
set_error( STATUS_INVALID_PARAMETER );
return;
@ -1044,7 +1044,7 @@ DECL_HANDLER(init_thread)
if (!process->peb) /* first thread, initialize the process too */
{
process->unix_pid = current->unix_pid;
process->peb = req->peb;
process->peb = req->entry;
reply->info_size = init_process( current );
}
else

View File

@ -991,9 +991,7 @@ static void dump_init_thread_request( const struct init_thread_request *req )
dump_uint64( &req->entry );
fprintf( stderr, "," );
fprintf( stderr, " reply_fd=%d,", req->reply_fd );
fprintf( stderr, " wait_fd=%d,", req->wait_fd );
fprintf( stderr, " peb=" );
dump_uint64( &req->peb );
fprintf( stderr, " wait_fd=%d", req->wait_fd );
}
static void dump_init_thread_reply( const struct init_thread_reply *req )