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.

167 lines
4.7 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. BSTR m_bstrDiskDeviceID;
  71. // Private constructors and destructors
  72. CClusCfgPartitionInfo( void );
  73. ~CClusCfgPartitionInfo( void );
  74. // Private copy constructor to prevent copying.
  75. CClusCfgPartitionInfo( const CClusCfgPartitionInfo & nodeSrc );
  76. // Private assignment operator to prevent copying.
  77. const CClusCfgPartitionInfo & operator = ( const CClusCfgPartitionInfo & nodeSrc );
  78. HRESULT HrInit( BSTR bstrDeviceIDIn = NULL );
  79. HRESULT HrAddLogicalDiskToArray( IWbemClassObject * pDiskIn );
  80. HRESULT HrGetLogicalDisks( IWbemClassObject * pPartitionIn );
  81. HRESULT HrLogLogicalDiskInfo( IWbemClassObject * pLogicalDiskIn, BSTR bstrDeviceIDIn );
  82. public:
  83. //
  84. // Public, non interface methods.
  85. //
  86. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  87. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut, BSTR bstrDeviceIDIn );
  88. //
  89. // IUnknown Interface
  90. //
  91. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  92. STDMETHOD_( ULONG, AddRef )( void );
  93. STDMETHOD_( ULONG, Release )( void );
  94. //
  95. // IClusCfgWbemServices Interface
  96. //
  97. STDMETHOD( SetWbemServices )( IWbemServices * pIWbemServicesIn );
  98. //
  99. // IClusCfgSetWbemObject Interfaces
  100. //
  101. STDMETHOD( SetWbemObject )( IWbemClassObject * pPartitionIn, bool * pfRetainObjectOut );
  102. //
  103. // IClusCfgInitialize Interfaces
  104. //
  105. // Register callbacks, locale id, etc.
  106. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  107. //
  108. // IClusCfgManagedResourceInfo Interface
  109. //
  110. STDMETHOD( GetUID )( BSTR * pbstrUIDOut );
  111. STDMETHOD( GetName )( BSTR * pbstrNameOut );
  112. STDMETHOD( SetName )( LPCWSTR bstrNameIn );
  113. STDMETHOD( GetDescription )( BSTR * pbstrDescriptionOut );
  114. STDMETHOD( SetDescription )( LPCWSTR bstrDescriptionIn );
  115. STDMETHOD( GetDriveLetterMappings )( SDriveLetterMapping * pdlmDriveLetterUsageOut );
  116. STDMETHOD( SetDriveLetterMappings )( SDriveLetterMapping dlmDriveLetterMappingIn );
  117. STDMETHOD( GetSize )( ULONG * pcMegaBytes );
  118. //
  119. // IClusCfgPartitionProperties Interface
  120. //
  121. STDMETHOD( IsThisLogicalDisk )( WCHAR cLogicalDisk );
  122. STDMETHOD( IsNTFS )( void );
  123. STDMETHOD( GetFriendlyName )( BSTR * pbstrNameOut );
  124. }; //*** Class CClusCfgPartitionInfo