| ... | ... | @@ -23,6 +23,71 @@ const FILE_BASIC_INFORMATION = windows.FILE_BASIC_INFORMATION; |
| 23 | 23 | const SIZE_T = windows.SIZE_T; |
| 24 | 24 | const CURDIR = windows.CURDIR; |
| 25 | 25 | |
| 26 | pub const THREADINFOCLASS = enum(c_int) { |
| 27 | ThreadBasicInformation, |
| 28 | ThreadTimes, |
| 29 | ThreadPriority, |
| 30 | ThreadBasePriority, |
| 31 | ThreadAffinityMask, |
| 32 | ThreadImpersonationToken, |
| 33 | ThreadDescriptorTableEntry, |
| 34 | ThreadEnableAlignmentFaultFixup, |
| 35 | ThreadEventPair_Reusable, |
| 36 | ThreadQuerySetWin32StartAddress, |
| 37 | ThreadZeroTlsCell, |
| 38 | ThreadPerformanceCount, |
| 39 | ThreadAmILastThread, |
| 40 | ThreadIdealProcessor, |
| 41 | ThreadPriorityBoost, |
| 42 | ThreadSetTlsArrayAddress, |
| 43 | ThreadIsIoPending, |
| 44 | // Windows 2000+ from here |
| 45 | ThreadHideFromDebugger, |
| 46 | // Windows XP+ from here |
| 47 | ThreadBreakOnTermination, |
| 48 | ThreadSwitchLegacyState, |
| 49 | ThreadIsTerminated, |
| 50 | // Windows Vista+ from here |
| 51 | ThreadLastSystemCall, |
| 52 | ThreadIoPriority, |
| 53 | ThreadCycleTime, |
| 54 | ThreadPagePriority, |
| 55 | ThreadActualBasePriority, |
| 56 | ThreadTebInformation, |
| 57 | ThreadCSwitchMon, |
| 58 | // Windows 7+ from here |
| 59 | ThreadCSwitchPmu, |
| 60 | ThreadWow64Context, |
| 61 | ThreadGroupInformation, |
| 62 | ThreadUmsInformation, |
| 63 | ThreadCounterProfiling, |
| 64 | ThreadIdealProcessorEx, |
| 65 | // Windows 8+ from here |
| 66 | ThreadCpuAccountingInformation, |
| 67 | // Windows 8.1+ from here |
| 68 | ThreadSuspendCount, |
| 69 | // Windows 10+ from here |
| 70 | ThreadHeterogeneousCpuPolicy, |
| 71 | ThreadContainerId, |
| 72 | ThreadNameInformation, |
| 73 | ThreadSelectedCpuSets, |
| 74 | ThreadSystemThreadInformation, |
| 75 | ThreadActualGroupAffinity, |
| 76 | }; |
| 77 | pub extern "ntdll" fn NtQueryInformationThread( |
| 78 | ThreadHandle: HANDLE, |
| 79 | ThreadInformationClass: THREADINFOCLASS, |
| 80 | ThreadInformation: *anyopaque, |
| 81 | ThreadInformationLength: ULONG, |
| 82 | ReturnLength: ?*ULONG, |
| 83 | ) callconv(WINAPI) NTSTATUS; |
| 84 | pub extern "ntdll" fn NtSetInformationThread( |
| 85 | ThreadHandle: HANDLE, |
| 86 | ThreadInformationClass: THREADINFOCLASS, |
| 87 | ThreadInformation: *const anyopaque, |
| 88 | ThreadInformationLength: ULONG, |
| 89 | ) callconv(WINAPI) NTSTATUS; |
| 90 | |
| 26 | 91 | pub extern "ntdll" fn RtlGetVersion( |
| 27 | 92 | lpVersionInformation: *RTL_OSVERSIONINFOW, |
| 28 | 93 | ) callconv(WINAPI) NTSTATUS; |