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.

142 lines
3.9 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CEnumClusterResources.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CEnumClusterResources class.
  10. //
  11. // The class CEnumClusterResources is the enumeration of cluster
  12. // resources. It implements the IEnumClusCfgMangedResources
  13. // interface.
  14. //
  15. // Documentation:
  16. //
  17. // Implementation Files:
  18. // CEnumClusterResources.cpp
  19. //
  20. // Maintained By:
  21. // Galen Barbee (GalenB) 12-JUN-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 CEnumClusterResources
  38. //
  39. // Description:
  40. // The class CEnumClusterResources is the enumeration of cluster
  41. // resources.
  42. //
  43. // Interfaces:
  44. // IEnumClusCfgManagedResources
  45. // IClusCfgInitialize
  46. // CClusterUtils
  47. //
  48. //--
  49. //////////////////////////////////////////////////////////////////////////////
  50. class CEnumClusterResources
  51. : public IEnumClusCfgManagedResources
  52. , public IClusCfgInitialize
  53. , public CClusterUtils
  54. {
  55. private:
  56. //
  57. // Private member functions and data
  58. //
  59. LONG m_cRef;
  60. LCID m_lcid;
  61. BOOL m_fLoadedResources;
  62. IClusCfgCallback * m_picccCallback;
  63. IUnknown * ((*m_prgResources)[]);
  64. ULONG m_idxNext;
  65. ULONG m_idxEnumNext;
  66. BSTR m_bstrNodeName;
  67. DWORD m_cTotalResources;
  68. // Private constructors and destructors
  69. CEnumClusterResources( void );
  70. ~CEnumClusterResources( void );
  71. // Private copy constructor to prevent copying.
  72. CEnumClusterResources( const CEnumClusterResources & nodeSrc );
  73. // Private assignment operator to prevent copying.
  74. const CEnumClusterResources & operator = ( const CEnumClusterResources & nodeSrc );
  75. HRESULT HrInit( void );
  76. HRESULT HrGetResources( void );
  77. HRESULT HrCreateResourceAndAddToArray( HCLUSTER hClusterIn, HRESOURCE hResourceIn );
  78. HRESULT HrAddResourceToArray( IUnknown * punkIn );
  79. public:
  80. //
  81. // Public, non interface methods.
  82. //
  83. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  84. static HRESULT S_RegisterCatIDSupport( ICatRegister * picrIn, BOOL fCreateIn );
  85. //
  86. // IUnknown Interfaces
  87. //
  88. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  89. STDMETHOD_( ULONG, AddRef )( void );
  90. STDMETHOD_( ULONG, Release )( void );
  91. //
  92. // IClusCfgInitialize Interfaces
  93. //
  94. // Register callbacks, locale id, etc.
  95. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  96. //
  97. // CClusterUtils
  98. //
  99. HRESULT HrNodeResourceCallback( HCLUSTER hClusterIn, HRESOURCE hResourceIn );
  100. //
  101. // IEnumClusCfgManagedResources Interfaces
  102. //
  103. STDMETHOD( Next )( ULONG cNumberRequestedIn, IClusCfgManagedResourceInfo ** rgpManagedResourceInfoOut, ULONG * pcNumberFetchedOut );
  104. STDMETHOD( Skip )( ULONG cNumberToSkipIn );
  105. STDMETHOD( Reset )( void );
  106. STDMETHOD( Clone )( IEnumClusCfgManagedResources ** ppEnumClusCfgStorageDevicesOut );
  107. STDMETHOD( Count )( DWORD * pnCountOut );
  108. }; //*** Class CEnumClusterResources