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.

151 lines
4.9 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // StartupNotify.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CStartupNotify
  10. // class. This class is used to notify StartupListeners
  11. // when the cluster service starts.
  12. //
  13. // Documentation:
  14. // TODO: fill in pointer to external documentation
  15. //
  16. // Implementation Files:
  17. // StartupNotify.cpp
  18. //
  19. // Maintained By:
  20. // Vij Vasu (VVasu) 04-AUG-2000
  21. //
  22. //////////////////////////////////////////////////////////////////////////////
  23. // Make sure that this file is included only once per compile path.
  24. #pragma once
  25. //////////////////////////////////////////////////////////////////////////////
  26. // Include Files
  27. //////////////////////////////////////////////////////////////////////////////
  28. // For IUnknown
  29. #include <unknwn.h>
  30. // For IClusCfgStartupNotify
  31. #include <ClusCfgServer.h>
  32. // For ILogger
  33. #include <ClusCfgClient.h>
  34. //////////////////////////////////////////////////////////////////////////////
  35. //++
  36. //
  37. // class CStartupNotify
  38. //
  39. // Description:
  40. // This class is used to notify StartupListeners
  41. // when the cluster service starts.
  42. //
  43. //--
  44. //////////////////////////////////////////////////////////////////////////////
  45. class CStartupNotify
  46. : public IClusCfgStartupNotify
  47. , public IClusCfgCallback
  48. {
  49. public:
  50. //////////////////////////////////////////////////////////////////////////
  51. // IUnknown methods
  52. //////////////////////////////////////////////////////////////////////////
  53. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  54. STDMETHOD_( ULONG, AddRef )( void );
  55. STDMETHOD_( ULONG, Release )( void );
  56. //////////////////////////////////////////////////////////////////////////
  57. // IClusCfgStartupNotify methods
  58. //////////////////////////////////////////////////////////////////////////
  59. // Send out notification of cluster service startup to interested listeners
  60. STDMETHOD( SendNotifications )( void );
  61. //////////////////////////////////////////////////////////////////////////
  62. // IClusCfgCallback methods
  63. //////////////////////////////////////////////////////////////////////////
  64. STDMETHOD( SendStatusReport )(
  65. LPCWSTR pcszNodeNameIn
  66. , CLSID clsidTaskMajorIn
  67. , CLSID clsidTaskMinorIn
  68. , ULONG ulMinIn
  69. , ULONG ulMaxIn
  70. , ULONG ulCurrentIn
  71. , HRESULT hrStatusIn
  72. , LPCWSTR pcszDescriptionIn
  73. , FILETIME * pftTimeIn
  74. , LPCWSTR pcszReference
  75. );
  76. //////////////////////////////////////////////////////////////////////////
  77. // Other public methods
  78. //////////////////////////////////////////////////////////////////////////
  79. // Create an instance of this class.
  80. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  81. private:
  82. //////////////////////////////////////////////////////////////////////////
  83. // Private member functions
  84. //////////////////////////////////////////////////////////////////////////
  85. // Second phase of a two phase constructor.
  86. HRESULT HrInit( void );
  87. // Enumerate all components on the local computer registered for cluster
  88. // startup notification.
  89. HRESULT HrNotifyListeners( void );
  90. // Instantiate a cluster startup listener component and call the
  91. // appropriate methods.
  92. HRESULT HrProcessListener(
  93. const CLSID & rclsidListenerCLSIDIn
  94. , IUnknown * punkResTypeServicesIn
  95. );
  96. //
  97. // Private constructors, destructor and assignment operator.
  98. // All of these methods are private for two reasons:
  99. // 1. Lifetimes of objects of this class are controlled by S_HrCreateInstance and Release.
  100. // 2. Copying of an object of this class is prohibited.
  101. //
  102. // Default constructor.
  103. CStartupNotify( void );
  104. // Destructor.
  105. ~CStartupNotify( void );
  106. // Copy constructor.
  107. CStartupNotify( const CStartupNotify & );
  108. // Assignment operator.
  109. CStartupNotify & operator =( const CStartupNotify & );
  110. //////////////////////////////////////////////////////////////////////////
  111. // Private data
  112. //////////////////////////////////////////////////////////////////////////
  113. // Reference count for this object.
  114. LONG m_cRef;
  115. // IClusCfgCallback
  116. BSTR m_bstrNodeName; // Name of the local node.
  117. ILogger * m_plLogger; // ILogger for doing logging.
  118. }; //*** class CStartupNotify