Commit d3928317 authored by Alexandre Julliard's avatar Alexandre Julliard

Increment suspend count before attempting attach in suspend_for_ptrace.

parent ef88637f
...@@ -166,12 +166,12 @@ int suspend_for_ptrace( struct thread *thread ) ...@@ -166,12 +166,12 @@ int suspend_for_ptrace( struct thread *thread )
suspend_thread( thread, 0 ); suspend_thread( thread, 0 );
return 1; return 1;
} }
if (attach_thread( thread )) /* can't stop a thread while initialisation is in progress */
{ if (!thread->unix_pid || thread->process->init_event) goto error;
/* the attach will have suspended it */ thread->suspend++;
thread->suspend++; if (attach_thread( thread )) return 1;
return 1; thread->suspend--;
} error:
set_error( STATUS_ACCESS_DENIED ); set_error( STATUS_ACCESS_DENIED );
return 0; return 0;
} }
......
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