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.

163 lines
4.3 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CClusCfgPartitionInfo.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CClusCfgPartitionInfo
  10. // class.
  11. //
  12. // The class CClusCfgPartitionInfo represents a disk partition.
  13. // It implements the IClusCfgPartitionInfo interface.
  14. //
  15. // Documentation:
  16. //
  17. // Implementation Files:
  18. // CClusCfgPartitionInfo.cpp
  19. //
  20. // Maintained By:
  21. // Galen Barbee (GalenB) 05-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 CClusCfgPartitionInfo
  37. //
  38. // Description:
  39. // The class CClusCfgPartitionInfo represents a disk partition.
  40. //
  41. // Interfaces:
  42. // IClusCfgPartitionInfo
  43. // IClusCfgWbemServices
  44. // IClusCfgSetWbemObject
  45. // IClusCfgInitialize
  46. // IClusCfgPartitionProperties
  47. //--
  48. //////////////////////////////////////////////////////////////////////////////
  49. class CClusCfgPartitionInfo
  50. : public IClusCfgPartitionInfo
  51. , public IClusCfgWbemServices
  52. , public IClusCfgSetWbemObject
  53. , public IClusCfgInitialize
  54. , public IClusCfgPartitionProperties
  55. {
  56. private:
  57. //
  58. // Private member functions and data
  59. //
  60. LONG m_cRef;
  61. LCID m_lcid;
  62. IClusCfgCallback * m_picccCallback;
  63. IWbemServices * m_pIWbemServices;
  64. BSTR m_bstrName;
  65. BSTR m_bstrUID;
  66. BSTR m_bstrDescription;
  67. IUnknown * ((*m_prgLogicalDisks)[]);
  68. ULONG m_idxNextLogicalDisk;
  69. ULONG m_ulPartitionSize;
  70. // Private constructors and destructors
  71. CClusCfgPartitionInfo( void );
  72. ~CClusCfgPartitionInfo( void );
  73. // Private copy constructor to prevent copying.
  74. CClusCfgPartitionInfo( const CClusCfgPartitionInfo & nodeSrc );
  75. // Private assignment operator to prevent copying.
  76. const CClusCfgPartitionInfo & operator = ( const CClusCfgPartitionInfo & nodeSrc );
  77. HRESULT HrInit( void );
  78. HRESULT HrAddLogicalDiskToArray( IWbemClassObject * pDiskIn );
  79. HRESULT HrGetLogicalDisks( IWbemClassObject * pPartitionIn );
  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. // IClusCfgWbemServices Interface
  93. //
  94. STDMETHOD( SetWbemServices )( IWbemServices * pIWbemServicesIn );
  95. //
  96. // IClusCfgSetWbemObject Interfaces
  97. //
  98. STDMETHOD( SetWbemObject )( IWbemClassObject * pPartitionIn, bool * pfRetainObjectOut );
  99. //
  100. // IClusCfgInitialize Interfaces
  101. //
  102. // Register callbacks, locale id, etc.
  103. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  104. //
  105. // IClusCfgManagedResourceInfo Interface
  106. //
  107. STDMETHOD( GetUID )( BSTR * pbstrUIDOut );
  108. STDMETHOD( GetName )( BSTR * pbstrNameOut );
  109. STDMETHOD( SetName )( LPCWSTR bstrNameIn );
  110. STDMETHOD( GetDescription )( BSTR * pbstrDescriptionOut );
  111. STDMETHOD( SetDescription )( LPCWSTR bstrDescriptionIn );
  112. STDMETHOD( GetDriveLetterMappings )( SDriveLetterMapping * pdlmDriveLetterUsageOut );
  113. STDMETHOD( SetDriveLetterMappings )( SDriveLetterMapping dlmDriveLetterMappingIn );
  114. STDMETHOD( GetSize )( ULONG * pcMegaBytes );
  115. //
  116. // IClusCfgPartitionProperties Interface
  117. //
  118. STDMETHOD( IsThisLogicalDisk )( WCHAR cLogicalDisk );
  119. STDMETHOD( IsNTFS )( void );
  120. STDMETHOD( GetFriendlyName )( BSTR * pbstrNameOut );
  121. }; //*** Class CClusCfgPartitionInfo