Terminates the given process, which causes the following:
- All object handles opened by the process are closed.
- All threads in the process terminate their execution.
- The state of the process object becomes signaled, satisfying any threads that had been waiting for the process to terminate. The process object is deleted when the last handle to the process is closed.
- The states of all threads of the process become signaled, satisfying any threads that had been waiting for the threads to terminate.
- The termination status of the process changes from STILL_ACTIVE to the exit value of the process.
BOOLEAN RtTerminateProcess(
HANDLE hProcess,
UINT uExitCode
);
Parameters
hProcess
- Handle to the process to terminate.
uExitCode
- The exit code for the process and for all threads terminated as a result of this function.
Remarks
RtTerminateProcess can also be used from a Windows application to terminate an iwin32 process.
This function causes all threads within a process to terminate, causes a process to exit, and notifies each RSL that the process is terminating.
The following lists what occurs when a process terminates:
- All object handles opened by the process close.
- All threads in the process terminate execution.
- The process object state becomes signaled, satisfying any threads waiting for the process to terminate.
- The state of all process threads become signaled, satisfying threads waiting for the threads to terminate.
- Process termination status changes from STILL_ACTIVE to the process exit value.
Terminating a process does not necessarily remove the process object from the system.
A process object is deleted when the last handle to the process closes. To retrieve the process's exit value, call RtGetExitCodeProcess. To retrieve a thread's exit value, call GetExitCodeThread.
Return Values
- Non-zero
- Success.
0
(zero)
- Failure. For extended error information, see the Windows' GetLastError function.
Requirements
Versions |
Defined in |
Include |
Link to |
INtime 3.0 |
intime/nt/include/iwin32x.h |
iwin32x.h |
iwin32x.lib |
Notes
- This function operates in the Windows portion of your application.
- The iwin32 API also includes an RtTerminateProcess function that operates in the real-time portion of your application.
See Also
RtGetExitCodeProcess, GetExitCodeThread, iwin32x API, iwin32 Overview