perfdata.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * ReactOS Task Manager
  3. *
  4. * perfdata.h
  5. *
  6. * Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  21. */
  22. #ifndef __PERFDATA_H
  23. #define __PERFDATA_H
  24. #include "winternl.h"
  25. typedef ULARGE_INTEGER TIME;
  26. typedef struct _PERFDATA
  27. {
  28. WCHAR ImageName[MAX_PATH];
  29. ULONG ProcessId;
  30. WCHAR UserName[MAX_PATH];
  31. ULONG SessionId;
  32. ULONG CPUUsage;
  33. TIME CPUTime;
  34. ULONG BasePriority;
  35. ULONG HandleCount;
  36. ULONG ThreadCount;
  37. ULONG USERObjectCount;
  38. ULONG GDIObjectCount;
  39. SIZE_T WorkingSetSizeDelta;
  40. ULONG PageFaultCountDelta;
  41. VM_COUNTERS vmCounters;
  42. IO_COUNTERS IOCounters;
  43. TIME UserTime;
  44. TIME KernelTime;
  45. BOOL Wow64Process;
  46. } PERFDATA, *PPERFDATA;
  47. /* SystemPageFileInformation (18) */
  48. typedef
  49. struct _SYSTEM_PAGEFILE_INFORMATION
  50. {
  51. ULONG RelativeOffset;
  52. ULONG CurrentSizePages;
  53. ULONG TotalUsedPages;
  54. ULONG PeakUsedPages;
  55. UNICODE_STRING PagefileFileName;
  56. } SYSTEM_PAGEFILE_INFORMATION, *PSYSTEM_PAGEFILE_INFORMATION;
  57. #define Li2Double(x) ((double)((x).QuadPart))
  58. #define GR_GDIOBJECTS 0 /* Count of GDI objects */
  59. #define GR_USEROBJECTS 1 /* Count of USER objects */
  60. typedef LONG (WINAPI *PROCNTQSI)(UINT,PVOID,ULONG,PULONG);
  61. typedef DWORD (WINAPI *PROCGGR)(HANDLE,DWORD);
  62. typedef BOOL (WINAPI *PROCGPIC)(HANDLE,PIO_COUNTERS);
  63. typedef BOOL (WINAPI *PROCISW64)(HANDLE,PBOOL);
  64. BOOL PerfDataInitialize(void);
  65. void PerfDataRefresh(void);
  66. ULONG PerfDataGetProcessCount(void);
  67. ULONG PerfDataGetProcessorUsage(void);
  68. ULONG PerfDataGetProcessorSystemUsage(void);
  69. BOOL PerfDataGetImageName(ULONG Index, LPWSTR lpImageName, int nMaxCount);
  70. ULONG PerfDataGetProcessId(ULONG Index);
  71. BOOL PerfDataGetUserName(ULONG Index, LPWSTR lpUserName, int nMaxCount);
  72. ULONG PerfDataGetSessionId(ULONG Index);
  73. ULONG PerfDataGetCPUUsage(ULONG Index);
  74. TIME PerfDataGetCPUTime(ULONG Index);
  75. ULONG PerfDataGetWorkingSetSizeBytes(ULONG Index);
  76. ULONG PerfDataGetPeakWorkingSetSizeBytes(ULONG Index);
  77. ULONG PerfDataGetWorkingSetSizeDelta(ULONG Index);
  78. ULONG PerfDataGetPageFaultCount(ULONG Index);
  79. ULONG PerfDataGetPageFaultCountDelta(ULONG Index);
  80. ULONG PerfDataGetVirtualMemorySizeBytes(ULONG Index);
  81. ULONG PerfDataGetPagedPoolUsagePages(ULONG Index);
  82. ULONG PerfDataGetNonPagedPoolUsagePages(ULONG Index);
  83. ULONG PerfDataGetBasePriority(ULONG Index);
  84. ULONG PerfDataGetHandleCount(ULONG Index);
  85. ULONG PerfDataGetThreadCount(ULONG Index);
  86. ULONG PerfDataGetUSERObjectCount(ULONG Index);
  87. ULONG PerfDataGetGDIObjectCount(ULONG Index);
  88. BOOL PerfDataGetIOCounters(ULONG Index, PIO_COUNTERS pIoCounters);
  89. ULONG PerfDataGetCommitChargeTotalK(void);
  90. ULONG PerfDataGetCommitChargeLimitK(void);
  91. ULONG PerfDataGetCommitChargePeakK(void);
  92. ULONG PerfDataGetKernelMemoryTotalK(void);
  93. ULONG PerfDataGetKernelMemoryPagedK(void);
  94. ULONG PerfDataGetKernelMemoryNonPagedK(void);
  95. ULONG PerfDataGetPhysicalMemoryTotalK(void);
  96. ULONG PerfDataGetPhysicalMemoryAvailableK(void);
  97. ULONG PerfDataGetPhysicalMemorySystemCacheK(void);
  98. ULONG PerfDataGetSystemHandleCount(void);
  99. ULONG PerfDataGetTotalThreadCount(void);
  100. #endif /* __PERFDATA_H */