system.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. //
  12. //sys NtQuerySystemInformation(systemInfoClass int, systemInformation unsafe.Pointer, systemInfoLength uint32, returnLength *uint32) (status uint32) = ntdll.NtQuerySystemInformation
  13. type SYSTEM_PROCESS_INFORMATION struct {
  14. NextEntryOffset uint32 // ULONG
  15. NumberOfThreads uint32 // ULONG
  16. WorkingSetPrivateSize int64 // LARGE_INTEGER
  17. HardFaultCount uint32 // ULONG
  18. NumberOfThreadsHighWatermark uint32 // ULONG
  19. CycleTime uint64 // ULONGLONG
  20. CreateTime int64 // LARGE_INTEGER
  21. UserTime int64 // LARGE_INTEGER
  22. KernelTime int64 // LARGE_INTEGER
  23. ImageName UnicodeString // UNICODE_STRING
  24. BasePriority int32 // KPRIORITY
  25. UniqueProcessID windows.Handle // HANDLE
  26. InheritedFromUniqueProcessID windows.Handle // HANDLE
  27. HandleCount uint32 // ULONG
  28. SessionID uint32 // ULONG
  29. UniqueProcessKey *uint32 // ULONG_PTR
  30. PeakVirtualSize uintptr // SIZE_T
  31. VirtualSize uintptr // SIZE_T
  32. PageFaultCount uint32 // ULONG
  33. PeakWorkingSetSize uintptr // SIZE_T
  34. WorkingSetSize uintptr // SIZE_T
  35. QuotaPeakPagedPoolUsage uintptr // SIZE_T
  36. QuotaPagedPoolUsage uintptr // SIZE_T
  37. QuotaPeakNonPagedPoolUsage uintptr // SIZE_T
  38. QuotaNonPagedPoolUsage uintptr // SIZE_T
  39. PagefileUsage uintptr // SIZE_T
  40. PeakPagefileUsage uintptr // SIZE_T
  41. PrivatePageCount uintptr // SIZE_T
  42. ReadOperationCount int64 // LARGE_INTEGER
  43. WriteOperationCount int64 // LARGE_INTEGER
  44. OtherOperationCount int64 // LARGE_INTEGER
  45. ReadTransferCount int64 // LARGE_INTEGER
  46. WriteTransferCount int64 // LARGE_INTEGER
  47. OtherTransferCount int64 // LARGE_INTEGER
  48. }