1package winapi
2
3import "golang.org/x/sys/windows"
4
5const SystemProcessInformation = 5
6
7const STATUS_INFO_LENGTH_MISMATCH = 0xC0000004
8
9// __kernel_entry NTSTATUS NtQuerySystemInformation(
10// 	SYSTEM_INFORMATION_CLASS SystemInformationClass,
11// 	PVOID                    SystemInformation,
12// 	ULONG                    SystemInformationLength,
13// 	PULONG                   ReturnLength
14// );
15//sys NtQuerySystemInformation(systemInfoClass int, systemInformation uintptr, systemInfoLength uint32, returnLength *uint32) (status uint32) = ntdll.NtQuerySystemInformation
16
17type SYSTEM_PROCESS_INFORMATION struct {
18	NextEntryOffset              uint32         // ULONG
19	NumberOfThreads              uint32         // ULONG
20	WorkingSetPrivateSize        int64          // LARGE_INTEGER
21	HardFaultCount               uint32         // ULONG
22	NumberOfThreadsHighWatermark uint32         // ULONG
23	CycleTime                    uint64         // ULONGLONG
24	CreateTime                   int64          // LARGE_INTEGER
25	UserTime                     int64          // LARGE_INTEGER
26	KernelTime                   int64          // LARGE_INTEGER
27	ImageName                    UnicodeString  // UNICODE_STRING
28	BasePriority                 int32          // KPRIORITY
29	UniqueProcessID              windows.Handle // HANDLE
30	InheritedFromUniqueProcessID windows.Handle // HANDLE
31	HandleCount                  uint32         // ULONG
32	SessionID                    uint32         // ULONG
33	UniqueProcessKey             *uint32        // ULONG_PTR
34	PeakVirtualSize              uintptr        // SIZE_T
35	VirtualSize                  uintptr        // SIZE_T
36	PageFaultCount               uint32         // ULONG
37	PeakWorkingSetSize           uintptr        // SIZE_T
38	WorkingSetSize               uintptr        // SIZE_T
39	QuotaPeakPagedPoolUsage      uintptr        // SIZE_T
40	QuotaPagedPoolUsage          uintptr        // SIZE_T
41	QuotaPeakNonPagedPoolUsage   uintptr        // SIZE_T
42	QuotaNonPagedPoolUsage       uintptr        // SIZE_T
43	PagefileUsage                uintptr        // SIZE_T
44	PeakPagefileUsage            uintptr        // SIZE_T
45	PrivatePageCount             uintptr        // SIZE_T
46	ReadOperationCount           int64          // LARGE_INTEGER
47	WriteOperationCount          int64          // LARGE_INTEGER
48	OtherOperationCount          int64          // LARGE_INTEGER
49	ReadTransferCount            int64          // LARGE_INTEGER
50	WriteTransferCount           int64          // LARGE_INTEGER
51	OtherTransferCount           int64          // LARGE_INTEGER
52}
53