PsTerminateSystemThread function

The PsTerminateSystemThread routine terminates the current system thread.

Syntax

NTSTATUS PsTerminateSystemThread(
  NTSTATUS ExitStatus
);

Parameters

ExitStatus

Specifies the status of the terminating system thread.

Return Value

PsTerminateSystemThread does not return if it successfully terminates the calling thread. If the routine cannot terminate the thread (for example, if the thread is not a system thread), the routine returns an error NTSTATUS value.

Remarks

A system thread calls PsTerminateSystemThread to terminate itself. A driver that creates its own threads must ensure that each such thread terminates. The driver must not terminate any threads that the system or other drivers created.

Requirements

   
Minimum supported client Available starting with Windows 2000.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL
DDI compliance rules IrqlPsPassive, PowerIrpDDis, HwStorPortProhibitedDDIs

See Also

PsCreateSystemThread