NTSTATUS
ZwSetInformationThread(
IN HANDLE ThreadHandle,
IN THREADINFOCLASS ThreadInformationClass,
IN PVOID ThreadInformation,
IN ULONG ThreadInformationLength
);
ZwSetInformationThread can be called to set the priority of a thread for which the caller has a handle.
ZwSetInformationThread returns STATUS_SUCCESS or an error status, such as STATUS_INFO_LENGTH_MISMATCH or STATUS_INVALID_PARAMETER.
ZwSetInformationThread can be called by higher-level drivers to set the priority of a thread for which they have a handle.
The caller must have THREAD_SET_INFORMATION access rights for the given thread in order to call this routine.
Usually, device and intermediate drivers that set up driver-created threads call KeSetBasePriorityThread or KeSetPriorityThread from their driver-created threads, rather than ZwSetInformationThread. However, a driver can call ZwSetInformationThread to raise the priority of a driver-created thread before that thread is run.
Callers of ZwSetInformationThread must be running at IRQL PASSIVE_LEVEL.
KeSetBasePriorityThread, KeSetPriorityThread, PsCreateSystemThread