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.

186 lines
5.0 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2001-2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CMajorityNodeSet.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CMajorityNodeSet
  10. // class.
  11. //
  12. // The class CMajorityNodeSet represents a cluster storage
  13. // device. It implements the IClusCfgManagaedResourceInfo interface.
  14. //
  15. // Documentation:
  16. //
  17. // Implementation Files:
  18. // CMajorityNodeSet.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. //////////////////////////////////////////////////////////////////////////////
  30. // Constant Declarations
  31. //////////////////////////////////////////////////////////////////////////////
  32. //////////////////////////////////////////////////////////////////////////////
  33. //++
  34. //
  35. // class CMajorityNodeSet
  36. //
  37. // Description:
  38. // The class CMajorityNodeSet represents a cluster storage device.
  39. //
  40. // Interfaces:
  41. // IClusCfgManagedResourceInfo
  42. // IClusCfgInitialize
  43. // IClusCfgManagedResourceCfg
  44. // IClusCfgManagedResourceData
  45. // IClusCfgVerifyQuorum
  46. //--
  47. //////////////////////////////////////////////////////////////////////////////
  48. class CMajorityNodeSet
  49. : public IClusCfgManagedResourceInfo
  50. , public IClusCfgInitialize
  51. , public IClusCfgManagedResourceCfg
  52. , public IClusCfgManagedResourceData
  53. , public IClusCfgVerifyQuorum
  54. {
  55. private:
  56. //
  57. // Private member functions and data
  58. //
  59. LONG m_cRef;
  60. LCID m_lcid;
  61. IClusCfgCallback * m_picccCallback;
  62. BOOL m_fIsQuorum;
  63. BOOL m_fIsMultiNodeCapable;
  64. BOOL m_fIsManaged;
  65. BOOL m_fIsManagedByDefault;
  66. BSTR m_bstrName;
  67. BOOL m_fIsQuorumCapable; // Is this resource quorum capable
  68. BOOL m_fAddedShare;
  69. CClusPropList m_cplPrivate;
  70. // Private constructors and destructors
  71. CMajorityNodeSet( void );
  72. ~CMajorityNodeSet( void );
  73. // Private copy constructor to prevent copying.
  74. CMajorityNodeSet( const CMajorityNodeSet & nodeSrc );
  75. // Private assignment operator to prevent copying.
  76. const CMajorityNodeSet & operator = ( const CMajorityNodeSet & nodeSrc );
  77. HRESULT HrInit( void );
  78. // Called from PrepareToHostQuorum.
  79. HRESULT HrSetupShare( LPCWSTR pcszGUIDIn );
  80. // Called from Cleanup.
  81. HRESULT HrDeleteShare( LPCWSTR pcszGUIDIn );
  82. public:
  83. //
  84. // Public, non interface methods.
  85. //
  86. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  87. //
  88. // IUnknown Interface
  89. //
  90. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  91. STDMETHOD_( ULONG, AddRef )( void );
  92. STDMETHOD_( ULONG, Release )( void );
  93. //
  94. // IClusCfgInitialize Interfaces
  95. //
  96. // Register callbacks, locale id, etc.
  97. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  98. //
  99. // IClusCfgManagedResourceInfo Interface
  100. //
  101. STDMETHOD( GetUID )( BSTR * pbstrUIDOut );
  102. STDMETHOD( GetName )( BSTR * pbstrNameOut );
  103. STDMETHOD( SetName )( LPCWSTR pcszNameIn );
  104. STDMETHOD( IsManaged )( void );
  105. STDMETHOD( SetManaged )( BOOL fIsManagedIn );
  106. STDMETHOD( IsQuorumResource )( void );
  107. STDMETHOD( SetQuorumResource )( BOOL fIsQuorumResourceIn );
  108. STDMETHOD( IsQuorumCapable )( void );
  109. STDMETHOD( SetQuorumCapable )( BOOL fIsQuorumCapableIn );
  110. STDMETHOD( GetDriveLetterMappings )( SDriveLetterMapping * pdlmDriveLetterMappingOut );
  111. STDMETHOD( SetDriveLetterMappings )( SDriveLetterMapping dlmDriveLetterMappings );
  112. STDMETHOD( IsManagedByDefault )( void );
  113. STDMETHOD( SetManagedByDefault )( BOOL fIsManagedByDefaultIn );
  114. //
  115. // IClusCfgManagedResourceCfg
  116. //
  117. STDMETHOD( PreCreate )( IUnknown * punkServicesIn );
  118. STDMETHOD( Create )( IUnknown * punkServicesIn );
  119. STDMETHOD( PostCreate )( IUnknown * punkServicesIn );
  120. STDMETHOD( Evict )( IUnknown * punkServicesIn );
  121. //
  122. // IClusCfgManagedResourceData
  123. //
  124. STDMETHOD( GetResourcePrivateData )( BYTE * pbBufferOut, DWORD * pcbBufferInout );
  125. STDMETHOD( SetResourcePrivateData )( const BYTE * pcbBufferIn, DWORD cbBufferIn );
  126. //
  127. // IClusCfgVerifyQuorum
  128. //
  129. STDMETHOD( PrepareToHostQuorumResource )( void );
  130. STDMETHOD( Cleanup )( EClusCfgCleanupReason cccrReasonIn );
  131. STDMETHOD( IsMultiNodeCapable )( void );
  132. STDMETHOD( SetMultiNodeCapable )( BOOL fMultiNodeCapableIn );
  133. }; //*** Class CMajorityNodeSet