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.

135 lines
3.9 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CEnumUnknownQuorum.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CEnumUnknownQuorum class.
  10. //
  11. // The class CEnumUnknownQuorum is the enumeration of unknown cluster
  12. // storage devices. It implements the IEnumClusCfgManagedResources
  13. // interface.
  14. //
  15. // Unknown quorum resources are "proxy" objects for quorum capable
  16. // devices that are not known to this setup wizard.
  17. //
  18. // Documentation:
  19. //
  20. // Implementation Files:
  21. // CEnumUnknownQuorum.cpp
  22. //
  23. // Maintained By:
  24. // Galen Barbee (GalenB) 10-MAY-2001
  25. //
  26. //////////////////////////////////////////////////////////////////////////////
  27. // Make sure that this file is included only once per compile path.
  28. #pragma once
  29. //////////////////////////////////////////////////////////////////////////////
  30. // Include Files
  31. //////////////////////////////////////////////////////////////////////////////
  32. #include "CClusterUtils.h"
  33. //////////////////////////////////////////////////////////////////////////////
  34. // Constant Declarations
  35. //////////////////////////////////////////////////////////////////////////////
  36. //////////////////////////////////////////////////////////////////////////////
  37. //++
  38. //
  39. // class CEnumUnknownQuorum
  40. //
  41. // Description:
  42. // The class CEnumUnknownQuorum is the enumeration of unknown cluster
  43. // quorum devices.
  44. //
  45. // Interfaces:
  46. // IEnumClusCfgManagedResources
  47. // IClusCfgInitialize
  48. //
  49. //--
  50. //////////////////////////////////////////////////////////////////////////////
  51. class CEnumUnknownQuorum
  52. : public IEnumClusCfgManagedResources
  53. , public IClusCfgInitialize
  54. {
  55. private:
  56. //
  57. // Private member functions and data
  58. //
  59. LONG m_cRef;
  60. LCID m_lcid;
  61. BOOL m_fEnumLoaded;
  62. IClusCfgCallback * m_picccCallback;
  63. IUnknown * ((*m_prgQuorums)[]);
  64. ULONG m_idxNext;
  65. ULONG m_idxEnumNext;
  66. BSTR m_bstrNodeName;
  67. BOOL m_fDefaultDeviceToQuorum;
  68. BSTR m_bstrQuorumResourceName;
  69. // Private constructors and destructors
  70. CEnumUnknownQuorum( void );
  71. ~CEnumUnknownQuorum( void );
  72. // Private copy constructor to prevent copying.
  73. CEnumUnknownQuorum( const CEnumUnknownQuorum & nodeSrc );
  74. // Private assignment operator to prevent copying.
  75. const CEnumUnknownQuorum & operator = ( const CEnumUnknownQuorum & nodeSrc );
  76. HRESULT HrInit( BSTR bstrNameIn, BOOL fMakeQuorumIn = FALSE );
  77. HRESULT HrAddResourceToArray( IUnknown * punkIn );
  78. HRESULT HrCreateDummyObject( void );
  79. public:
  80. //
  81. // IUnknown Interfaces
  82. //
  83. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  84. STDMETHOD_( ULONG, AddRef )( void );
  85. STDMETHOD_( ULONG, Release )( void );
  86. //
  87. // IClusCfgInitialize Interfaces
  88. //
  89. // Register callbacks, locale id, etc.
  90. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  91. //
  92. // IEnumClusCfgManagedResources Interfaces
  93. //
  94. STDMETHOD( Next )( ULONG cNumberRequestedIn, IClusCfgManagedResourceInfo ** rgpManagedResourceInfoOut, ULONG * pcNumberFetchedOut );
  95. STDMETHOD( Skip )( ULONG cNumberToSkipIn );
  96. STDMETHOD( Reset )( void );
  97. STDMETHOD( Clone )( IEnumClusCfgManagedResources ** ppEnumClusCfgStorageDevicesOut );
  98. STDMETHOD( Count )( DWORD * pnCountOut );
  99. //
  100. // Public, non interface methods.
  101. //
  102. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  103. static HRESULT S_HrCreateInstance( BSTR bstrNameIn, BOOL fMakeQuorumIn, IUnknown ** ppunkOut );
  104. //static HRESULT S_RegisterCatIDSupport( ICatRegister * picrIn, BOOL fCreateIn );
  105. }; //*** Class CEnumUnknownQuorum