The ZwQueryInformationThread routine retrieves information about the specified thread, such as its page priority.
NTSTATUS ZwQueryInformationThread ( _In_ HANDLE ThreadHandle, _In_ THREADINFOCLASS ThreadInformationClass, _In_ PVOID ThreadInformation, _In_ ULONG ThreadInformationLength, _Out_opt_ PULONG ReturnLength );
The type of thread information to be retrieved. This value is one of the system-defined values in the THREADINFOCLASS enumeration (see ntddk.h).
The current thread page priority.
Pointer to a buffer supplied by the caller. The format of the buffer depends on the type of information requested, as specified by the ThreadInformationClass parameter.
If ThreadInformationClass is ThreadPagePriority, the buffer is a PAGE_PRIORITY_INFORMATION structure that receives the current thread page priority, indicated by one of these values.
Value Meaning MEMORY_PRIORITY_VERY_LOW 1
Very low memory priority.
Low memory priority.
Medium memory priority.
Below normal memory priority.
Normal memory priority. This is the default priority for all threads and processes on the system.
The size, in bytes, of the buffer pointed to by ThreadInformation.
ReturnLength [out, optional]
A pointer to a ULONG variable in which the routine returns the size of the requested information. If the function was successful, this is the size of the information written to the buffer pointed to by the ThreadInformation parameter, but if the buffer was too small, this is the minimum size of buffer needed to receive the information successfully.
ZwQueryInformationThread returns STATUS_SUCCESS on success, or the appropriate NTSTATUS error code on failure. Possible error codes include STATUS_INFO_LENGTH_MISMATCH or STATUS_INVALID_PARAMETER.
A kernel-mode driver calls ZwQueryInformationThread when it wants to change the thread page priority. Typically, the driver calls the routine to determine the current thread page priority, lower it to the desired value (if necessary) by calling ZwSetInformationThread, perform the operation, and then restore the priority to the thread's original priority.
Available starting with Windows 10, version 1511.
|Ntddk.h (include Ntddk.h)|
DDI compliance rules