Alexandre Julliard : server: Pass a process as parent to create_process().
Alexandre Julliard
julliard at winehq.org
Mon Oct 22 15:38:44 CDT 2018
Module: wine
Branch: master
Commit: bff32557035edc090246272d731e95b03a9bade0
URL: https://source.winehq.org/git/wine.git/?a=commit;h=bff32557035edc090246272d731e95b03a9bade0
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Oct 22 11:44:38 2018 +0200
server: Pass a process as parent to create_process().
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
server/process.c | 7 +++----
server/process.h | 2 +-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/server/process.c b/server/process.c
index b609a62..3bd545a 100644
--- a/server/process.c
+++ b/server/process.c
@@ -484,7 +484,7 @@ static void start_sigkill_timer( struct process *process )
/* create a new process */
/* if the function fails the fd is closed */
-struct process *create_process( int fd, struct thread *parent_thread, int inherit_all,
+struct process *create_process( int fd, struct process *parent, int inherit_all,
const struct security_descriptor *sd )
{
struct process *process;
@@ -547,7 +547,7 @@ struct process *create_process( int fd, struct thread *parent_thread, int inheri
if (!(process->msg_fd = create_anonymous_fd( &process_fd_ops, fd, &process->obj, 0 ))) goto error;
/* create the handle table */
- if (!parent_thread)
+ if (!parent)
{
process->handles = alloc_handle_table( process, 0 );
process->token = token_create_admin();
@@ -555,7 +555,6 @@ struct process *create_process( int fd, struct thread *parent_thread, int inheri
}
else
{
- struct process *parent = parent_thread->process;
process->parent_id = parent->id;
process->handles = inherit_all ? copy_handle_table( process, parent )
: alloc_handle_table( process, 0 );
@@ -1162,7 +1161,7 @@ DECL_HANDLER(new_process)
#undef FIXUP_LEN
}
- if (!(process = create_process( socket_fd, current, req->inherit_all, sd ))) goto done;
+ if (!(process = create_process( socket_fd, parent, req->inherit_all, sd ))) goto done;
process->startup_info = (struct startup_info *)grab_object( info );
diff --git a/server/process.h b/server/process.h
index a12d523..4566a04 100644
--- a/server/process.h
+++ b/server/process.h
@@ -115,7 +115,7 @@ struct process_snapshot
extern unsigned int alloc_ptid( void *ptr );
extern void free_ptid( unsigned int id );
extern void *get_ptid_entry( unsigned int id );
-extern struct process *create_process( int fd, struct thread *parent_thread, int inherit_all,
+extern struct process *create_process( int fd, struct process *parent, int inherit_all,
const struct security_descriptor *sd );
extern data_size_t init_process( struct thread *thread );
extern struct thread *get_process_first_thread( struct process *process );
More information about the wine-cvs
mailing list