INtime SDK Help
RtTerminateProcess (iwin32x)
INtime SDK v7.1 > About INtime > Alternate APIs > iwin32 API > iwin32x API > RtTerminateProcess (iwin32x)

Terminates the given process, which causes the following:

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:

  1. All object handles opened by the process close.
  2. All threads in the process terminate execution.
  3. The process object state becomes signaled, satisfying any threads waiting for the process to terminate.
  4. The state of all process threads become signaled, satisfying threads waiting for the threads to terminate.
  5. 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

See Also

RtGetExitCodeProcess, GetExitCodeThread, iwin32x API, iwin32 Overview