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.

210 lines
5.9 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CClusCfgNetworkInfo.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CClusCfgNetworkInfo
  10. // class.
  11. //
  12. // The class CClusCfgNetworkInfo is the representation of a
  13. // cluster manageable network. It implements the IClusCfgNetworkInfo
  14. // interface.
  15. //
  16. // Documentation:
  17. //
  18. // Implementation Files:
  19. // CClusCfgNetworkInfo.cpp
  20. //
  21. // Maintained By:
  22. // Galen Barbee (GalenB) 23-FEB-2000
  23. //
  24. // Remarks:
  25. // None.
  26. //
  27. //
  28. //////////////////////////////////////////////////////////////////////////////
  29. // Make sure that this file is included only once per compile path.
  30. #pragma once
  31. //////////////////////////////////////////////////////////////////////////////
  32. // Include Files
  33. //////////////////////////////////////////////////////////////////////////////
  34. #include "PrivateInterfaces.h"
  35. //////////////////////////////////////////////////////////////////////////////
  36. // Constant Declarations
  37. //////////////////////////////////////////////////////////////////////////////
  38. //////////////////////////////////////////////////////////////////////////////
  39. //++
  40. //
  41. // class CClusCfgNetworkInfo
  42. //
  43. // Description:
  44. // The class CClusCfgNetworkInfo is the enumeration of
  45. // cluster manageable devices.
  46. //
  47. // Interfaces:
  48. // IClusCfgNetworkInfo
  49. // IClusCfgNetworkAdapterInfo
  50. // IClusCfgWbemServices
  51. //
  52. //--
  53. //////////////////////////////////////////////////////////////////////////////
  54. class CClusCfgNetworkInfo
  55. : public IClusCfgNetworkInfo
  56. , public IClusCfgSetWbemObject
  57. , public IClusCfgWbemServices
  58. , public IEnumClusCfgIPAddresses
  59. , public IClusCfgInitialize
  60. , public IClusCfgClusterNetworkInfo
  61. {
  62. private:
  63. enum EStates
  64. {
  65. eIsPrivate = 1,
  66. eIsPublic = 2
  67. };
  68. //
  69. // Private member functions and data
  70. //
  71. LONG m_cRef;
  72. DWORD m_dwFlags;
  73. LCID m_lcid;
  74. BSTR m_bstrName;
  75. BSTR m_bstrDescription;
  76. BSTR m_bstrDeviceID;
  77. BSTR m_bstrConnectionName;
  78. IWbemServices * m_pIWbemServices;
  79. IUnknown * m_punkAddresses;
  80. IClusCfgCallback * m_picccCallback;
  81. BOOL m_fNameChanged;
  82. BOOL m_fDescriptionChanged;
  83. BOOL m_fIsClusterNetwork;
  84. // Private constructors and destructors
  85. CClusCfgNetworkInfo( void );
  86. ~CClusCfgNetworkInfo( void );
  87. // Private copy constructor to prevent copying.
  88. CClusCfgNetworkInfo( const CClusCfgNetworkInfo & nodeSrc );
  89. // Private assignment operator to prevent copying.
  90. const CClusCfgNetworkInfo & operator = ( const CClusCfgNetworkInfo & nodeSrc );
  91. HRESULT HrInit( void );
  92. HRESULT HrInit( HNETWORK hNetworkIn, HNETINTERFACE hNetInterfaceIn );
  93. HRESULT HrLoadEnum( IWbemClassObject * pNetworkAdapterIn, bool * pfRetainObjectOut );
  94. HRESULT HrCreateEnum( void );
  95. HRESULT HrCreateEnumAndAddIPAddress( ULONG ulIPAddressIn, ULONG ulSubnetMaskIn );
  96. HRESULT HrGetPrimaryNetworkAddress( IClusCfgIPAddressInfo ** ppIPAddressOut, ULONG * pcFetched );
  97. public:
  98. //
  99. // Public, non interface methods.
  100. //
  101. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  102. static HRESULT S_HrCreateInstance(
  103. HNETWORK hNetworkIn
  104. , HNETINTERFACE hNetInterfaceIn
  105. , IUnknown * punkCallbackIn
  106. , LCID lcidIn
  107. , IWbemServices * pIWbemServicesIn
  108. , IUnknown ** ppunkOut
  109. );
  110. //
  111. // IUnknown Interfaces
  112. //
  113. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  114. STDMETHOD_( ULONG, AddRef )( void );
  115. STDMETHOD_( ULONG, Release )( void );
  116. //
  117. // IClusCfgInitialize Interfaces
  118. //
  119. // Register callbacks, locale id, etc.
  120. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  121. //
  122. // IClusCfgWbemServices Interfaces
  123. //
  124. STDMETHOD( SetWbemServices )( IWbemServices * pIWbemServicesIn );
  125. //
  126. // IClusCfgNetworkInfo Interfaces.
  127. //
  128. STDMETHOD( GetUID )( BSTR * pbstrUIDOut );
  129. STDMETHOD( GetName )( BSTR * pbstrNameOut );
  130. STDMETHOD( SetName )( LPCWSTR pcszNameIn );
  131. STDMETHOD( GetDescription )( BSTR * pbstrDescriptionOut );
  132. STDMETHOD( SetDescription )( LPCWSTR pcszDescriptionIn );
  133. STDMETHOD( GetPrimaryNetworkAddress )( IClusCfgIPAddressInfo ** ppIPAddressOut );
  134. STDMETHOD( SetPrimaryNetworkAddress )( IClusCfgIPAddressInfo * pIPAddressIn );
  135. STDMETHOD( IsPublic )( void );
  136. STDMETHOD( SetPublic )( BOOL fIsPublicIn );
  137. STDMETHOD( IsPrivate )( void );
  138. STDMETHOD( SetPrivate )( BOOL fIsPrivateIn );
  139. //
  140. // IEnumClusCfgIPAddresses Interfaces
  141. //
  142. STDMETHOD( Next )( ULONG cNumberRequestedIn, IClusCfgIPAddressInfo ** rgpIPAddressInfoOut, ULONG * pcNumberFetchedOut );
  143. STDMETHOD( Skip )( ULONG cNumberToSkipIn );
  144. STDMETHOD( Reset )( void );
  145. STDMETHOD( Clone )( IEnumClusCfgIPAddresses ** ppEnumClusCfgIPAddressesOut );
  146. STDMETHOD( Count )( DWORD * pnCountOut );
  147. //
  148. // IClusCfgSetWbemObject
  149. //
  150. STDMETHOD( SetWbemObject )( IWbemClassObject * pNetworkAdapterIn, bool * pfRetainObjectOut );
  151. //
  152. // IClusCfgClusterNetworkInfo
  153. //
  154. STDMETHOD( HrIsClusterNetwork )( void );
  155. STDMETHOD( HrGetNetUID )( BSTR * pbstrUIDOut, const CLSID * pclsidMajorIdIn, LPCWSTR pwszNetworkNameIn );
  156. STDMETHOD( HrGetPrimaryNetAddress )( IClusCfgIPAddressInfo ** ppIPAddressOut, const CLSID * pclsidMajorIdIn, LPCWSTR pwszNetworkNameIn );
  157. }; //*** Class CClusCfgNetworkInfo