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.

168 lines
4.4 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CLocalQuorum.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CLocalQuorum
  10. // class.
  11. //
  12. // The class CLocalQuorum represents a cluster storage
  13. // device. It implements the IClusCfgManagaedResourceInfo interface.
  14. //
  15. // Documentation:
  16. //
  17. // Implementation Files:
  18. // CLocalQuorum.cpp
  19. //
  20. // Maintained By:
  21. // Galen Barbee (GalenB) 18-DEC-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. //////////////////////////////////////////////////////////////////////////////
  30. // Constant Declarations
  31. //////////////////////////////////////////////////////////////////////////////
  32. //////////////////////////////////////////////////////////////////////////////
  33. //++
  34. //
  35. // class CLocalQuorum
  36. //
  37. // Description:
  38. // The class CLocalQuorum represents a cluster storage
  39. // device.
  40. //
  41. // Interfaces:
  42. // IClusCfgManagedResourceInfo
  43. // IClusCfgInitialize
  44. //--
  45. //////////////////////////////////////////////////////////////////////////////
  46. class CLocalQuorum
  47. : public IClusCfgManagedResourceInfo
  48. , public IClusCfgInitialize
  49. , public IClusCfgManagedResourceCfg
  50. , public IClusCfgVerifyQuorum
  51. {
  52. private:
  53. //
  54. // Private member functions and data
  55. //
  56. LONG m_cRef;
  57. LCID m_lcid;
  58. IClusCfgCallback * m_picccCallback;
  59. BOOL m_fIsQuorum;
  60. BOOL m_fIsMultiNodeCapable;
  61. BOOL m_fIsManaged;
  62. BOOL m_fIsManagedByDefault;
  63. BSTR m_bstrName;
  64. BOOL m_fIsQuorumCapable; // Is this resource quorum capable
  65. // Private constructors and destructors
  66. CLocalQuorum( void );
  67. ~CLocalQuorum( void );
  68. // Private copy constructor to prevent copying.
  69. CLocalQuorum( const CLocalQuorum & nodeSrc );
  70. // Private assignment operator to prevent copying.
  71. const CLocalQuorum & operator = ( const CLocalQuorum & nodeSrc );
  72. HRESULT HrInit( void );
  73. public:
  74. //
  75. // Public, non interface methods.
  76. //
  77. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  78. //
  79. // IUnknown Interface
  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. // IClusCfgManagedResourceInfo Interface
  91. //
  92. STDMETHOD( GetUID )( BSTR * pbstrUIDOut );
  93. STDMETHOD( GetName )( BSTR * pbstrNameOut );
  94. STDMETHOD( SetName )( LPCWSTR bstrNameIn );
  95. STDMETHOD( IsManaged )( void );
  96. STDMETHOD( SetManaged )( BOOL fIsManagedIn );
  97. STDMETHOD( IsQuorumResource )( void );
  98. STDMETHOD( SetQuorumResource )( BOOL fIsQuorumResourceIn );
  99. STDMETHOD( IsQuorumCapable )( void );
  100. STDMETHOD( SetQuorumCapable )( BOOL fIsQuorumCapableIn );
  101. STDMETHOD( GetDriveLetterMappings )( SDriveLetterMapping * pdlmDriveLetterMappingOut );
  102. STDMETHOD( SetDriveLetterMappings )( SDriveLetterMapping dlmDriveLetterMappings );
  103. STDMETHOD( IsManagedByDefault )( void );
  104. STDMETHOD( SetManagedByDefault )( BOOL fIsManagedByDefaultIn );
  105. //
  106. // IClusCfgManagedResourceCfg
  107. //
  108. STDMETHOD( PreCreate )( IUnknown * punkServicesIn );
  109. STDMETHOD( Create )( IUnknown * punkServicesIn );
  110. STDMETHOD( PostCreate )( IUnknown * punkServicesIn );
  111. STDMETHOD( Evict )( IUnknown * punkServicesIn );
  112. //
  113. // IClusCfgVerifyQuorum
  114. //
  115. STDMETHOD( PrepareToHostQuorumResource )( void );
  116. STDMETHOD( Cleanup )( EClusCfgCleanupReason cccrReasonIn );
  117. STDMETHOD( IsMultiNodeCapable )( void );
  118. STDMETHOD( SetMultiNodeCapable )( BOOL fMultiNodeCapableIn );
  119. }; //*** Class CLocalQuorum