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.

318 lines
10 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ClusNetI.h
  7. //
  8. // Description:
  9. // Definition of the network interface classes for the MSCLUS automation
  10. // classes.
  11. //
  12. // Implementation File:
  13. // ClusNetI.cpp
  14. //
  15. // Author:
  16. // Ramakrishna Rosanuru via David Potter (davidp) 5-Sep-1997
  17. // Galen Barbee (galenb) July 1998
  18. //
  19. // Revision History:
  20. // July 1998 GalenB Maaaaaajjjjjjjjjoooooorrrr clean up
  21. //
  22. // Notes:
  23. //
  24. /////////////////////////////////////////////////////////////////////////////
  25. #ifndef _CLUSNETI_H_
  26. #define _CLUSNETI_H_
  27. /////////////////////////////////////////////////////////////////////////////
  28. // Forward Class Declarations
  29. /////////////////////////////////////////////////////////////////////////////
  30. class CClusNetInterface;
  31. class CNetInterfaces;
  32. class CClusNetInterfaces;
  33. class CClusNetworkNetInterfaces;
  34. class CClusNodeNetInterfaces;
  35. /////////////////////////////////////////////////////////////////////////////
  36. //++
  37. //
  38. // class CClusNetInterface
  39. //
  40. // Description:
  41. // Cluster Net Interface Automation Class.
  42. //
  43. // Inheritance:
  44. // IDispatchImpl< ISClusNetInterface, &IID_ISClusNetInterface, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  45. // CSupportErrorInfo
  46. // CComObjectRootEx< CComSingleThreadModel >
  47. // CComCoClass< CClusNetInterface, &CLSID_ClusNetInterface >
  48. // CClusterObject
  49. //
  50. //--
  51. /////////////////////////////////////////////////////////////////////////////
  52. class ATL_NO_VTABLE CClusNetInterface :
  53. public IDispatchImpl< ISClusNetInterface, &IID_ISClusNetInterface, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  54. public CSupportErrorInfo,
  55. public CComObjectRootEx< CComSingleThreadModel >,
  56. public CComCoClass< CClusNetInterface, &CLSID_ClusNetInterface >,
  57. public CClusterObject
  58. {
  59. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  60. public:
  61. CClusNetInterface( void );
  62. ~CClusNetInterface( void );
  63. BEGIN_COM_MAP(CClusNetInterface)
  64. COM_INTERFACE_ENTRY(IDispatch)
  65. COM_INTERFACE_ENTRY(ISClusNetInterface)
  66. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  67. END_COM_MAP()
  68. DECLARE_NOT_AGGREGATABLE(CClusNetInterface)
  69. DECLARE_NO_REGISTRY()
  70. private:
  71. ISClusRefObject * m_pClusRefObject;
  72. HNETINTERFACE m_hNetInterface;
  73. CComObject< CClusProperties > * m_pCommonProperties;
  74. CComObject< CClusProperties > * m_pPrivateProperties;
  75. CComObject< CClusProperties > * m_pCommonROProperties;
  76. CComObject< CClusProperties > * m_pPrivateROProperties;
  77. CComBSTR m_bstrNetInterfaceName;
  78. HRESULT GetProperties( OUT ISClusProperties ** ppProperties, IN BOOL bPrivate, IN BOOL bReadOnly );
  79. protected:
  80. virtual DWORD ScWriteProperties( IN const CClusPropList & rcplPropList, IN BOOL bPrivate );
  81. public:
  82. HRESULT Open( IN ISClusRefObject* pClusRefObject, IN BSTR bstrNetInterfaceName );
  83. STDMETHODIMP get_Handle( OUT ULONG_PTR * phandle );
  84. STDMETHODIMP get_Name( OUT BSTR * pbstrNetInterfaceName );
  85. STDMETHODIMP get_State( OUT CLUSTER_NETINTERFACE_STATE * dwState );
  86. STDMETHODIMP get_CommonProperties( OUT ISClusProperties ** ppProperties );
  87. STDMETHODIMP get_PrivateProperties( OUT ISClusProperties ** ppProperties );
  88. STDMETHODIMP get_CommonROProperties( OUT ISClusProperties ** ppProperties );
  89. STDMETHODIMP get_PrivateROProperties( OUT ISClusProperties ** ppProperties );
  90. STDMETHODIMP get_Cluster( OUT ISCluster ** ppCluster );
  91. virtual HRESULT HrLoadProperties( IN OUT CClusPropList & rcplPropList, IN BOOL bReadOnly, IN BOOL bPrivate );
  92. const CComBSTR Name( void ) const { return m_bstrNetInterfaceName ; };
  93. }; //*** Class CClusNetInterface
  94. /////////////////////////////////////////////////////////////////////////////
  95. //++
  96. //
  97. // class CNetInterfaces
  98. //
  99. // Description:
  100. // Cluster Net Interfaces Collection Implementation Class.
  101. //
  102. // Inheritance:
  103. //
  104. //--
  105. /////////////////////////////////////////////////////////////////////////////
  106. class CNetInterfaces
  107. {
  108. public:
  109. CNetInterfaces( void );
  110. ~CNetInterfaces( void );
  111. HRESULT Create( IN ISClusRefObject * pClusRefObject );
  112. protected:
  113. typedef std::vector< CComObject< CClusNetInterface > * > NetInterfacesList;
  114. ISClusRefObject * m_pClusRefObject;
  115. NetInterfacesList m_NetInterfaceList;
  116. void Clear( void );
  117. HRESULT FindItem( IN LPWSTR lpszNetInterfaceName, OUT UINT * pnIndex );
  118. HRESULT FindItem( IN ISClusNetInterface * pClusterNetInterface, OUT UINT * pnIndex );
  119. HRESULT GetIndex( IN VARIANT varIndex, OUT UINT * pnIndex );
  120. HRESULT GetItem( IN LPWSTR lpszNetInterfaceName, OUT ISClusNetInterface ** ppClusterNetInterface );
  121. HRESULT GetItem( IN UINT nIndex, OUT ISClusNetInterface ** ppClusterNetInterface );
  122. HRESULT GetNetInterfaceItem( IN VARIANT varIndex, OUT ISClusNetInterface ** ppClusterNetInterface );
  123. }; //*** Class CNetInterfaces
  124. /////////////////////////////////////////////////////////////////////////////
  125. //++
  126. //
  127. // class CClusNetInterfaces
  128. //
  129. // Description:
  130. // Cluster Net Interfaces Collection Automation Class.
  131. //
  132. // Inheritance:
  133. // IDispatchImpl< ISClusNetInterfaces, &IID_ISClusNetInterfaces, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  134. // CSupportErrorInfo
  135. // CComObjectRootEx< CComSingleThreadModel >
  136. // CNetInterfaces
  137. // CComCoClass< CClusNetInterfaces, &CLSID_ClusNetInterfaces >
  138. //
  139. //--
  140. /////////////////////////////////////////////////////////////////////////////
  141. class ATL_NO_VTABLE CClusNetInterfaces :
  142. public IDispatchImpl< ISClusNetInterfaces, &IID_ISClusNetInterfaces, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  143. public CSupportErrorInfo,
  144. public CComObjectRootEx< CComSingleThreadModel >,
  145. public CNetInterfaces,
  146. public CComCoClass< CClusNetInterfaces, &CLSID_ClusNetInterfaces >
  147. {
  148. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  149. public:
  150. CClusNetInterfaces( void );
  151. ~CClusNetInterfaces( void );
  152. BEGIN_COM_MAP(CClusNetInterfaces)
  153. COM_INTERFACE_ENTRY(IDispatch)
  154. COM_INTERFACE_ENTRY(ISClusNetInterfaces)
  155. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  156. END_COM_MAP()
  157. DECLARE_NOT_AGGREGATABLE(CClusNetInterfaces)
  158. DECLARE_NO_REGISTRY()
  159. public:
  160. STDMETHODIMP get_Count( OUT long * plCount );
  161. STDMETHODIMP get_Item( IN VARIANT varIndex, OUT ISClusNetInterface ** ppClusterNetInterface );
  162. STDMETHODIMP get__NewEnum( OUT IUnknown ** ppunk );
  163. STDMETHODIMP Refresh( void );
  164. }; //*** Class CClusNetInterfaces
  165. /////////////////////////////////////////////////////////////////////////////
  166. //++
  167. //
  168. // class CClusNetworkNetInterfaces
  169. //
  170. // Description:
  171. // Cluster Network Net Interfaces collection Automation Class.
  172. //
  173. // Inheritance:
  174. // IDispatchImpl< ISClusNetworkNetInterfaces, &IID_ISClusNetworkNetInterfaces, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  175. // CSupportErrorInfo
  176. // CComObjectRootEx< CComSingleThreadModel >,
  177. // CNetInterfaces
  178. // CComCoClass< CClusNetworkNetInterfaces, &CLSID_ClusNetworkNetInterfaces >
  179. //
  180. //--
  181. /////////////////////////////////////////////////////////////////////////////
  182. class ATL_NO_VTABLE CClusNetworkNetInterfaces :
  183. public IDispatchImpl< ISClusNetworkNetInterfaces, &IID_ISClusNetworkNetInterfaces, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  184. public CSupportErrorInfo,
  185. public CComObjectRootEx< CComSingleThreadModel >,
  186. public CNetInterfaces,
  187. public CComCoClass< CClusNetworkNetInterfaces, &CLSID_ClusNetworkNetInterfaces >
  188. {
  189. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  190. public:
  191. CClusNetworkNetInterfaces( void );
  192. ~CClusNetworkNetInterfaces( void );
  193. BEGIN_COM_MAP(CClusNetworkNetInterfaces)
  194. COM_INTERFACE_ENTRY(IDispatch)
  195. COM_INTERFACE_ENTRY(ISClusNetworkNetInterfaces)
  196. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  197. END_COM_MAP()
  198. DECLARE_NOT_AGGREGATABLE(CClusNetworkNetInterfaces)
  199. DECLARE_NO_REGISTRY()
  200. HRESULT Create( IN ISClusRefObject * pClusRefObject, IN HNETWORK hNetwork );
  201. private:
  202. HNETWORK m_hNetwork;
  203. public:
  204. STDMETHODIMP get_Count( OUT long * plCount );
  205. STDMETHODIMP get_Item( IN VARIANT varIndex, OUT ISClusNetInterface ** ppClusterNetInterface );
  206. STDMETHODIMP get__NewEnum( OUT IUnknown ** ppunk );
  207. STDMETHODIMP Refresh( void );
  208. }; //*** Class CClusNetworkNetInterfaces
  209. /////////////////////////////////////////////////////////////////////////////
  210. //++
  211. //
  212. // class CClusNodeNetInterfaces
  213. //
  214. // Description:
  215. // Cluster Node Net Interfaces collection Automation Class.
  216. //
  217. // Inheritance:
  218. // IDispatchImpl< ISClusNodeNetInterfaces, &IID_ISClusNodeNetInterfaces, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  219. // CSupportErrorInfo
  220. // CComObjectRootEx< CComSingleThreadModel >,
  221. // CNetInterfaces
  222. // CComCoClass< CClusNodeNetInterfaces, &CLSID_ClusNodeNetInterfaces >
  223. //
  224. //--
  225. /////////////////////////////////////////////////////////////////////////////
  226. class ATL_NO_VTABLE CClusNodeNetInterfaces :
  227. public IDispatchImpl< ISClusNodeNetInterfaces, &IID_ISClusNodeNetInterfaces, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  228. public CSupportErrorInfo,
  229. public CComObjectRootEx< CComSingleThreadModel >,
  230. public CNetInterfaces,
  231. public CComCoClass< CClusNodeNetInterfaces, &CLSID_ClusNodeNetInterfaces >
  232. {
  233. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  234. public:
  235. CClusNodeNetInterfaces( void );
  236. ~CClusNodeNetInterfaces( void );
  237. BEGIN_COM_MAP(CClusNodeNetInterfaces)
  238. COM_INTERFACE_ENTRY(IDispatch)
  239. COM_INTERFACE_ENTRY(ISClusNodeNetInterfaces)
  240. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  241. END_COM_MAP()
  242. DECLARE_NOT_AGGREGATABLE(CClusNodeNetInterfaces)
  243. DECLARE_NO_REGISTRY()
  244. HRESULT Create( IN ISClusRefObject * pClusRefObject, IN HNODE hNode );
  245. private:
  246. HNODE m_hNode;
  247. public:
  248. STDMETHODIMP get_Count( OUT long * plCount );
  249. STDMETHODIMP get_Item( IN VARIANT varIndex, OUT ISClusNetInterface ** ppClusterNetInterface );
  250. STDMETHODIMP get__NewEnum( OUT IUnknown ** ppunk );
  251. STDMETHODIMP Refresh( void );
  252. }; //*** Class CClusNodeNetInterfaces
  253. #endif // _CLUSNETI_H_