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.

96 lines
3.1 KiB

  1. //***************************************************************************
  2. //
  3. // ACTION.H
  4. //
  5. // Module: HEALTHMON SERVER AGENT
  6. //
  7. // Purpose: To act as the coordinator of actions. WMI actually provides the
  8. // code and support to carry out the actions (like email). This class
  9. // does the scheduling, and throttling of them.
  10. //
  11. // Copyright (c)1999 Microsoft Corporation, All Rights Reserved
  12. //
  13. //***************************************************************************
  14. #if !defined( __ACTION_H )
  15. #define __ACTION_H
  16. #include <wbemcli.h>
  17. #include <vector>
  18. #include "global.h"
  19. #include "tmpcnsmr.h"
  20. #include "base.h"
  21. typedef struct _tag_QStruct
  22. {
  23. LPTSTR szQuery;
  24. CTempConsumer* pTempSink;
  25. long lThrottleTime;
  26. long lReminderTime;
  27. unsigned long ulTriggerStates;
  28. DWORD startTick;
  29. DWORD reminderTimeTick;
  30. BOOL bThrottleOn;
  31. LPTSTR szConfigActionAssocPath;
  32. LPTSTR szUserConfigPath;
  33. LPTSTR szChildPath;
  34. CBase *pBase;
  35. HRESULT hRes;
  36. } QSTRUCT, *PQSTRUCT;
  37. typedef std::vector<QSTRUCT, std::allocator<QSTRUCT> > QLIST;
  38. class CAction : public CBase
  39. {
  40. public:
  41. CAction();
  42. ~CAction();
  43. // LPTSTR m_szGUID;
  44. // LPTSTR m_szName;
  45. LPTSTR m_szDescription;
  46. int m_iActiveDays;
  47. long m_lBeginHourTime;
  48. long m_lBeginMinuteTime;
  49. long m_lEndHourTime;
  50. long m_lEndMinuteTime;
  51. BOOL m_bEnabled;
  52. BOOL m_bParentEnabled;
  53. LPTSTR m_szTypeGUID;
  54. // BOOL m_bFTCBBroken;
  55. QLIST m_qList;
  56. // long m_lCurrState;
  57. TCHAR m_szDTTime[512];
  58. TCHAR m_szTime[512];
  59. LPTSTR m_pszStatusGUID;
  60. BOOL m_bValidLoad;
  61. HRESULT LoadInstanceFromMOF(IWbemClassObject* pObj, BOOL bModifyPass=FALSE);
  62. BOOL OnAgentInterval(void);
  63. BOOL HandleTempEvent(LPTSTR szGUID, IWbemClassObject* pObj);
  64. BOOL HandleTempErrorEvent(BSTR szGUID, long lErrorCode, LPTSTR pszErrorDescription);
  65. HRESULT FindAndModAction(BSTR szGUID, IWbemClassObject* pObj);
  66. BOOL FindAndCreateActionAssociation(BSTR szGUID, IWbemClassObject* pObj);
  67. BOOL FindAndModActionAssociation(BSTR szGUID, IWbemClassObject* pObj);
  68. BOOL FireEvent(long lErrorCode, LPTSTR pszErrorDescription, int iResString);
  69. HRESULT GetHMActionStatus(IWbemClassObject** ppInstance, IWbemClassObject* pObj, LPTSTR pszClass, int iResString);
  70. BOOL DeleteConfigActionAssoc(LPTSTR pszConfigGUID, LPTSTR pszActionGUID);
  71. BOOL DeleteEFAndFTCB(void);
  72. LPTSTR GetGUID(void);
  73. BOOL DeleteAConfig(void);
  74. HRESULT SendHMActionStatusInstances(IWbemObjectSink* pSink);
  75. HRESULT SendHMActionStatusInstance(IWbemObjectSink* pSink, LPTSTR pszGUID);
  76. BOOL checkTime(void);
  77. CBase *FindImediateChildByName(LPTSTR pszName);
  78. BOOL GetNextChildName(LPTSTR pszChildName, LPTSTR pszOutName);
  79. CBase *FindPointerFromName(LPTSTR pszName);
  80. // BOOL ModifyAssocForMove(CBase *pNewParentBase);
  81. BOOL ReceiveNewChildForMove(CBase *pBase);
  82. BOOL DeleteChildFromList(LPTSTR pszGUID);
  83. BOOL SendReminderActionIfStateIsSame(IWbemObjectSink* pActionEventSink, IWbemObjectSink* pActionTriggerEventSink, IWbemClassObject* pActionInstance, IWbemClassObject* pActionTriggerInstance, unsigned long ulTriggerStates);
  84. Cleanup(BOOL bClearAll);
  85. HRESULT RemapAction(void);
  86. HRESULT RemapOneAction(IWbemClassObject* pObj);
  87. HRESULT CheckForBadLoad(void);
  88. };
  89. #endif // __ACTION_H