From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/ntdll/unix/process.c | 3 ++- server/process.c | 11 ++++++----- server/process.h | 1 + server/protocol.def | 3 ++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c index 3a47d5a950a..758a5bf9d35 100644 --- a/dlls/ntdll/unix/process.c +++ b/dlls/ntdll/unix/process.c @@ -823,7 +823,8 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_ req->token = wine_server_obj_handle( token ); req->debug = wine_server_obj_handle( debug ); req->parent_process = wine_server_obj_handle( parent ); - req->flags = process_flags; + req->process_flags = process_flags; + req->thread_flags = thread_flags; req->socket_fd = socketfd[1]; req->access = process_access; req->machine = machine; diff --git a/server/process.c b/server/process.c index b30c835f74f..50cd140c8c6 100644 --- a/server/process.c +++ b/server/process.c @@ -1202,7 +1202,7 @@ DECL_HANDLER(new_process) /* If a job further in the job chain does not permit breakaway process creation * succeeds and the process which is trying to breakaway is assigned to that job. */ - if (parent->job && (req->flags & PROCESS_CREATE_FLAGS_BREAKAWAY) && + if (parent->job && (req->process_flags & PROCESS_CREATE_FLAGS_BREAKAWAY) && !(parent->job->limit_flags & (JOB_OBJECT_LIMIT_BREAKAWAY_OK | JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK))) { set_error( STATUS_ACCESS_DENIED ); @@ -1320,18 +1320,19 @@ DECL_HANDLER(new_process) goto done; } - if (!(process = create_process( socket_fd, parent, req->flags, info->data, sd, + if (!(process = create_process( socket_fd, parent, req->process_flags, info->data, sd, handles, req->handles_size / sizeof(*handles), token ))) goto done; process->machine = req->machine; process->startup_info = (struct startup_info *)grab_object( info ); + process->thread_flags = req->thread_flags; job = parent->job; while (job) { if (!(job->limit_flags & JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK) - && !(req->flags & PROCESS_CREATE_FLAGS_BREAKAWAY + && !(req->process_flags & PROCESS_CREATE_FLAGS_BREAKAWAY && job->limit_flags & JOB_OBJECT_LIMIT_BREAKAWAY_OK)) { add_job_process( job, process ); @@ -1361,7 +1362,7 @@ DECL_HANDLER(new_process) info->data->console = duplicate_handle( parent, info->data->console, process, 0, 0, DUPLICATE_SAME_ACCESS ); - if (!(req->flags & PROCESS_CREATE_FLAGS_INHERIT_HANDLES) && info->data->console != 1) + if (!(req->process_flags & PROCESS_CREATE_FLAGS_INHERIT_HANDLES) && info->data->console != 1) { info->data->hstdin = duplicate_handle( parent, info->data->hstdin, process, 0, 0, DUPLICATE_SAME_ACCESS | DUPLICATE_SAME_ATTRIBUTES ); @@ -1378,7 +1379,7 @@ DECL_HANDLER(new_process) if (debug_obj) { process->debug_obj = debug_obj; - process->debug_children = !(req->flags & PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT); + process->debug_children = !(req->process_flags & PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT); } else if (parent->debug_children) { diff --git a/server/process.h b/server/process.h index 5c136fb5103..5c49daab3f0 100644 --- a/server/process.h +++ b/server/process.h @@ -53,6 +53,7 @@ struct process int unix_pid; /* Unix pid for final SIGKILL */ int exit_code; /* process exit code */ int running_threads; /* number of threads running in this process */ + unsigned int thread_flags; /* first thread flags */ timeout_t start_time; /* absolute time at process start */ timeout_t end_time; /* absolute time at process end */ affinity_t affinity; /* process affinity mask */ diff --git a/server/protocol.def b/server/protocol.def index 0ac64297026..36e6230ebf6 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1087,7 +1087,8 @@ typedef volatile struct obj_handle_t token; /* process token */ obj_handle_t debug; /* process debug object */ obj_handle_t parent_process; /* parent process */ - unsigned int flags; /* process creation flags */ + unsigned int process_flags; /* process creation flags */ + unsigned int thread_flags; /* process creation flags */ int socket_fd; /* file descriptor for process socket */ unsigned int access; /* access rights for process object */ unsigned short machine; /* architecture that the new process will use */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10058