aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorviri <hi@viri.moe>2022-01-15 17:35:30 -0600
committerviri <hi@viri.moe>2022-01-15 17:46:33 -0600
commit12d6bcec029dbb11bd533d0d0f0cc723aa71bc9d (patch)
tree4d90a3054bed24f5fcc24276a872bba1c4cc2b20 /lib
parent3c2eddae5a4e89ec428a7b3b9f089c32f57b17af (diff)
downloadzig-12d6bcec029dbb11bd533d0d0f0cc723aa71bc9d.tar.gz
zig-12d6bcec029dbb11bd533d0d0f0cc723aa71bc9d.zip
std.os.windows: add ntdll thread information APIs
Diffstat (limited to 'lib')
-rw-r--r--lib/std/os/windows/ntdll.zig65
1 files changed, 65 insertions, 0 deletions
diff --git a/lib/std/os/windows/ntdll.zig b/lib/std/os/windows/ntdll.zig
index 1154558d4d..26cc19935f 100644
--- a/lib/std/os/windows/ntdll.zig
+++ b/lib/std/os/windows/ntdll.zig
@@ -23,6 +23,71 @@ const FILE_BASIC_INFORMATION = windows.FILE_BASIC_INFORMATION;
const SIZE_T = windows.SIZE_T;
const CURDIR = windows.CURDIR;
+pub const THREADINFOCLASS = enum(c_int) {
+ ThreadBasicInformation,
+ ThreadTimes,
+ ThreadPriority,
+ ThreadBasePriority,
+ ThreadAffinityMask,
+ ThreadImpersonationToken,
+ ThreadDescriptorTableEntry,
+ ThreadEnableAlignmentFaultFixup,
+ ThreadEventPair_Reusable,
+ ThreadQuerySetWin32StartAddress,
+ ThreadZeroTlsCell,
+ ThreadPerformanceCount,
+ ThreadAmILastThread,
+ ThreadIdealProcessor,
+ ThreadPriorityBoost,
+ ThreadSetTlsArrayAddress,
+ ThreadIsIoPending,
+ // Windows 2000+ from here
+ ThreadHideFromDebugger,
+ // Windows XP+ from here
+ ThreadBreakOnTermination,
+ ThreadSwitchLegacyState,
+ ThreadIsTerminated,
+ // Windows Vista+ from here
+ ThreadLastSystemCall,
+ ThreadIoPriority,
+ ThreadCycleTime,
+ ThreadPagePriority,
+ ThreadActualBasePriority,
+ ThreadTebInformation,
+ ThreadCSwitchMon,
+ // Windows 7+ from here
+ ThreadCSwitchPmu,
+ ThreadWow64Context,
+ ThreadGroupInformation,
+ ThreadUmsInformation,
+ ThreadCounterProfiling,
+ ThreadIdealProcessorEx,
+ // Windows 8+ from here
+ ThreadCpuAccountingInformation,
+ // Windows 8.1+ from here
+ ThreadSuspendCount,
+ // Windows 10+ from here
+ ThreadHeterogeneousCpuPolicy,
+ ThreadContainerId,
+ ThreadNameInformation,
+ ThreadSelectedCpuSets,
+ ThreadSystemThreadInformation,
+ ThreadActualGroupAffinity,
+};
+pub extern "ntdll" fn NtQueryInformationThread(
+ ThreadHandle: HANDLE,
+ ThreadInformationClass: THREADINFOCLASS,
+ ThreadInformation: *anyopaque,
+ ThreadInformationLength: ULONG,
+ ReturnLength: ?*ULONG,
+) callconv(WINAPI) NTSTATUS;
+pub extern "ntdll" fn NtSetInformationThread(
+ ThreadHandle: HANDLE,
+ ThreadInformationClass: THREADINFOCLASS,
+ ThreadInformation: *const anyopaque,
+ ThreadInformationLength: ULONG,
+) callconv(WINAPI) NTSTATUS;
+
pub extern "ntdll" fn RtlGetVersion(
lpVersionInformation: *RTL_OSVERSIONINFOW,
) callconv(WINAPI) NTSTATUS;