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.

190 lines
5.6 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ClusNetW.h
  7. //
  8. // Description:
  9. // Definition of the network classes for the MSCLUS automation
  10. // classes.
  11. //
  12. // Implementation File:
  13. // ClusNetW.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 _CLUSNETW_H_
  26. #define _CLUSNETW_H_
  27. /////////////////////////////////////////////////////////////////////////////
  28. // Forward Class Declarations
  29. /////////////////////////////////////////////////////////////////////////////
  30. class CClusNetwork;
  31. class CClusNetworks;
  32. /////////////////////////////////////////////////////////////////////////////
  33. //++
  34. //
  35. // class CClusNetwork
  36. //
  37. // Description:
  38. // Cluster Network Automation Class.
  39. //
  40. // Inheritance:
  41. // IDispatchImpl< ISClusNetwork, &IID_ISClusNetwork, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  42. // CSupportErrorInfo,
  43. // CComObjectRootEx< CComSingleThreadModel >
  44. // CComCoClass< CClusNetwork, &CLSID_ClusNetwork >
  45. // CClusterObject
  46. //
  47. //--
  48. /////////////////////////////////////////////////////////////////////////////
  49. class ATL_NO_VTABLE CClusNetwork :
  50. public IDispatchImpl< ISClusNetwork, &IID_ISClusNetwork, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  51. public CSupportErrorInfo,
  52. public CComObjectRootEx< CComSingleThreadModel >,
  53. public CComCoClass< CClusNetwork, &CLSID_ClusNetwork >,
  54. public CClusterObject
  55. {
  56. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  57. public:
  58. CClusNetwork( void );
  59. ~CClusNetwork( void );
  60. BEGIN_COM_MAP(CClusNetwork)
  61. COM_INTERFACE_ENTRY(IDispatch)
  62. COM_INTERFACE_ENTRY(ISClusNetwork)
  63. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  64. END_COM_MAP()
  65. DECLARE_NOT_AGGREGATABLE(CClusNetwork)
  66. DECLARE_NO_REGISTRY()
  67. private:
  68. ISClusRefObject * m_pClusRefObject;
  69. HNETWORK m_hNetwork;
  70. CComBSTR m_bstrNetworkName;
  71. CComObject< CClusNetworkNetInterfaces > * m_pNetInterfaces;
  72. CComObject< CClusProperties > * m_pCommonProperties;
  73. CComObject< CClusProperties > * m_pPrivateProperties;
  74. CComObject< CClusProperties > * m_pCommonROProperties;
  75. CComObject< CClusProperties > * m_pPrivateROProperties;
  76. HRESULT GetProperties( OUT ISClusProperties ** ppProperties, IN BOOL bPrivate, IN BOOL bReadOnly );
  77. protected:
  78. virtual DWORD ScWriteProperties( IN const CClusPropList & rcplPropList, IN BOOL bPrivate );
  79. public:
  80. HRESULT Open( IN ISClusRefObject * pClusRefObject, IN BSTR bstrNetworkName );
  81. STDMETHODIMP get_Handle( OUT ULONG_PTR * phandle );
  82. STDMETHODIMP get_Name( OUT BSTR * pbstrNetworkName );
  83. STDMETHODIMP put_Name( IN BSTR pbstrNetworkName );
  84. STDMETHODIMP get_NetworkID( OUT BSTR * pbstrNetworkID );
  85. STDMETHODIMP get_State( OUT CLUSTER_NETWORK_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_NetInterfaces( OUT ISClusNetworkNetInterfaces ** ppNetInterfaces );
  91. STDMETHODIMP get_Cluster( OUT ISCluster ** ppCluster );
  92. virtual HRESULT HrLoadProperties( IN OUT CClusPropList & rcplPropList, IN BOOL bReadOnly, IN BOOL bPrivate );
  93. const CComBSTR Name( void ) const { return m_bstrNetworkName ; };
  94. }; //*** Class CClusNetwork
  95. /////////////////////////////////////////////////////////////////////////////
  96. //++
  97. //
  98. // class CClusNetworks
  99. //
  100. // Description:
  101. // Cluster Networks Collection Automation Class.
  102. //
  103. // Inheritance:
  104. // IDispatchImpl< ISClusNetworks, &IID_ISClusNetworks, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  105. // CSupportErrorInfo,
  106. // CComObjectRootEx< CComSingleThreadModel >
  107. // CComCoClass< CClusNetworks, &CLSID_ClusNetworks >
  108. //
  109. //--
  110. /////////////////////////////////////////////////////////////////////////////
  111. class ATL_NO_VTABLE CClusNetworks :
  112. public IDispatchImpl< ISClusNetworks, &IID_ISClusNetworks, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  113. public CSupportErrorInfo,
  114. public CComObjectRootEx< CComSingleThreadModel >,
  115. public CComCoClass< CClusNetworks, &CLSID_ClusNetworks >
  116. {
  117. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  118. public:
  119. CClusNetworks( void );
  120. ~CClusNetworks( void );
  121. BEGIN_COM_MAP(CClusNetworks)
  122. COM_INTERFACE_ENTRY(IDispatch)
  123. COM_INTERFACE_ENTRY(ISClusNetworks)
  124. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  125. END_COM_MAP()
  126. DECLARE_NOT_AGGREGATABLE(CClusNetworks)
  127. DECLARE_NO_REGISTRY()
  128. HRESULT Create( IN ISClusRefObject* pClusRefObject );
  129. protected:
  130. typedef std::vector< CComObject<CClusNetwork> * > NetworkList;
  131. NetworkList m_NetworkList;
  132. ISClusRefObject * m_pClusRefObject;
  133. void Clear( void );
  134. HRESULT FindItem( IN LPWSTR lpszNetworkName, OUT UINT * pnIndex );
  135. HRESULT FindItem( IN ISClusNetwork * pClusterNetwork, OUT UINT * pnIndex );
  136. HRESULT GetIndex( IN VARIANT varIndex, OUT UINT * pnIndex );
  137. HRESULT GetItem( IN LPWSTR lpszNetworkName, OUT ISClusNetwork ** ppClusterNetwork );
  138. HRESULT GetItem( IN UINT nIndex, OUT ISClusNetwork ** ppClusterNetwork );
  139. public:
  140. STDMETHODIMP get_Count( OUT long * plCount );
  141. STDMETHODIMP get_Item( IN VARIANT varIndex, OUT ISClusNetwork ** ppClusterNetwork );
  142. STDMETHODIMP get__NewEnum( OUT IUnknown ** ppunk );
  143. STDMETHODIMP Refresh( void );
  144. }; //*** Class CClusNetworks
  145. #endif // _CLUSNETW_H_