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.

161 lines
4.8 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CEnumClusCfgIPAddresses.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CEnumClusCfgIPAddresses
  10. // class.
  11. //
  12. // The class CEnumClusCfgIPAddresses is the enumeration of IP
  13. // addresses. It implements the CEnumClusCfgIPAddresses
  14. // interface.
  15. //
  16. // Documentation:
  17. //
  18. // Implementation Files:
  19. // CEnumClusCfgIPAddresses.cpp
  20. //
  21. // Maintained By:
  22. // Galen Barbee (GalenB) 23-MAR-2000
  23. //
  24. //////////////////////////////////////////////////////////////////////////////
  25. // Make sure that this file is included only once per compile path.
  26. #pragma once
  27. //////////////////////////////////////////////////////////////////////////////
  28. // Include Files
  29. //////////////////////////////////////////////////////////////////////////////
  30. #include "PrivateInterfaces.h"
  31. //////////////////////////////////////////////////////////////////////////////
  32. // Constant Declarations
  33. //////////////////////////////////////////////////////////////////////////////
  34. //////////////////////////////////////////////////////////////////////////////
  35. //++
  36. //
  37. // class CEnumClusCfgIPAddresses
  38. //
  39. // Description:
  40. // The class CEnumClusCfgIPAddresses is the enumeration of
  41. // IP addresses.
  42. //
  43. // Interfaces:
  44. // CEnumClusCfgIPAddresses
  45. // IClusCfgWbemServices
  46. // IClusCfgInitialize
  47. // IClusCfgNetworkAdapterInfo
  48. //
  49. //--
  50. //////////////////////////////////////////////////////////////////////////////
  51. class CEnumClusCfgIPAddresses
  52. : public IEnumClusCfgIPAddresses
  53. , public IClusCfgWbemServices
  54. , public IClusCfgInitialize
  55. , public IClusCfgSetWbemObject
  56. {
  57. private:
  58. //
  59. // Private member functions and data
  60. //
  61. LONG m_cRef;
  62. LCID m_lcid;
  63. IClusCfgCallback * m_picccCallback;
  64. IWbemServices * m_pIWbemServices;
  65. ULONG m_idxEnumNext;
  66. IUnknown * ((*m_prgAddresses)[]);
  67. ULONG m_idxNext;
  68. DWORD m_cAddresses;
  69. // Private constructors and destructors
  70. CEnumClusCfgIPAddresses( void );
  71. ~CEnumClusCfgIPAddresses( void );
  72. // Private copy constructor to prevent copying.
  73. CEnumClusCfgIPAddresses( const CEnumClusCfgIPAddresses & nodeSrc );
  74. // Private assignment operator to prevent copying.
  75. const CEnumClusCfgIPAddresses & operator = ( const CEnumClusCfgIPAddresses & nodeSrc );
  76. HRESULT HrInit( void );
  77. HRESULT HrInit( ULONG ulIPAddressIn, ULONG IPSubnetIn );
  78. HRESULT HrGetAdapterConfiguration( IWbemClassObject * pNetworkAdapterIn );
  79. HRESULT HrSaveIPAddresses( BSTR bstrAdapterNameIn, IWbemClassObject * pConfigurationIn );
  80. HRESULT HrAddIPAddressToArray( IUnknown * punkIn );
  81. HRESULT HrCreateIPAddress( IUnknown ** ppunkOut );
  82. HRESULT HrCreateIPAddress( ULONG ulIPAddressIn, ULONG ulIPSubnetIn, IUnknown ** ppunkOut );
  83. HRESULT HrMakeDottedQuad( BSTR bstrDottedQuadIn, ULONG * pulDottedQuadOut );
  84. HRESULT HrSaveAddressInfo( BSTR bstrAdapterNameIn, SAFEARRAY * pIPAddresses, SAFEARRAY * pIPSubnets );
  85. public:
  86. //
  87. // Public, non interface methods.
  88. //
  89. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  90. static HRESULT S_HrCreateInstance(
  91. ULONG ulIPAddressIn
  92. , ULONG IPSubnetIn
  93. , IUnknown * punkCallbackIn
  94. , LCID lcidIn
  95. , IWbemServices * pIWbemServicesIn
  96. , IUnknown ** ppunkOut
  97. );
  98. //
  99. // IUnknown Interfaces
  100. //
  101. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  102. STDMETHOD_( ULONG, AddRef )( void );
  103. STDMETHOD_( ULONG, Release )( void );
  104. //
  105. // IClusCfgWbemServices Interfaces
  106. //
  107. STDMETHOD( SetWbemServices )( IWbemServices * pIWbemServicesIn );
  108. //
  109. // IClusCfgInitialize Interfaces
  110. //
  111. // Register callbacks, locale id, etc.
  112. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  113. //
  114. // IEnumClusCfgIPAddresses Interfaces
  115. //
  116. STDMETHOD( Next )( ULONG cNumberRequestedIn, IClusCfgIPAddressInfo ** rgpIPAddressInfoOut, ULONG * pcNumberFetchedOut );
  117. STDMETHOD( Skip )( ULONG cNumberToSkipIn );
  118. STDMETHOD( Reset )( void );
  119. STDMETHOD( Clone )( IEnumClusCfgIPAddresses ** ppEnumClusCfgIPAddressesOut );
  120. STDMETHOD( Count )( DWORD * pnCountOut );
  121. //
  122. // IClusCfgSetWbemObject Interfaces
  123. //
  124. STDMETHOD( SetWbemObject )( IWbemClassObject * pNetworkAdapterIn, bool * pfRetainObjectOut );
  125. }; //*** Class CEnumClusCfgIPAddresses