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.

130 lines
5.3 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CResourcePhysicalDisk.h
  7. //
  8. // Description:
  9. // CResourcePhysicalDisk definition.
  10. //
  11. // Maintained By:
  12. // Galen Barbee (GalenB) 02-AUG-2000
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. // Make sure that this file is included only once per compile path.
  16. #pragma once
  17. //////////////////////////////////////////////////////////////////////////////
  18. //++
  19. //
  20. // class CResourcePhysicalDisk
  21. //
  22. // Description:
  23. // The class CResourcePhysicalDisk is the cluster storage device.
  24. //
  25. // Interfaces:
  26. // CBaseClusterResourceInfo
  27. // IClusCfgManagedResourceInfo
  28. // IClusCfgInitialize
  29. // IEnumClusCfgPartitions
  30. //
  31. //--
  32. //////////////////////////////////////////////////////////////////////////////
  33. class CResourcePhysicalDisk
  34. : public IClusCfgManagedResourceInfo
  35. , public IEnumClusCfgPartitions
  36. , public IClusCfgVerifyQuorum
  37. {
  38. private:
  39. LONG m_cRef; // Reference counter
  40. IUnknown * m_punkOuter; // Interface to Outer W2KProxy object
  41. IClusCfgCallback * m_pcccb; // Callback interface
  42. HCLUSTER * m_phCluster; // Pointer to cluster handle.
  43. CLSID * m_pclsidMajor; // CLSID to use when log errors to the UI
  44. CClusPropList m_cplResource; // Property list for the resource
  45. CClusPropList m_cplResourceRO; // Property list for the resource READ ONLY
  46. CClusPropValueList m_cpvlDiskInfo; // GetDiskInfo property value list
  47. DWORD m_dwFlags; // CLUSCTL_RESOURCE_GET_FLAGS
  48. ULONG m_cParitions; // Number of partitions
  49. IClusCfgPartitionInfo ** m_ppPartitions; // Array of partition objects - length is m_cPartitions
  50. ULONG m_ulCurrent; // Current index into the array
  51. BOOL m_fIsQuorumCapable; // Is this resource quorum capable
  52. CResourcePhysicalDisk( void );
  53. ~CResourcePhysicalDisk( void );
  54. // Private copy constructor to prevent copying.
  55. CResourcePhysicalDisk( const CResourcePhysicalDisk & nodeSrc );
  56. // Private assignment operator to prevent copying.
  57. const CResourcePhysicalDisk & operator = ( const CResourcePhysicalDisk & nodeSrc );
  58. HRESULT
  59. HrInit( IUnknown * punkOuterIn,
  60. HCLUSTER * phClusterIn,
  61. CLSID * pclsidMajorIn,
  62. LPCWSTR pcszNameIn
  63. );
  64. public:
  65. static HRESULT
  66. S_HrCreateInstance( IUnknown ** punkOut,
  67. IUnknown * punkOuterIn,
  68. HCLUSTER * phClusterIn,
  69. CLSID * pclsidMajorIn,
  70. LPCWSTR pcszNameIn
  71. );
  72. // IUnknown
  73. STDMETHOD( QueryInterface )( REFIID riid, LPVOID * ppv );
  74. STDMETHOD_( ULONG, AddRef )( void );
  75. STDMETHOD_( ULONG, Release )( void );
  76. // IClusCfgManagedResourceInfo
  77. STDMETHOD( GetUID )( BSTR * pbstrUIDOut );
  78. STDMETHOD( GetName )( BSTR * pbstrNameOut );
  79. STDMETHOD( SetName )( LPCWSTR pcszNameIn );
  80. STDMETHOD( IsManaged )( void );
  81. STDMETHOD( SetManaged )( BOOL fIsManagedIn );
  82. STDMETHOD( IsQuorumResource )( void );
  83. STDMETHOD( SetQuorumResource )( BOOL fIsQuorumResourceIn );
  84. STDMETHOD( IsQuorumCapable )( void );
  85. STDMETHOD( SetQuorumCapable )( BOOL fIsQuorumCapableIn );
  86. STDMETHOD( GetDriveLetterMappings )( SDriveLetterMapping * pdlmDriveLetterMappingOut );
  87. STDMETHOD( SetDriveLetterMappings )( SDriveLetterMapping dlmDriveLetterMappingIn );
  88. STDMETHOD( IsManagedByDefault )( void );
  89. STDMETHOD( SetManagedByDefault )( BOOL fIsManagedByDefaultIn );
  90. // IEnumClusCfgPartitions
  91. STDMETHOD( Next )( ULONG cNumberRequestedIn, IClusCfgPartitionInfo ** rgpPartitionInfoOut, ULONG * pcNumberFetchedOut );
  92. STDMETHOD( Reset )( void );
  93. STDMETHOD( Skip )( ULONG cNumberToSkipIn );
  94. STDMETHOD( Clone )( IEnumClusCfgPartitions ** ppEnumPartitions );
  95. STDMETHOD( Count )( DWORD * pnCountOut );
  96. // IClusCfgCallback
  97. STDMETHOD( SendStatusReport )(
  98. LPCWSTR pcszNodeNameIn
  99. , CLSID clsidTaskMajorIn
  100. , CLSID clsidTaskMinorIn
  101. , ULONG ulMinIn
  102. , ULONG ulMaxIn
  103. , ULONG ulCurrentIn
  104. , HRESULT hrStatusIn
  105. , LPCWSTR pcszDescriptionIn
  106. , FILETIME * pftTimeIn
  107. , LPCWSTR pcszReferenceIn
  108. );
  109. // IClusCfgVerifyQuorum
  110. STDMETHOD( PrepareToHostQuorumResource )( void );
  111. STDMETHOD( Cleanup )( EClusCfgCleanupReason cccrReasonIn );
  112. STDMETHOD( IsMultiNodeCapable )( void );
  113. STDMETHOD( SetMultiNodeCapable )( BOOL fMultiNodeCapableIn );
  114. }; //*** Class CResourcePhysicalDisk