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.

187 lines
4.3 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. PPERFCOUNTERDEF
  23. FirstCounter(
  24. PPERFOBJECT pObjectDef) ;
  25. PPERFCOUNTERDEF
  26. NextCounter(
  27. PPERFCOUNTERDEF 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. ((PPERFCOUNTERDEF ) ((PCHAR)pObjectDef + pObjectDef->HeaderLength))
  35. #define NextCounter(pCounterDef) \
  36. ((PPERFCOUNTERDEF ) ((PCHAR)pCounterDef + pCounterDef->ByteLength))
  37. void
  38. GetInstanceNameStr (PPERFINSTANCEDEF pInstance,
  39. LPTSTR lpszInstance,
  40. DWORD dwCodePage);
  41. LPTSTR
  42. GetInstanceName (PPERFINSTANCEDEF pInstance) ;
  43. void
  44. GetPerfComputerName(PPERFDATA pPerfData,
  45. LPTSTR szComputerName) ;
  46. PPERFINSTANCEDEF GetInstanceByName(
  47. PPERFDATA pDataBlock,
  48. PPERFOBJECT pObjectDef,
  49. LPTSTR pInstanceName,
  50. LPTSTR pParentName,
  51. DWORD dwIndex) ;
  52. PPERFINSTANCEDEF GetInstanceByUniqueID(
  53. PPERFOBJECT pObjectDef,
  54. LONG UniqueID,
  55. DWORD dwIndex) ;
  56. HKEY OpenSystemPerfData (IN LPCTSTR lpszSystem) ;
  57. LONG GetSystemPerfData (
  58. IN HKEY hKeySystem,
  59. IN LPTSTR lpszValue,
  60. OUT PPERFDATA pPerfData,
  61. OUT PDWORD pdwPerfDataLen
  62. );
  63. BOOL CloseSystemPerfData (HKEY hKeySystem) ;
  64. int CBLoadObjects (HWND hWndCB,
  65. PPERFDATA pPerfData,
  66. PPERFSYSTEM pSysInfo,
  67. DWORD dwDetailLevel,
  68. LPTSTR lpszDefaultObject,
  69. BOOL bIncludeAll) ;
  70. int LBLoadObjects (HWND hWndCB,
  71. PPERFDATA pPerfData,
  72. PPERFSYSTEM pSysInfo,
  73. DWORD dwDetailLevel,
  74. LPTSTR lpszDefaultObject,
  75. BOOL bIncludeAll) ;
  76. BOOL UpdateSystemData (PPERFSYSTEM pSystem,
  77. PPERFDATA *ppPerfData) ;
  78. BOOL UpdateLinesForSystem (LPTSTR lpszSystem,
  79. PPERFDATA pPerfData,
  80. PLINE pLineFirst,
  81. PPERFSYSTEM pSystem) ;
  82. BOOL FailedLinesForSystem (LPTSTR lpszSystem,
  83. PPERFDATA pPerfData,
  84. PLINE pLineFirst) ;
  85. BOOL UpdateLines (PPPERFSYSTEM ppSystemFirst,
  86. PLINE pLineFirst) ;
  87. BOOL PerfDataInitializeInstance (void) ;
  88. DWORD
  89. QueryPerformanceName(
  90. PPERFSYSTEM pSysInfo,
  91. DWORD dwTitleIndex,
  92. LANGID LangID,
  93. DWORD cbTitle,
  94. LPTSTR lpTitle,
  95. BOOL Help
  96. );
  97. PPERFINSTANCEDEF
  98. FirstInstance(
  99. PPERFOBJECT pObjectDef) ;
  100. PPERFINSTANCEDEF
  101. NextInstance(
  102. PPERFINSTANCEDEF pInstDef) ;
  103. int CounterIndex (PPERFCOUNTERDEF pCounterToFind,
  104. PPERFOBJECT pObject) ;
  105. DWORD GetSystemNames(PPERFSYSTEM pSysInfo) ;
  106. PPERFOBJECT GetObjectDefByTitleIndex(
  107. PPERFDATA pDataBlock,
  108. DWORD ObjectTypeTitleIndex) ;
  109. PPERFOBJECT GetObjectDefByName(
  110. PPERFSYSTEM pSystem,
  111. PPERFDATA pDataBlock,
  112. LPTSTR pObjectName) ;
  113. DWORD GetObjectIdByName(
  114. PPERFSYSTEM pSystem,
  115. PPERFDATA pDataBlock,
  116. LPTSTR pObjectName) ;
  117. LPTSTR
  118. InstanceName(
  119. PPERFINSTANCEDEF pInstDef) ;
  120. void PerfDataThread (PPERFSYSTEM pSystem) ;
  121. 
  122.