#ifndef _NTPSAPI_H
//
// Threads
//
#if (PHNT_MODE != PHNT_MODE_KERNEL)
/**
* Sets information for the specified thread.
*
* @param ThreadHandle A handle to the thread.
* @param ThreadInformationClass The type of thread information to be set.
* @param ThreadInformation A pointer to a buffer that contains the thread information.
* @param ThreadInformationLength The size of the buffer pointed to by the ThreadInformation parameter.
* @return NTSTATUS Successful or errant status.
*/
NTSYSCALLAPI
NTSTATUS
NTAPI
NtSetInformationThread(
_In_ HANDLE ThreadHandle,
_In_ THREADINFOCLASS ThreadInformationClass,
_In_reads_bytes_(ThreadInformationLength) PVOID ThreadInformation,
_In_ ULONG ThreadInformationLength
);
View code on GitHub
#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwSetInformationThread(
_In_ HANDLE ThreadHandle,
_In_ THREADINFOCLASS ThreadInformationClass,
_In_reads_bytes_(ThreadInformationLength) PVOID ThreadInformation,
_In_ ULONG ThreadInformationLength
);
View code on GitHub
Sets various information about the specified thread. This function is partially documented in Windows Driver Kit here and here.
ThreadHandle
- a handle to the thread or the NtCurrentThread
pseudo-handle. For most information classes, the handle must grant either THREAD_SET_INFORMATION
or THREAD_SET_LIMITED_INFORMATION
access.ThreadInformationClass
- the type of information to set.ThreadInformation
- a pointer to the buffer with the data specific to the request.ThreadInformationLength
- the size of the provided buffer in bytes.For the list of supported info classes and required thread access, see THREADINFOCLASS
.
SetThreadInformation
SetThreadIdealProcessor
SetThreadIdealProcessorEx
SetThreadDescription
SetThreadPriorityBoost
SetThreadToken
Wow64SetThreadContext