PsTerminateSystemThread

NTSTATUS
PsTerminateSystemThread(

IN NTSTATUS ExitStatus
);

PsTerminateSystemThread terminates a caller-created system thread.

Parameters

ExitStatus

Specifies the status of the terminating system thread to the thread creator.

Return Value

PsTerminateSystemThread returns the STATUS_XXX supplied by the caller-created thread, usually STATUS_SUCCESS.

Comments

Drivers that create a device-dedicated thread call this routine, either when the driver is unloaded or when there are no outstanding I/O requests for the driver to process. For such a driver, PsTerminateSystemThread must be called in the context of the driver's thread; that is, the driver-created thread must terminate itself by making this call.

Callers of this routine must be running at IRQL PASSIVE_LEVEL.

See Also

PsCreateSystemThread