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.

145 lines
4.3 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CEnumClusCfgNetworks.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CEnumClusCfgNetworks
  10. // class.
  11. //
  12. // The class CEnumClusCfgNetworks is the enumeration of
  13. // cluster networks. It implements the IEnumClusCfgNetworks interface.
  14. //
  15. // Documentation:
  16. //
  17. // Implementation Files:
  18. // CEnumClusCfgNetworks.cpp
  19. //
  20. // Maintained By:
  21. // Galen Barbee (GalenB) 23-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 "PrivateInterfaces.h"
  30. #include "CClusterUtils.h"
  31. //////////////////////////////////////////////////////////////////////////////
  32. // Constant Declarations
  33. //////////////////////////////////////////////////////////////////////////////
  34. //////////////////////////////////////////////////////////////////////////////
  35. //++
  36. //
  37. // class CEnumClusCfgNetworks
  38. //
  39. // Description:
  40. // The class CEnumClusCfgNetworks is the enumeration of cluster networks.
  41. //
  42. // Interfaces:
  43. // IEnumClusCfgNetworks
  44. // IClusCfgWbemServices
  45. // IClusCfgInitialize
  46. //
  47. //--
  48. //////////////////////////////////////////////////////////////////////////////
  49. class CEnumClusCfgNetworks
  50. : public IEnumClusCfgNetworks
  51. , public IClusCfgWbemServices
  52. , public IClusCfgInitialize
  53. {
  54. private:
  55. //
  56. // Private member functions and data
  57. //
  58. LONG m_cRef;
  59. LCID m_lcid;
  60. IClusCfgCallback * m_picccCallback;
  61. IWbemServices * m_pIWbemServices;
  62. IUnknown * ((*m_prgNetworks)[]);
  63. BOOL m_fLoadedNetworks;
  64. ULONG m_idxNext;
  65. ULONG m_idxEnumNext;
  66. BSTR m_bstrNodeName;
  67. DWORD m_cNetworks;
  68. // Private constructors and destructors
  69. CEnumClusCfgNetworks( void );
  70. ~CEnumClusCfgNetworks( void );
  71. // Private copy constructor to prevent copying.
  72. CEnumClusCfgNetworks( const CEnumClusCfgNetworks & nodeSrc );
  73. // Private assignment operator to prevent copying.
  74. const CEnumClusCfgNetworks & operator = ( const CEnumClusCfgNetworks & nodeSrc );
  75. HRESULT HrInit( void );
  76. HRESULT HrGetNetworks( void );
  77. HRESULT HrAddNetworkToArray( IUnknown * punkIn );
  78. HRESULT HrCreateAndAddNetworkToArray( IWbemClassObject * pNetworkIn, const CLSID * pclsidMajorIdIn, LPCWSTR pwszNetworkNameIn );
  79. HRESULT HrIsThisNetworkUnique( IUnknown * punkIn, IWbemClassObject * pNetworkIn, const CLSID * pclsidMajorIdIn, LPCWSTR pwszNetworkNameIn );
  80. HRESULT HrCheckForNLBS( void );
  81. HRESULT HrLoadClusterNetworks( void );
  82. HRESULT HrLoadClusterNetwork( HNETWORK hNetworkResourceIn, HNETINTERFACE hNetInterfaceIn );
  83. HRESULT HrFindNetInterface( HNETWORK hNetworkIn, BSTR * pbstrNetInterfaceNameOut );
  84. public:
  85. //
  86. // Public, non interface methods.
  87. //
  88. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  89. //
  90. // IUnknown Interfaces
  91. //
  92. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  93. STDMETHOD_( ULONG, AddRef )( void );
  94. STDMETHOD_( ULONG, Release )( void );
  95. //
  96. // IClusCfgWbemServices Interfaces
  97. //
  98. STDMETHOD( SetWbemServices )( IWbemServices * pIWbemServicesIn );
  99. //
  100. // IClusCfgInitialize Interfaces
  101. //
  102. // Register callbacks, locale id, etc.
  103. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  104. //
  105. // IEnumClusCfgNetworks Interfaces
  106. //
  107. STDMETHOD( Next )( ULONG cNumberRequestedIn, IClusCfgNetworkInfo ** rgpNetworkInfoOut, ULONG * pcNumberFetchedOut );
  108. STDMETHOD( Skip )( ULONG cNumberToSkipIn );
  109. STDMETHOD( Reset )( void );
  110. STDMETHOD( Clone )( IEnumClusCfgNetworks ** ppEnumNetworksOut );
  111. STDMETHOD( Count )( DWORD * pnCountOut );
  112. }; //*** Class CEnumClusCfgNetworks