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.

216 lines
6.7 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // Cluster.h
  7. //
  8. // Description:
  9. // Definition of the CCluster and CClusRefObject classes.
  10. //
  11. // Implementation File:
  12. // Cluster.cpp
  13. //
  14. // Author:
  15. // Charles Stacy Harris (stacyh) 28-Feb-1997
  16. // Galen Barbee (galenb) July 1998
  17. //
  18. // Revision History:
  19. // July 1998 GalenB Maaaaaajjjjjjjjjoooooorrrr clean up
  20. //
  21. // Notes:
  22. //
  23. /////////////////////////////////////////////////////////////////////////////
  24. #ifndef _CLUSTER_H_
  25. #define _CLUSTER_H_
  26. /////////////////////////////////////////////////////////////////////////////
  27. // Forward Class Declarations
  28. /////////////////////////////////////////////////////////////////////////////
  29. class CCluster;
  30. class CClusRefObject;
  31. /////////////////////////////////////////////////////////////////////////////
  32. //++
  33. //
  34. // class CCluster
  35. //
  36. // Description:
  37. // Cluster Automation Class.
  38. //
  39. // Inheritance:
  40. // IDispatchImpl< ISCluster, &IID_ISCluster, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  41. // CSupportErrorInfo
  42. // CComObjectRootEx< CComSingleThreadModel >
  43. // CComCoClass< CCluster,&CLSID_Cluster >
  44. // CClusterObject
  45. //
  46. //--
  47. /////////////////////////////////////////////////////////////////////////////
  48. class ATL_NO_VTABLE CCluster :
  49. public IDispatchImpl< ISCluster, &IID_ISCluster, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  50. public CSupportErrorInfo,
  51. public CComObjectRootEx< CComSingleThreadModel >,
  52. public CComCoClass< CCluster,&CLSID_Cluster >,
  53. public CClusterObject
  54. {
  55. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  56. typedef IDispatchImpl< ISCluster, &IID_ISCluster, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER > BaseDispatchClass;
  57. typedef CComCoClass< CCluster,&CLSID_Cluster > BaseCoClass;
  58. public:
  59. CCluster( void );
  60. ~CCluster( void );
  61. BEGIN_COM_MAP(CCluster)
  62. COM_INTERFACE_ENTRY(IDispatch)
  63. COM_INTERFACE_ENTRY(ISCluster)
  64. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  65. END_COM_MAP()
  66. DECLARE_NOT_AGGREGATABLE(CCluster)
  67. DECLARE_NO_REGISTRY()
  68. private:
  69. CComBSTR m_bstrQuorumPath;
  70. CComBSTR m_bstrQuorumResourceName;
  71. long m_nQuorumLogSize;
  72. ISClusApplication * m_pParentApplication;
  73. ISClusRefObject * m_pClusRefObject;
  74. HCLUSTER m_hCluster;
  75. CComObject< CClusNodes > * m_pClusterNodes;
  76. CComObject< CClusResGroups > * m_pClusterResourceGroups;
  77. CComObject< CClusResources > * m_pClusterResources;
  78. CComObject< CClusResTypes > * m_pResourceTypes;
  79. CComObject< CClusNetworks > * m_pNetworks;
  80. CComObject< CClusNetInterfaces > * m_pNetInterfaces;
  81. CComObject< CClusProperties > * m_pCommonProperties;
  82. CComObject< CClusProperties > * m_pPrivateProperties;
  83. CComObject< CClusProperties > * m_pCommonROProperties;
  84. CComObject< CClusProperties > * m_pPrivateROProperties;
  85. STDMETHODIMP OpenResource( IN BSTR bstrResourceName, OUT ISClusResource ** ppClusterResource );
  86. STDMETHODIMP HrGetQuorumInfo( void );
  87. void Clear( void );
  88. HRESULT GetProperties( OUT ISClusProperties ** ppProperties, IN BOOL bPrivate, IN BOOL bReadOnly );
  89. protected:
  90. virtual DWORD ScWriteProperties( IN const CClusPropList & rcplPropList, IN BOOL bPrivate );
  91. public:
  92. STDMETHODIMP Create( IN CClusApplication * pParentApplication );
  93. STDMETHODIMP Close( void );
  94. STDMETHODIMP get_Handle( OUT ULONG_PTR * phandle );
  95. STDMETHODIMP Open( IN BSTR bstrClusterName );
  96. STDMETHODIMP put_Name( IN BSTR bstrClusterName );
  97. STDMETHODIMP get_Name( IN BSTR * pbstrClusterName );
  98. STDMETHODIMP get_Version( OUT ISClusVersion ** ppClusVersion );
  99. STDMETHODIMP put_QuorumResource( IN ISClusResource * pResource );
  100. STDMETHODIMP get_QuorumResource( OUT ISClusResource ** ppResource );
  101. STDMETHODIMP get_Nodes( OUT ISClusNodes ** ppClusterNodes );
  102. STDMETHODIMP get_ResourceGroups( OUT ISClusResGroups ** ppClusterResourceGroups );
  103. STDMETHODIMP get_Resources( OUT ISClusResources ** ppClusterResources );
  104. STDMETHODIMP get_ResourceTypes( OUT ISClusResTypes ** ppResourceTypes );
  105. STDMETHODIMP get_CommonProperties( OUT ISClusProperties ** ppProperties );
  106. STDMETHODIMP get_PrivateProperties( OUT ISClusProperties ** ppProperties );
  107. STDMETHODIMP get_CommonROProperties( OUT ISClusProperties ** ppProperties );
  108. STDMETHODIMP get_PrivateROProperties( OUT ISClusProperties ** ppProperties );
  109. STDMETHODIMP get_QuorumLogSize( OUT long * pnQuoromLogSize );
  110. STDMETHODIMP put_QuorumLogSize( IN long nQuoromLogSize );
  111. STDMETHODIMP get_QuorumPath( OUT BSTR * ppPath );
  112. STDMETHODIMP put_QuorumPath( IN BSTR pPath );
  113. STDMETHODIMP get_Networks( OUT ISClusNetworks ** ppNetworks );
  114. STDMETHODIMP get_NetInterfaces( OUT ISClusNetInterfaces ** ppNetInterfaces );
  115. virtual HRESULT HrLoadProperties( IN OUT CClusPropList & rcplPropList, IN BOOL bReadOnly, IN BOOL bPrivate );
  116. // STDMETHODIMP get_Parent( IDispatch ** ppParent );
  117. // STDMETHODIMP get_Application( ISClusApplication ** ppParentApplication );
  118. const ISClusRefObject * ClusRefObject( void ) const { return m_pClusRefObject; };
  119. void ClusRefObject( IN ISClusRefObject * pClusRefObject );
  120. void Hcluster( IN HCLUSTER hCluster );
  121. const HCLUSTER Hcluster( void ) const { return m_hCluster; };
  122. }; //*** CCluster
  123. /////////////////////////////////////////////////////////////////////////////
  124. //++
  125. //
  126. // class CClusRefObject
  127. //
  128. // Description:
  129. // Automation Class that wraps the Cluster handle.
  130. //
  131. // Inheritance:
  132. // IDispatchImpl< ISClusRefObject, &IID_ISClusRefObject, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  133. // CSupportErrorInfo
  134. // CComObjectRootEx< CComSingleThreadModel >
  135. // CComCoClass< CClusRefObject, &CLSID_ClusRefObject >
  136. //
  137. //--
  138. /////////////////////////////////////////////////////////////////////////////
  139. class ATL_NO_VTABLE CClusRefObject :
  140. public IDispatchImpl< ISClusRefObject, &IID_ISClusRefObject, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  141. public CSupportErrorInfo,
  142. public CComObjectRootEx< CComSingleThreadModel >,
  143. public CComCoClass< CClusRefObject, &CLSID_ClusRefObject >
  144. {
  145. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  146. public:
  147. CClusRefObject( void );
  148. ~CClusRefObject( void );
  149. BEGIN_COM_MAP(CClusRefObject)
  150. COM_INTERFACE_ENTRY(IDispatch)
  151. COM_INTERFACE_ENTRY(ISClusRefObject)
  152. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  153. END_COM_MAP()
  154. DECLARE_NOT_AGGREGATABLE(CClusRefObject)
  155. DECLARE_NO_REGISTRY()
  156. HRESULT SetClusHandle( IN HCLUSTER hCluster ) { m_hCluster = hCluster; return S_OK;};
  157. private:
  158. HCLUSTER m_hCluster;
  159. public:
  160. STDMETHODIMP get_Handle( OUT ULONG_PTR * phandle );
  161. }; //*** Class CClusRefObject
  162. #endif // _CLUSTER_H_