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.

177 lines
5.1 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CClusCfgServer.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CClusCfgServer
  10. // class.
  11. //
  12. // The class CClusCfgServer is the implementations of the
  13. // IClusCfgServer interface.
  14. //
  15. // Documentation:
  16. //
  17. // Implementation Files:
  18. // CClusCfgServer.cpp
  19. //
  20. // Maintained By:
  21. // Galen Barbee (GalenB) 03-FEB-2000
  22. //
  23. //////////////////////////////////////////////////////////////////////////////
  24. // Make sure that this file is included only once per compile path.
  25. #pragma once
  26. //////////////////////////////////////////////////////////////////////////////
  27. // Include Files
  28. //////////////////////////////////////////////////////////////////////////////
  29. #include <ClusCfgPrivate.h>
  30. #include "..\PostCfg\IPostCfgManager.h"
  31. //////////////////////////////////////////////////////////////////////////////
  32. // Constant Declarations
  33. //////////////////////////////////////////////////////////////////////////////
  34. //////////////////////////////////////////////////////////////////////////////
  35. //++
  36. //
  37. // class CClusCfgServer
  38. //
  39. // Description:
  40. // The class CClusCfgServer is the server that provides the
  41. // functionality to form a cluster and join additional nodes to a cluster.
  42. //
  43. // Interfaces:
  44. // IClusCfgServer
  45. // IClusCfgInitialize
  46. // IClusCfgCapabilities
  47. // IClusCfgPollingCallbackInfo
  48. // IClusCfgVerify
  49. //
  50. //--
  51. //////////////////////////////////////////////////////////////////////////////
  52. class CClusCfgServer
  53. : public IClusCfgServer
  54. , public IClusCfgInitialize
  55. , public IClusCfgCapabilities
  56. , public IClusCfgPollingCallbackInfo
  57. , public IClusCfgVerify
  58. {
  59. private:
  60. //
  61. // Private member functions and data
  62. //
  63. LONG m_cRef;
  64. IWbemServices * m_pIWbemServices;
  65. LCID m_lcid;
  66. IClusCfgCallback * m_picccCallback;
  67. IUnknown * m_punkNodeInfo;
  68. IUnknown * m_punkEnumResources;
  69. IUnknown * m_punkNetworksEnum;
  70. BOOL m_fCanBeClustered:1;
  71. BOOL m_fUsePolling:1;
  72. BSTR m_bstrNodeName;
  73. BSTR m_bstrBindingString;
  74. // Private constructors and destructors
  75. CClusCfgServer( void );
  76. ~CClusCfgServer( void );
  77. // Private copy constructor to prevent copying.
  78. CClusCfgServer( const CClusCfgServer & nodeSrc );
  79. // Private assignment operator to prevent copying.
  80. const CClusCfgServer & operator = ( const CClusCfgServer & nodeSrc );
  81. HRESULT HrInit( void );
  82. HRESULT HrInitializeForLocalServer( void );
  83. HRESULT HrSetBlanket( void );
  84. HRESULT HrFormCluster( IClusCfgClusterInfo * piccciIn, IClusCfgBaseCluster * piccbcaIn );
  85. HRESULT HrJoinToCluster( IClusCfgClusterInfo * piccciIn, IClusCfgBaseCluster * piccbcaIn );
  86. HRESULT HrEvictedFromCluster(
  87. IPostCfgManager * ppcmIn,
  88. IEnumClusCfgManagedResources * peccmrIn,
  89. IClusCfgClusterInfo * piccciIn,
  90. IClusCfgBaseCluster * piccbcaIn
  91. );
  92. HRESULT HrHasNodeBeenEvicted( void );
  93. HRESULT HrCleanUpNode( void );
  94. HRESULT HrCreateClusterNodeInfo( void );
  95. public:
  96. //
  97. // Public, non interface methods.
  98. //
  99. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  100. //
  101. // IUnknown Interfaces
  102. //
  103. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  104. STDMETHOD_( ULONG, AddRef )( void );
  105. STDMETHOD_( ULONG, Release )( void );
  106. //
  107. // IClusCfgInitialize
  108. //
  109. // Register callbacks, locale id, etc.
  110. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  111. //
  112. // IClusCfgServer Interfaces
  113. //
  114. // Get information about the computer on which this object is present.
  115. STDMETHOD( GetClusterNodeInfo )( IClusCfgNodeInfo ** ppClusterNodeInfoOut );
  116. // Get an enumeration of the devices on this computer that can be managed by the cluster service.
  117. STDMETHOD( GetManagedResourcesEnum )( IEnumClusCfgManagedResources ** ppEnumManagedResourcesOut );
  118. // Get an enumeration of all the networks on this computer.
  119. STDMETHOD( GetNetworksEnum )( IEnumClusCfgNetworks ** ppEnumNetworksOut );
  120. // Commit the changes to the node
  121. STDMETHOD( CommitChanges )( void );
  122. // Binding String
  123. STDMETHOD( GetBindingString )( BSTR * pbstrBindingStringOut );
  124. STDMETHOD( SetBindingString )( LPCWSTR pcszBindingStringIn );
  125. //
  126. // IClusCfgCapabilities
  127. //
  128. STDMETHOD( CanNodeBeClustered )( void );
  129. //
  130. // IClusCfgPollingCallbackInfo
  131. //
  132. STDMETHOD( GetCallback )( IClusCfgPollingCallback ** ppiccpcOut );
  133. STDMETHOD( SetPollingMode )( BOOL fPollingModeIn );
  134. //
  135. // IClusCfgVerify
  136. //
  137. STDMETHOD( VerifyCredentials )( LPCWSTR pcszUserIn, LPCWSTR pcszDomainIn, LPCWSTR pcszPasswordIn );
  138. STDMETHOD( VerifyConnectionToCluster )( LPCWSTR pcszClusterNameIn );
  139. STDMETHOD( VerifyConnectionToNode )( LPCWSTR pcszNodeNameIn );
  140. }; //*** Class CClusCfgServer