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.

136 lines
3.8 KiB

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