diff --git a/scheduler/process.c b/scheduler/process.c index aa460cd4f8d..284aae7ac68 100644 --- a/scheduler/process.c +++ b/scheduler/process.c @@ -517,7 +517,7 @@ PDB *PROCESS_Create( NE_MODULE *pModule, HFILE hFile, LPCSTR cmd_line, LPCSTR en req->pinherit = (psa && (psa->nLength >= sizeof(*psa)) && psa->bInheritHandle); req->tinherit = (tsa && (tsa->nLength >= sizeof(*tsa)) && tsa->bInheritHandle); - req->inherit_all = inherit; + req->inherit_all = 2 /*inherit*/; /* HACK! */ req->create_flags = flags; req->start_flags = startup->dwFlags; req->exe_file = hFile; diff --git a/server/process.c b/server/process.c index da9d84c6fad..6368d238b07 100644 --- a/server/process.c +++ b/server/process.c @@ -169,15 +169,14 @@ struct thread *create_process( int fd, struct process *parent, /* copy the request structure */ if (!set_creation_info( process, req, cmd_line, len )) goto error; - if (process->info->inherit_all) + if (process->info->inherit_all == 2) /* HACK! */ + process->handles = grab_object( parent->handles ); + else if (process->info->inherit_all) process->handles = copy_handle_table( process, parent ); else process->handles = alloc_handle_table( process, 0 ); if (!process->handles) goto error; - /* alloc a handle for the process itself */ - alloc_handle( process, process, PROCESS_ALL_ACCESS, 0 ); - /* retrieve the main exe file */ if (process->info->exe_file != -1) {