system.go 2.5 KB

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