Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

185 lines
4.4 KiB

  1. #define dwPerfDataIncrease 0x1000
  2. #define AllocatePerfData() (MemoryAllocate (STARTING_SYSINFO_SIZE))
  3. // Messages for the perf data collection thread
  4. #define WM_GET_PERF_DATA (WM_USER + 102)
  5. #define WM_FREE_SYSTEM (WM_USER + 103)
  6. // State for perf data collection
  7. #define WAIT_FOR_PERF_DATA 0x0010
  8. #define PERF_DATA_READY 0x0011
  9. #define PERF_DATA_FAIL 0x0012
  10. #define IDLE_STATE 0x0013
  11. //==========================================================================//
  12. // Macros //
  13. //==========================================================================//
  14. #define IsLocalComputer(a) (!lstrcmp(a,LocalComputerName))
  15. #define IsRemoteComputer(a) (!IsLocalComputer(a))
  16. //==========================================================================//
  17. // Exported Functions //
  18. //==========================================================================//
  19. #if 0
  20. PPERFOBJECT FirstObject (PPERFDATA pPerfData) ;
  21. PPERFOBJECT NextObject (PPERFOBJECT pObject) ;
  22. PERF_COUNTER_DEFINITION *
  23. FirstCounter(
  24. PERF_OBJECT_TYPE *pObjectDef) ;
  25. PERF_COUNTER_DEFINITION *
  26. NextCounter(
  27. PERF_COUNTER_DEFINITION *pCounterDef) ;
  28. #endif
  29. #define FirstObject(pPerfData) \
  30. ((PPERFOBJECT) ((PBYTE) pPerfData + pPerfData->HeaderLength))
  31. #define NextObject(pObject) \
  32. ((PPERFOBJECT) ((PBYTE) pObject + pObject->TotalByteLength))
  33. #define FirstCounter(pObjectDef) \
  34. ((PERF_COUNTER_DEFINITION *) ((PCHAR)pObjectDef + pObjectDef->HeaderLength))
  35. #define NextCounter(pCounterDef) \
  36. ((PERF_COUNTER_DEFINITION *) ((PCHAR)pCounterDef + pCounterDef->ByteLength))
  37. void
  38. GetInstanceNameStr (PPERFINSTANCEDEF pInstance,
  39. LPTSTR lpszInstance);
  40. LPTSTR
  41. GetInstanceName (PPERFINSTANCEDEF pInstance) ;
  42. void
  43. GetPerfComputerName(PPERFDATA pPerfData,
  44. LPTSTR szComputerName) ;
  45. PERF_INSTANCE_DEFINITION *GetInstanceByName(
  46. PERF_DATA_BLOCK *pDataBlock,
  47. PERF_OBJECT_TYPE UNALIGNED *pObjectDef,
  48. LPTSTR pInstanceName,
  49. LPTSTR pParentName,
  50. DWORD dwIndex) ;
  51. PERF_INSTANCE_DEFINITION *GetInstanceByUniqueID(
  52. PERF_OBJECT_TYPE UNALIGNED *pObjectDef,
  53. LONG UniqueID,
  54. DWORD dwIndex) ;
  55. HKEY OpenSystemPerfData (IN LPCTSTR lpszSystem) ;
  56. LONG GetSystemPerfData (
  57. IN HKEY hKeySystem,
  58. IN LPTSTR lpszValue,
  59. OUT PPERFDATA pPerfData,
  60. OUT SIZE_T * pdwPerfDataLen
  61. );
  62. BOOL CloseSystemPerfData (HKEY hKeySystem) ;
  63. int CBLoadObjects (HWND hWndCB,
  64. PPERFDATA pPerfData,
  65. PPERFSYSTEM pSysInfo,
  66. DWORD dwDetailLevel,
  67. LPTSTR lpszDefaultObject,
  68. BOOL bIncludeAll) ;
  69. int LBLoadObjects (HWND hWndCB,
  70. PPERFDATA pPerfData,
  71. PPERFSYSTEM pSysInfo,
  72. DWORD dwDetailLevel,
  73. LPTSTR lpszDefaultObject,
  74. BOOL bIncludeAll) ;
  75. BOOL UpdateSystemData (PPERFSYSTEM pSystem,
  76. PPERFDATA *ppPerfData) ;
  77. BOOL UpdateLinesForSystem (LPTSTR lpszSystem,
  78. PPERFDATA pPerfData,
  79. PLINE pLineFirst,
  80. PPERFSYSTEM pSystem) ;
  81. BOOL FailedLinesForSystem (LPTSTR lpszSystem,
  82. PPERFDATA pPerfData,
  83. PLINE pLineFirst) ;
  84. BOOL UpdateLines (PPPERFSYSTEM ppSystemFirst,
  85. PLINE pLineFirst) ;
  86. BOOL PerfDataInitializeInstance (void) ;
  87. DWORD
  88. QueryPerformanceName(
  89. PPERFSYSTEM pSysInfo,
  90. DWORD dwTitleIndex,
  91. LANGID LangID,
  92. DWORD cbTitle,
  93. LPTSTR lpTitle,
  94. BOOL Help
  95. );
  96. PERF_INSTANCE_DEFINITION *
  97. FirstInstance(
  98. PERF_OBJECT_TYPE UNALIGNED *pObjectDef) ;
  99. PERF_INSTANCE_DEFINITION *
  100. NextInstance(
  101. PERF_INSTANCE_DEFINITION *pInstDef) ;
  102. int CounterIndex (PPERFCOUNTERDEF pCounterToFind,
  103. PERF_OBJECT_TYPE UNALIGNED *pObject) ;
  104. DWORD GetSystemNames(PPERFSYSTEM pSysInfo) ;
  105. PERF_OBJECT_TYPE *GetObjectDefByTitleIndex(
  106. PERF_DATA_BLOCK *pDataBlock,
  107. DWORD ObjectTypeTitleIndex) ;
  108. PERF_OBJECT_TYPE *GetObjectDefByName(
  109. PPERFSYSTEM pSystem,
  110. PERF_DATA_BLOCK *pDataBlock,
  111. LPTSTR pObjectName) ;
  112. DWORD GetObjectIdByName(
  113. PPERFSYSTEM pSystem,
  114. PERF_DATA_BLOCK *pDataBlock,
  115. LPTSTR pObjectName) ;
  116. LPTSTR
  117. InstanceName(
  118. PERF_INSTANCE_DEFINITION *pInstDef) ;
  119. void PerfDataThread (PPERFSYSTEM pSystem) ;