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.

137 lines
4.0 KiB

  1. // HMDataElementConfiguration.h: interface for the HMDataElementConfiguration class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_HMDATAELEMENTCONFIGURATION_H__B0D24257_F80C_11D2_BDC8_0000F87A3912__INCLUDED_)
  5. #define AFX_HMDATAELEMENTCONFIGURATION_H__B0D24257_F80C_11D2_BDC8_0000F87A3912__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "WbemClassObject.h"
  10. #include "HMContext.h"
  11. class CHMDataElementConfiguration : public CWbemClassObject
  12. {
  13. DECLARE_DYNCREATE(CHMDataElementConfiguration)
  14. // Construction/Destruction
  15. public:
  16. CHMDataElementConfiguration();
  17. virtual ~CHMDataElementConfiguration();
  18. // Create
  19. public:
  20. HRESULT Create(const CString& sMachineName);
  21. HRESULT Create(IWbemClassObject* pObject);
  22. // Enumeration Operations
  23. public:
  24. HRESULT EnumerateObjects(ULONG& uReturned); // rentrant...continue to call until uReturned == 0
  25. // Property Retreival Operations
  26. public:
  27. HRESULT GetAllProperties();
  28. HRESULT SaveEnabledProperty();
  29. HRESULT SaveAllProperties();
  30. // HMDataElementConfiguration Properties
  31. public:
  32. CString m_sGUID; // Unique identifier
  33. CString m_sName; // Display name
  34. CString m_sDescription; // Description
  35. CString m_sTargetNamespace; // What Namespace we are to look in. Can contain path to a remote machine.
  36. int m_iCollectionIntervalMultiple; // How often to sample.
  37. int m_iStatisticsWindowSize; // Number of collection intervals to calculate the statistics across.
  38. // And also determining number of event rule cases.
  39. int m_iActiveDays; // Days of the week it is active. One bit per day.
  40. CTime m_BeginTime;
  41. CTime m_EndTime;
  42. CString m_sTypeGUID; // For use by the console to aid in the display
  43. bool m_bRequireManualReset; //
  44. bool m_bEnable; // If this is to be active
  45. CStringArray m_saStatisticsPropertyNames; // What properties to collect statistics on
  46. };
  47. typedef CTypedPtrArray<CObArray,CHMDataElementConfiguration*> DataElementArray;
  48. //////////////////////////////////////////////////////////////////////
  49. // CHMPolledGetObjectDataElementConfiguration
  50. class CHMPolledGetObjectDataElementConfiguration : public CHMDataElementConfiguration
  51. {
  52. // Property Retreival Operations
  53. public:
  54. HRESULT GetAllProperties();
  55. HRESULT SaveAllProperties();
  56. // HMPolledGetObjectDataElementConfiguration Properties
  57. public:
  58. CString m_sObjectPath; // Specifies what data to get .e.g. "Win32_SystemDriver.Name="DiskPerf""
  59. };
  60. //////////////////////////////////////////////////////////////////////
  61. //////////////////////////////////////////////////////////////////////
  62. // CHMPolledMethodDataElementConfiguration
  63. class CHMPolledMethodDataElementConfiguration : public CHMPolledGetObjectDataElementConfiguration
  64. {
  65. // Construction/Destruction
  66. public:
  67. ~CHMPolledMethodDataElementConfiguration();
  68. // static Operations
  69. public:
  70. static void AddArgument(HMContextArray& Arguments, const CString& sMachineName, const CString& sName, int iType, const CString& sValue);
  71. static void DestroyArguments(HMContextArray& Arguments);
  72. static void CopyArgsToSafeArray(HMContextArray& Arguments, COleSafeArray& Target);
  73. static void CopyArgsFromSafeArray(COleSafeArray& Arguments, HMContextArray& Target);
  74. // Property Retreival Operations
  75. public:
  76. HRESULT GetAllProperties();
  77. HRESULT SaveAllProperties();
  78. // HMPolledMethodDataElementConfiguration Properties
  79. public:
  80. CString m_sMethodName;
  81. COleSafeArray m_arguments;
  82. HMContextArray m_Arguments; // Arguments to the method
  83. };
  84. //////////////////////////////////////////////////////////////////////
  85. //////////////////////////////////////////////////////////////////////
  86. // CHMPolledQueryDataElementConfiguration
  87. class CHMQueryDataElementConfiguration : public CHMDataElementConfiguration
  88. {
  89. // Property Retreival Operations
  90. public:
  91. HRESULT GetAllProperties();
  92. HRESULT SaveAllProperties();
  93. // HMQueryDataElementConfiguration Properties
  94. public:
  95. CString m_sQuery;
  96. };
  97. //////////////////////////////////////////////////////////////////////
  98. #endif // !defined(AFX_HMDATAELEMENTCONFIGURATION_H__B0D24257_F80C_11D2_BDC8_0000F87A3912__INCLUDED_)