PsTerminateSystemThread function (wdm.h)

The PsTerminateSystemThread routine terminates the current system thread.

Syntax

NTSTATUS PsTerminateSystemThread(
  [in] NTSTATUS ExitStatus
);

Parameters

[in] 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

Requirement Value
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 HwStorPortProhibitedDDIs(storport), IrqlPsPassive(wdm), PowerIrpDDis(wdm)

See also

PsCreateSystemThread