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.

158 lines
4.1 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CClusterResource.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CClusterResource
  10. // class.
  11. //
  12. // The class CClusterResource represents a cluster resource.
  13. // It implements the IClusCfgManagaedResourceInfo interface.
  14. //
  15. // Documentation:
  16. //
  17. // Implementation Files:
  18. // CClusterResource.cpp
  19. //
  20. // Maintained By:
  21. // Galen Barbee (GalenB) 13-JUN-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. #include "PrivateInterfaces.h"
  30. //////////////////////////////////////////////////////////////////////////////
  31. // Constant Declarations
  32. //////////////////////////////////////////////////////////////////////////////
  33. //////////////////////////////////////////////////////////////////////////////
  34. //++
  35. //
  36. // class CClusterResource
  37. //
  38. // Description:
  39. // The class CClusterResource represents a cluster storage
  40. // device.
  41. //
  42. // Interfaces:
  43. // IClusCfgManagedResourceInfo
  44. // IClusCfgInitialize
  45. // IClusCfgLoadResource
  46. //--
  47. //////////////////////////////////////////////////////////////////////////////
  48. class CClusterResource
  49. : public IClusCfgManagedResourceInfo
  50. , public IClusCfgInitialize
  51. , public IClusCfgLoadResource
  52. {
  53. private:
  54. enum EStates
  55. {
  56. eIsQuorumDevice = 1,
  57. eIsQuorumCapable = 2,
  58. eIsQuorumJoinable = 4
  59. };
  60. //
  61. // Private member functions and data
  62. //
  63. LONG m_cRef;
  64. LCID m_lcid;
  65. IClusCfgCallback * m_picccCallback;
  66. DWORD m_dwFlags;
  67. BSTR m_bstrName;
  68. BSTR m_bstrDescription;
  69. BSTR m_bstrType;
  70. // Private constructors and destructors
  71. CClusterResource( void );
  72. ~CClusterResource( void );
  73. // Private copy constructor to prevent copying.
  74. CClusterResource( const CClusterResource & nodeSrc );
  75. // Private assignment operator to prevent copying.
  76. const CClusterResource & operator = ( const CClusterResource & nodeSrc );
  77. HRESULT HrInit( void );
  78. HRESULT HrIsResourceQuorumCapabile( HRESOURCE hResourceIn );
  79. HRESULT HrDetermineQuorumJoinable( HRESOURCE hResourceIn );
  80. public:
  81. //
  82. // Public, non interface methods.
  83. //
  84. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  85. //
  86. // IUnknown Interface
  87. //
  88. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  89. STDMETHOD_( ULONG, AddRef )( void );
  90. STDMETHOD_( ULONG, Release )( void );
  91. //
  92. // IClusCfgInitialize Interfaces
  93. //
  94. // Register callbacks, locale id, etc.
  95. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  96. //
  97. // IClusCfgLoadResoruce Interfaces
  98. //
  99. STDMETHOD( LoadResource )( HCLUSTER hClusterIn, HRESOURCE hResourceIn );
  100. //
  101. // IClusCfgManagedResourceInfo Interface
  102. //
  103. STDMETHOD( GetUID )( BSTR * pbstrUIDOut );
  104. STDMETHOD( GetName )( BSTR * pbstrNameOut );
  105. STDMETHOD( SetName )( BSTR bstrNameIn );
  106. STDMETHOD( IsManaged )( void );
  107. STDMETHOD( SetManaged )( BOOL fIsManagedIn );
  108. STDMETHOD( IsQuorumDevice )( void );
  109. STDMETHOD( SetQuorumedDevice )( BOOL fIsQuorumDeviceIn );
  110. STDMETHOD( IsQuorumCapable )( void );
  111. STDMETHOD( SetQuorumCapable )( BOOL fIsQuorumCapableIn );
  112. STDMETHOD( GetDriveLetterMappings )( SDriveLetterMapping * pdlmDriveLetterMappingOut );
  113. STDMETHOD( SetDriveLetterMappings )( SDriveLetterMapping dlmDriveLetterMappings );
  114. STDMETHOD( IsDeviceJoinable )( void );
  115. STDMETHOD( SetDeviceJoinable )( BOOL fIsJoinableIn );
  116. }; //*** Class CClusterResource