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.

171 lines
4.0 KiB

  1. /*++
  2. Copyright (C) 1995-2001 Microsoft Corporation
  3. Module Name:
  4. PROVPERF.H
  5. Abstract:
  6. Declares the classes needed for the perm monitor provider.
  7. History:
  8. a-davj 27-Nov-95 Created.
  9. --*/
  10. #ifndef _PROVPERF_H_
  11. #define _PROVPERF_H_
  12. #include <winperf.h>
  13. #include "perfprov.h"
  14. #include "impdyn.h"
  15. #include "cfdyn.h"
  16. #include "perfcach.h"
  17. #include "indexcac.h"
  18. //***************************************************************************
  19. //
  20. // CLASS NAME:
  21. //
  22. // CEnumPerfInfo
  23. //
  24. // DESCRIPTION:
  25. //
  26. // A collection class that holds the instance information for use when
  27. // support enumeration.
  28. //
  29. //***************************************************************************
  30. class CEnumPerfInfo : public CEnumInfo
  31. {
  32. public:
  33. CEnumPerfInfo();
  34. ~CEnumPerfInfo();
  35. void AddEntry(LPWSTR pNew);
  36. LPWSTR GetEntry(int iIndex);
  37. int GetNumDuplicates(LPWSTR pwcTest);
  38. SCODE GetStatus(void){return m_status;};
  39. private:
  40. int m_iNumUniChar;
  41. int m_iNumEntries;
  42. LPWSTR m_pBuffer;
  43. SCODE m_status;
  44. };
  45. //***************************************************************************
  46. //
  47. // CLASS NAME:
  48. //
  49. // CImpPerf
  50. //
  51. // DESCRIPTION:
  52. //
  53. // This overrides the CImpDyn class and provides the main functions of
  54. // support the perf monitor instance provider.
  55. //
  56. //***************************************************************************
  57. class CImpPerf : public CImpDyn
  58. {
  59. public:
  60. friend DWORD CleanUpThreadRoutine( LPDWORD pParam );
  61. CImpPerf();
  62. ~CImpPerf();
  63. int iGetMinTokens(void){return 3;};
  64. SCODE RefreshProperty(long lFlags, IWbemClassObject FAR * pClassInt,
  65. BSTR PropName,CProvObj & ProvObj,CObject * pPackage,
  66. CVariant * pVar, BOOL bTesterDetails);
  67. SCODE UpdateProperty(long lFlags, IWbemClassObject FAR * pClassInt,
  68. BSTR PropName,CProvObj & ProvObj,CObject * pPackage,
  69. CVariant * pVar);
  70. SCODE LoadData(CProvObj & ProvObj,LINESTRUCT * pls,int * piObject,
  71. int * piCounter, PERF_DATA_BLOCK **ppNew, BOOL bJustGettingInstances);
  72. SCODE MakeEnum(IWbemClassObject * pClass, CProvObj & ProvObj,
  73. CEnumInfo ** ppInfo);
  74. SCODE GetKey(CEnumInfo * pInfo, int iIndex, LPWSTR * ppKey);
  75. virtual void FreeStuff(void);
  76. DWORD GetPerfTitleSz ();
  77. DWORD dwGetRegHandles(const TCHAR * pMachine);
  78. int iGetTitleIndex(const TCHAR * pSearch);
  79. SCODE FindData(PERF_DATA_BLOCK * pData,int iObj, int iCount,CProvObj & ProvObj,DWORD * pdwSize,
  80. void **ppRetData,PLINESTRUCT pls, BOOL bNew,CEnumPerfInfo * pInfo);
  81. SCODE MergeStrings(LPWSTR *ppOut,LPWSTR pClassContext,LPWSTR pKey,LPWSTR pPropContext);
  82. private:
  83. HANDLE hExec;
  84. PerfCache Cache;
  85. HKEY hKeyMachine;
  86. DWORD dwLastTimeUsed;
  87. HKEY hKeyPerf;
  88. TString sMachine;
  89. HANDLE m_hTermEvent;
  90. LPTSTR TitleBuffer; // raw buffer of counter titles
  91. CIndexCache m_IndexCache;
  92. };
  93. //***************************************************************************
  94. //
  95. // CLASS NAME:
  96. //
  97. // CCFPerf
  98. //
  99. // DESCRIPTION:
  100. //
  101. // Class factory for CLocatorPerf class
  102. //
  103. //***************************************************************************
  104. class CCFPerf : public CCFDyn
  105. {
  106. public:
  107. IUnknown * CreateImpObj() {return (IWbemServices*) new CImpPerf;};
  108. } ;
  109. //***************************************************************************
  110. //
  111. // CLASS NAME:
  112. //
  113. // CImpPerfProp
  114. //
  115. // DESCRIPTION:
  116. //
  117. // Perf Provider property provider class.
  118. //
  119. //***************************************************************************
  120. class CImpPerfProp : public CImpDynProp {
  121. public:
  122. CImpPerfProp();
  123. ~CImpPerfProp();
  124. };
  125. //***************************************************************************
  126. //
  127. // CLASS NAME:
  128. //
  129. // CCFPerfProp
  130. //
  131. // DESCRIPTION:
  132. //
  133. // Class factory for CImpPerfProp class.
  134. //
  135. //***************************************************************************
  136. class CCFPerfProp : public CCFDyn
  137. {
  138. public:
  139. IUnknown * CreateImpObj() {return new CImpPerfProp();};
  140. } ;
  141. #endif //_PROVPERF_H_