TerminateProcess

From aldeid
Jump to navigation Jump to search

Description

Terminates the specified process and all of its threads.

Syntax

BOOL WINAPI TerminateProcess(
  _In_ HANDLE hProcess,
  _In_ UINT   uExitCode
);

Parameters

hProcess [in]
A handle to the process to be terminated.
The handle must have the PROCESS_TERMINATE access right.
uExitCode [in]
The exit code to be used by the process and threads terminated as a result of this call. Use the GetExitCodeProcess function to retrieve a process's exit value. Use the GetExitCodeThread function to retrieve a thread's exit value.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.