Leaked source code of windows server 2003
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.

175 lines
4.3 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, BOOL addDups);
  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. void EliminateRanges();
  83. void MakeAllValid();
  84. private:
  85. HANDLE hExec;
  86. PerfCache Cache;
  87. HKEY hKeyMachine;
  88. DWORD dwLastTimeUsed;
  89. HKEY hKeyPerf;
  90. TString sMachine;
  91. HANDLE m_hTermEvent;
  92. WCHAR * m_TitleBuffer; // raw buffer of counter titles
  93. DWORD m_Size;
  94. WCHAR ** m_pCounter;
  95. CIndexCache m_IndexCache;
  96. };
  97. //***************************************************************************
  98. //
  99. // CLASS NAME:
  100. //
  101. // CCFPerf
  102. //
  103. // DESCRIPTION:
  104. //
  105. // Class factory for CLocatorPerf class
  106. //
  107. //***************************************************************************
  108. class CCFPerf : public CCFDyn
  109. {
  110. public:
  111. IUnknown * CreateImpObj() {return (IWbemServices*) new CImpPerf;};
  112. } ;
  113. //***************************************************************************
  114. //
  115. // CLASS NAME:
  116. //
  117. // CImpPerfProp
  118. //
  119. // DESCRIPTION:
  120. //
  121. // Perf Provider property provider class.
  122. //
  123. //***************************************************************************
  124. class CImpPerfProp : public CImpDynProp {
  125. public:
  126. CImpPerfProp();
  127. ~CImpPerfProp();
  128. };
  129. //***************************************************************************
  130. //
  131. // CLASS NAME:
  132. //
  133. // CCFPerfProp
  134. //
  135. // DESCRIPTION:
  136. //
  137. // Class factory for CImpPerfProp class.
  138. //
  139. //***************************************************************************
  140. class CCFPerfProp : public CCFDyn
  141. {
  142. public:
  143. IUnknown * CreateImpObj() {return new CImpPerfProp();};
  144. } ;
  145. #endif //_PROVPERF_H_