Fixed DEBUG_ONLY_THIS_PROCESS again (thanks to Ulrich Weigand).

oldstable
Alexandre Julliard 1999-11-29 02:10:56 +00:00
parent ad47a30f5e
commit d083a7bd0c
3 changed files with 14 additions and 14 deletions

View File

@ -533,11 +533,6 @@ PDB *PROCESS_Create( NE_MODULE *pModule, LPCSTR cmd_line, LPCSTR env,
info->hThread = info->hProcess = INVALID_HANDLE_VALUE;
if (!(load_done_evt = CreateEventA( NULL, TRUE, FALSE, NULL ))) goto error;
/* the DEBUG_ONLY_THIS_PROCESS flag seems simply equivalent
* to DEBUG_PROCESS, contrary to Microsoft documentation (surprised?) */
if (flags & DEBUG_ONLY_THIS_PROCESS)
flags = (flags & ~DEBUG_ONLY_THIS_PROCESS) | DEBUG_PROCESS;
/* Create the process on the server side */
req->inherit = (psa && (psa->nLength >= sizeof(*psa)) && psa->bInheritHandle);

View File

@ -67,12 +67,21 @@ static struct process *create_process( struct process *parent, struct new_proces
process->priority = NORMAL_PRIORITY_CLASS;
process->affinity = 1;
process->suspend = 0;
process->create_flags = 0;
process->console_in = NULL;
process->console_out = NULL;
process->init_event = NULL;
process->info = NULL;
gettimeofday( &process->start_time, NULL );
/* copy the request structure */
if (!(process->info = mem_alloc( sizeof(*process->info) + len ))) goto error;
memcpy( process->info, req, sizeof(*req) );
memcpy( process->info->cmdline, cmd_line, len );
process->info->cmdline[len] = 0;
req = process->info; /* use the copy now */
process->create_flags = req->create_flags;
if (req->inherit_all)
process->handles = copy_handle_table( process, parent );
else
@ -82,11 +91,6 @@ static struct process *create_process( struct process *parent, struct new_proces
/* alloc a handle for the process itself */
alloc_handle( process, process, PROCESS_ALL_ACCESS, 0 );
if (!(process->info = mem_alloc( sizeof(*process->info) + len ))) goto error;
memcpy( process->info, req, sizeof(*req) );
memcpy( process->info->cmdline, cmd_line, len );
process->info->cmdline[len] = 0;
/* get the init done event */
if (req->event != -1)
{
@ -95,11 +99,11 @@ static struct process *create_process( struct process *parent, struct new_proces
}
/* set the process console */
if (req->create_flags & CREATE_NEW_CONSOLE)
if (process->create_flags & CREATE_NEW_CONSOLE)
{
if (!alloc_console( process )) goto error;
}
else if (!(req->create_flags & DETACHED_PROCESS))
else if (!(process->create_flags & DETACHED_PROCESS))
{
if (parent->console_in) process->console_in = grab_object( parent->console_in );
if (parent->console_out) process->console_out = grab_object( parent->console_out );
@ -116,9 +120,9 @@ static struct process *create_process( struct process *parent, struct new_proces
}
/* attach to the debugger if requested */
if (req->create_flags & DEBUG_PROCESS)
if (process->create_flags & (DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS))
debugger_attach( process, current );
else if (parent && parent->debugger && !(req->create_flags & DEBUG_ONLY_THIS_PROCESS))
else if (parent && parent->debugger && !(parent->create_flags & DEBUG_ONLY_THIS_PROCESS))
debugger_attach( process, parent->debugger );
if ((process->next = first_process) != NULL) process->next->prev = process;

View File

@ -30,6 +30,7 @@ struct process
int priority; /* priority class */
int affinity; /* process affinity mask */
int suspend; /* global process suspend count */
int create_flags; /* process creation flags */
struct object *console_in; /* console input */
struct object *console_out; /* console output */
struct event *init_event; /* event for init done */