INtime SDK Help
TerminateProcess, RtTerminateProcess (iwin32)
INtime SDK v7 > About INtime > Alternate APIs > iwin32 API > iwin32 API > TerminateProcess, RtTerminateProcess (iwin32)

Terminates the specified process.

BOOLEAN TerminateProcess(
    HANDLE hProcess,
    UINT uExitCode
);

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 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 GetExitCodeProcess. To retrieve a thread's exit value, call GetExitCodeThread.

Return Values

Non-zero
Success.
0 (zero)
Failure. For extended error information, see GetLastError.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/iwin32.h
intime/rt/include/winbase.h
iwin32.h
windows.h
iwin32.lib

Notes

See Also

GetExitCodeProcess, GetExitCodeThread, iwin32 API, iwin32 Overview