Commit 6c0ecd09 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

server: Debugging our own process is disallowed.

parent de6a0a86
......@@ -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);
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment