TerminateJobObject

[This is preliminary documentation and subject to change.]

The TerminateJobObject function terminates all processes currently associated with the job.

BOOL TerminateJobObject(
  HANDLE hJob,
  UINT uExitCode
);
 

Parameters

hJob
Handle to the job whose processes will be terminated. The CreateJobObject or OpenJobObject function returns this handle. This handle must have the JOB_OBJECT_TERMINATE access right.
uExitCode
Specifies the exit code for the processes and threads terminated as a result of this call.

Return Values

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.

Remarks

It is not possible for any of the processes associated with the job to postpone or handle the termination. It is as if TerminateProcess were called for each process associated with the job.

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in winbase.h.
  Import Library: Use kernel32.lib.

See Also

Processes and Threads Overview, Process and Thread Functions, CreateJobObject, OpenJobObject, TerminateProcess