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.

155 lines
4.3 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // Partition.h
  7. //
  8. // Description:
  9. // Definition of the cluster disk partition class for the MSCLUS automation
  10. // classes.
  11. //
  12. // Implementation File:
  13. // Partition.cpp
  14. //
  15. // Author:
  16. // Galen Barbee (galenb) 10-Feb-1999
  17. //
  18. // Revision History:
  19. //
  20. // Notes:
  21. //
  22. /////////////////////////////////////////////////////////////////////////////
  23. #ifndef __PARTITION_H_
  24. #define __PARTITION_H__
  25. #if CLUSAPI_VERSION >= 0x0500
  26. #include <PropList.h>
  27. #else
  28. #include "PropList.h"
  29. #endif // CLUSAPI_VERSION >= 0x0500
  30. /////////////////////////////////////////////////////////////////////////////
  31. // Forward Class Declarations
  32. /////////////////////////////////////////////////////////////////////////////
  33. class CClusPartition;
  34. class CClusPartitions;
  35. /////////////////////////////////////////////////////////////////////////////
  36. //++
  37. //
  38. // class CClusPartition
  39. //
  40. // Description:
  41. // Cluster Partition Automation Class.
  42. //
  43. // Inheritance:
  44. // IDispatchImpl< ISClusPartition, &IID_ISClusPartition, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  45. // CSupportErrorInfo
  46. // CComObjectRootEx< CComSingleThreadModel >
  47. // CComCoClass< CClusPartition, &CLSID_ClusPartition >
  48. //
  49. //--
  50. /////////////////////////////////////////////////////////////////////////////
  51. class ATL_NO_VTABLE CClusPartition :
  52. public IDispatchImpl< ISClusPartition, &IID_ISClusPartition, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  53. public CSupportErrorInfo,
  54. public CComObjectRootEx< CComSingleThreadModel >,
  55. public CComCoClass< CClusPartition, &CLSID_ClusPartition >
  56. {
  57. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  58. public:
  59. CClusPartition( void );
  60. BEGIN_COM_MAP(CClusPartition)
  61. COM_INTERFACE_ENTRY(IDispatch)
  62. COM_INTERFACE_ENTRY(ISClusPartition)
  63. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  64. END_COM_MAP()
  65. DECLARE_NOT_AGGREGATABLE(CClusPartition)
  66. DECLARE_NO_REGISTRY()
  67. private:
  68. CLUS_PARTITION_INFO m_cpi;
  69. public:
  70. HRESULT Create( IN CLUS_PARTITION_INFO * pcpi );
  71. STDMETHODIMP get_Flags( OUT long * plFlags );
  72. STDMETHODIMP get_DeviceName( OUT BSTR * pbstrDeviceName );
  73. STDMETHODIMP get_VolumeLabel( OUT BSTR * pbstrVolumeLabel );
  74. STDMETHODIMP get_SerialNumber( OUT long * plSerialNumber );
  75. STDMETHODIMP get_MaximumComponentLength( OUT long * plMaximumComponentLength );
  76. STDMETHODIMP get_FileSystemFlags( OUT long * plFileSystemFlags );
  77. STDMETHODIMP get_FileSystem( OUT BSTR * pbstrFileSystem );
  78. }; //*** Class CClusPartition
  79. /////////////////////////////////////////////////////////////////////////////
  80. //++
  81. //
  82. // class CClusPartitions
  83. //
  84. // Description:
  85. // Cluster Partition Collection Automation Class.
  86. //
  87. // Inheritance:
  88. // IDispatchImpl< ISClusPartitions, &IID_ISClusPartitions, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  89. // CSupportErrorInfo
  90. // CComObjectRootEx< CComSingleThreadModel >
  91. // CComCoClass< CClusPartitions, &CLSID_ClusPartitions >
  92. //
  93. //--
  94. /////////////////////////////////////////////////////////////////////////////
  95. class ATL_NO_VTABLE CClusPartitions :
  96. public IDispatchImpl< ISClusPartitions, &IID_ISClusPartitions, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  97. public CSupportErrorInfo,
  98. public CComObjectRootEx< CComSingleThreadModel >,
  99. public CComCoClass< CClusPartitions, &CLSID_ClusPartitions >
  100. {
  101. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  102. public:
  103. CClusPartitions( void );
  104. ~CClusPartitions( void );
  105. BEGIN_COM_MAP(CClusPartitions)
  106. COM_INTERFACE_ENTRY(IDispatch)
  107. COM_INTERFACE_ENTRY(ISClusPartitions)
  108. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  109. END_COM_MAP()
  110. DECLARE_NOT_AGGREGATABLE(CClusPartitions)
  111. DECLARE_NO_REGISTRY()
  112. HRESULT HrCreateItem( IN CLUS_PARTITION_INFO * pcpi );
  113. protected:
  114. typedef std::vector< CComObject< CClusPartition > * > PartitionVector;
  115. PartitionVector m_pvPartitions;
  116. void Clear( void );
  117. HRESULT GetIndex( VARIANT varIndex, UINT *pnIndex );
  118. public:
  119. STDMETHODIMP get_Count( OUT long * plCount );
  120. STDMETHODIMP get_Item( IN VARIANT varIndex, OUT ISClusPartition ** ppPartition );
  121. STDMETHODIMP get__NewEnum( OUT IUnknown ** ppunk );
  122. }; //*** Class CClusPartitions
  123. #endif // __PARTITION_H__