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.

169 lines
4.5 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2001-2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CUnknownQuorum.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CUnknownQuorum
  10. // class.
  11. //
  12. // The class CUnknownQuorum represents a cluster quorum
  13. // device. It implements the IClusCfgManagaedResourceInfo interface.
  14. //
  15. // Documentation:
  16. //
  17. // Implementation Files:
  18. // CUnknownQuorum.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 CUnknownQuorum
  36. //
  37. // Description:
  38. // The class CUnknownQuorum represents a cluster quorum
  39. // device.
  40. //
  41. // Interfaces:
  42. // IClusCfgManagedResourceInfo
  43. // IClusCfgInitialize
  44. //--
  45. //////////////////////////////////////////////////////////////////////////////
  46. class CUnknownQuorum
  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. CUnknownQuorum( void );
  67. ~CUnknownQuorum( void );
  68. // Private copy constructor to prevent copying.
  69. CUnknownQuorum( const CUnknownQuorum & nodeSrc );
  70. // Private assignment operator to prevent copying.
  71. const CUnknownQuorum & operator = ( const CUnknownQuorum & nodeSrc );
  72. HRESULT HrInit( LPCWSTR pcszNameIn, BOOL fMakeQuorumIn = FALSE );
  73. public:
  74. //
  75. // Public, non interface methods.
  76. //
  77. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  78. static HRESULT S_HrCreateInstance( LPCWSTR pcszNameIn, BOOL fMakeQuorumIn, IUnknown ** ppunkOut );
  79. //
  80. // IUnknown Interface
  81. //
  82. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  83. STDMETHOD_( ULONG, AddRef )( void );
  84. STDMETHOD_( ULONG, Release )( void );
  85. //
  86. // IClusCfgInitialize Interfaces
  87. //
  88. // Register callbacks, locale id, etc.
  89. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  90. //
  91. // IClusCfgManagedResourceInfo Interface
  92. //
  93. STDMETHOD( GetUID )( BSTR * pbstrUIDOut );
  94. STDMETHOD( GetName )( BSTR * pbstrNameOut );
  95. STDMETHOD( SetName )( LPCWSTR pcszNameIn );
  96. STDMETHOD( IsManaged )( void );
  97. STDMETHOD( SetManaged )( BOOL fIsManagedIn );
  98. STDMETHOD( IsQuorumResource )( void );
  99. STDMETHOD( SetQuorumResource )( BOOL fIsQuorumResourceIn );
  100. STDMETHOD( IsQuorumCapable )( void );
  101. STDMETHOD( SetQuorumCapable )( BOOL fIsQuorumCapableIn );
  102. STDMETHOD( GetDriveLetterMappings )( SDriveLetterMapping * pdlmDriveLetterMappingOut );
  103. STDMETHOD( SetDriveLetterMappings )( SDriveLetterMapping dlmDriveLetterMappings );
  104. STDMETHOD( IsManagedByDefault )( void );
  105. STDMETHOD( SetManagedByDefault )( BOOL fIsManagedByDefaultIn );
  106. //
  107. // IClusCfgManagedResourceCfg
  108. //
  109. STDMETHOD( PreCreate )( IUnknown * punkServicesIn );
  110. STDMETHOD( Create )( IUnknown * punkServicesIn );
  111. STDMETHOD( PostCreate )( IUnknown * punkServicesIn );
  112. STDMETHOD( Evict )( IUnknown * punkServicesIn );
  113. //
  114. // IClusCfgVerifyQuorum
  115. //
  116. STDMETHOD( PrepareToHostQuorumResource )( void );
  117. STDMETHOD( Cleanup )( EClusCfgCleanupReason cccrReasonIn );
  118. STDMETHOD( IsMultiNodeCapable )( void );
  119. STDMETHOD( SetMultiNodeCapable )( BOOL fMultiNodeCapableIn );
  120. }; //*** Class CUnknownQuorum