server: Debugging our own process is disallowed.

This commit is contained in:
Henri Verbeet 2010-03-14 21:53:19 +01:00 committed by Alexandre Julliard
parent de6a0a86be
commit 6c0ecd0955
2 changed files with 4 additions and 0 deletions

View File

@ -537,6 +537,9 @@ static void test_debug_loop(int argc, char **argv)
}
pid = GetCurrentProcessId();
ret = DebugActiveProcess(pid);
ok(!ret, "DebugActiveProcess() succeeded on own process.\n");
get_file_name(blackbox_file);
cmd = HeapAlloc(GetProcessHeap(), 0, strlen(argv[0]) + strlen(arguments) + strlen(blackbox_file) + 10);
sprintf(cmd, "%s%s%08x %s", argv[0], arguments, pid, blackbox_file);

View File

@ -421,6 +421,7 @@ void generate_debug_event( struct thread *thread, int code, const void *arg )
static int debugger_attach( struct process *process, struct thread *debugger )
{
if (process->debugger) goto error; /* already being debugged */
if (debugger->process == process) goto error;
if (!is_process_init_done( process )) goto error; /* still starting up */
if (list_empty( &process->thread_list )) goto error; /* no thread running in the process */