Alexandre Julliard (@julliard) commented about server/process.c:
restart: LIST_FOR_EACH_ENTRY( thread, &process->thread_list, struct thread, proc_entry ) {
if (exit_code) thread->exit_code = exit_code;
thread->exit_code = exit_code;
This would cause the exit code to be reset if a thread had a failure during process exit for instance.