Source code of Windows XP (NT5)
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.

170 lines
5.3 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CEnumPhysicalDisks.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CEnumPhysicalDisks class.
  10. //
  11. // The class CEnumPhysicalDisks is the enumeration of cluster
  12. // storage devices. It implements the IEnumClusCfgManagedResources
  13. // interface.
  14. //
  15. // Documentation:
  16. //
  17. // Implementation Files:
  18. // CEnumPhysicalDisks.cpp
  19. //
  20. // Maintained By:
  21. // Galen Barbee (GalenB) 23-FEB-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. #include "CClusterUtils.h"
  31. //////////////////////////////////////////////////////////////////////////////
  32. // Constant Declarations
  33. //////////////////////////////////////////////////////////////////////////////
  34. //////////////////////////////////////////////////////////////////////////////
  35. //++
  36. //
  37. // class CEnumPhysicalDisks
  38. //
  39. // Description:
  40. // The class CEnumPhysicalDisks is the enumeration of cluster storage
  41. // devices.
  42. //
  43. // Interfaces:
  44. // IEnumClusCfgManagedResources
  45. // IClusCfgWbemServices
  46. // IClusCfgInitialize
  47. // CClusterUtils
  48. //
  49. //--
  50. //////////////////////////////////////////////////////////////////////////////
  51. class CEnumPhysicalDisks
  52. : public IEnumClusCfgManagedResources
  53. , public IClusCfgWbemServices
  54. , public IClusCfgInitialize
  55. , public CClusterUtils
  56. {
  57. private:
  58. //
  59. // Private member functions and data
  60. //
  61. LONG m_cRef;
  62. LCID m_lcid;
  63. IClusCfgCallback * m_picccCallback;
  64. IWbemServices * m_pIWbemServices;
  65. BOOL m_fLoadedDevices:1;
  66. IUnknown * ((*m_prgDisks)[]);
  67. ULONG m_idxNext;
  68. ULONG m_idxEnumNext;
  69. BSTR m_bstrNodeName;
  70. BSTR m_bstrBootDevice;
  71. BSTR m_bstrSystemDevice;
  72. BSTR m_bstrBootLogicalDisk;
  73. BSTR m_bstrSystemLogicalDisk;
  74. BSTR m_bstrSystemWMIDeviceID;
  75. DWORD m_cDiskCount;
  76. // Private constructors and destructors
  77. CEnumPhysicalDisks( void );
  78. ~CEnumPhysicalDisks( void );
  79. // Private copy constructor to prevent copying.
  80. CEnumPhysicalDisks( const CEnumPhysicalDisks & nodeSrc );
  81. // Private assignment operator to prevent copying.
  82. const CEnumPhysicalDisks & operator = ( const CEnumPhysicalDisks & nodeSrc );
  83. HRESULT HrInit( void );
  84. HRESULT HrGetDisks( void );
  85. HRESULT HrCreateAndAddDiskToArray( IWbemClassObject * pDiskIn );
  86. HRESULT HrAddDiskToArray( IUnknown * punkIn );
  87. HRESULT HrPruneSystemDisks( void );
  88. HRESULT IsDiskSCSI( IWbemClassObject * pDiskIn );
  89. HRESULT HrFixupDisks( void );
  90. HRESULT HrGetClusterDiskInfo( HCLUSTER hClusterIn, HRESOURCE hResourceIn, CLUS_SCSI_ADDRESS * pcsaOut, DWORD * pdwSignatureOut );
  91. HRESULT HrSetThisDiskToBeManaged( ULONG ulSCSITidIn, ULONG ulSCSILunIn, BOOL fIsQuorumIn, BSTR bstrResourceNameIn, DWORD dwSignatureIn );
  92. HRESULT HrFindDiskWithLogicalDisk( WCHAR cLogicalDiskIn, ULONG * pidxDiskOut );
  93. HRESULT HrGetSCSIInfo( ULONG idxDiskIn, ULONG * pulSCSIBusOut, ULONG * pulSCSIPortOut );
  94. HRESULT HrPruneDisks( ULONG ulSCSIBusIn, ULONG ulSCSIPortIn, ULONG * pulRemovedOut, int nMsgId );
  95. void LogPrunedDisk( IUnknown * punkIn, ULONG ulSCSIBusIn, ULONG ulSCSIPortIn );
  96. HRESULT HrIsLogicalDiskNTFS( BSTR bstrLogicalDiskIn );
  97. HRESULT HrLogDiskInfo( IWbemClassObject * pDiskIn );
  98. HRESULT HrFindDiskWithWMIDeviceID( BSTR bstrWMIDeviceIDIn, ULONG * pidxDiskOut );
  99. HRESULT HrIsSystemBusManaged( void );
  100. HRESULT HrGetClusterProperties( HRESOURCE hResourceIn, BSTR * pbstrResourceNameOut );
  101. void RemoveDiskFromArray( ULONG idxDiskIn );
  102. HRESULT HrLoadEnum( void );
  103. public:
  104. //
  105. // Public, non interface methods.
  106. //
  107. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  108. static HRESULT S_RegisterCatIDSupport( ICatRegister * picrIn, BOOL fCreateIn );
  109. //
  110. // IUnknown Interfaces
  111. //
  112. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  113. STDMETHOD_( ULONG, AddRef )( void );
  114. STDMETHOD_( ULONG, Release )( void );
  115. //
  116. // IClusCfgWbemServices Interfaces
  117. //
  118. STDMETHOD( SetWbemServices )( IWbemServices * pIWbemServicesIn );
  119. //
  120. // IClusCfgInitialize Interfaces
  121. //
  122. // Register callbacks, locale id, etc.
  123. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  124. //
  125. // IEnumClusCfgManagedResources Interfaces
  126. //
  127. STDMETHOD( Next )( ULONG cNumberRequestedIn, IClusCfgManagedResourceInfo ** rgpManagedResourceInfoOut, ULONG * pcNumberFetchedOut );
  128. STDMETHOD( Skip )( ULONG cNumberToSkipIn );
  129. STDMETHOD( Reset )( void );
  130. STDMETHOD( Clone )( IEnumClusCfgManagedResources ** ppEnumClusCfgStorageDevicesOut );
  131. STDMETHOD( Count )( DWORD * pnCountOut );
  132. //
  133. // CClusterUtils
  134. //
  135. HRESULT HrNodeResourceCallback( HCLUSTER hClusterIn, HRESOURCE hResourceIn );
  136. }; //*** Class CEnumPhysicalDisks