Commit b92c82c9 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

server: Add support for NtTerminateProcess(0).

parent c5fbb4a7
......@@ -1105,11 +1105,6 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param)
ret = GetExitCodeThread(attached_thread[i], &code);
trace("dll: GetExitCodeThread(%u) => %d,%u\n", i, ret, code);
ok(ret == 1, "GetExitCodeThread returned %d, expected 1\n", ret);
/* FIXME: remove once Wine is fixed */
if (expected_code == STILL_ACTIVE || expected_code == 196)
ok(code == expected_code, "expected thread exit code %u, got %u\n", expected_code, code);
else
todo_wine
ok(code == expected_code, "expected thread exit code %u, got %u\n", expected_code, code);
}
......@@ -1230,7 +1225,6 @@ static void child_process(const char *dll_name, DWORD target_offset)
ok(!ret, "RtlDllShutdownInProgress returned %d\n", ret);
status = pNtTerminateProcess(0, 195);
todo_wine
ok(!status, "NtTerminateProcess error %#x\n", status);
ret = pRtlDllShutdownInProgress();
......@@ -1239,7 +1233,7 @@ static void child_process(const char *dll_name, DWORD target_offset)
break;
case 1:
case 2: /* ExitProcces will be called by PROCESS_DETACH handler */
case 2: /* ExitProcess will be called by PROCESS_DETACH handler */
ret = pRtlDllShutdownInProgress();
ok(!ret, "RtlDllShutdownInProgress returned %d\n", ret);
......@@ -1283,11 +1277,6 @@ static void child_process(const char *dll_name, DWORD target_offset)
ret = GetExitCodeThread(attached_thread[i], &code);
trace("child: GetExitCodeThread(%u) => %d,%u\n", i, ret, code);
ok(ret == 1, "GetExitCodeThread returned %d, expected 1\n", ret);
/* FIXME: remove once Wine is fixed */
if (expected_code == STILL_ACTIVE || expected_code == 196)
ok(code == expected_code, "expected thread exit code %u, got %u\n", expected_code, code);
else
todo_wine
ok(code == expected_code, "expected thread exit code %u, got %u\n", expected_code, code);
}
......
......@@ -60,7 +60,7 @@ NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code )
self = !ret && reply->self;
}
SERVER_END_REQ;
if (self) exit( exit_code );
if (self && handle) exit( exit_code );
return ret;
}
......
......@@ -1082,12 +1082,16 @@ DECL_HANDLER(terminate_process)
{
struct process *process;
if ((process = get_process_from_handle( req->handle, PROCESS_TERMINATE )))
if (req->handle)
{
process = get_process_from_handle( req->handle, PROCESS_TERMINATE );
if (!process) return;
}
else process = (struct process *)grab_object( current->process );
reply->self = (current->process == process);
terminate_process( process, current, req->exit_code );
release_object( process );
}
}
/* fetch information about a 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