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.

213 lines
5.9 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ClusDisk.h
  7. //
  8. // Description:
  9. // Definition of the cluster disk class for the MSCLUS automation
  10. // classes.
  11. //
  12. // Implementation File:
  13. // ClusDisk.cpp
  14. //
  15. // Author:
  16. // Galen Barbee (galenb) 11-Feb-1999
  17. //
  18. // Revision History:
  19. //
  20. // Notes:
  21. //
  22. /////////////////////////////////////////////////////////////////////////////
  23. #ifndef __CLUSDISK_H_
  24. #define __CLUSDISK_H__
  25. #ifndef __PARTITION_H__
  26. #include "Partition.h"
  27. #endif // __PARTITION_H__
  28. /////////////////////////////////////////////////////////////////////////////
  29. // Forward Class Declarations
  30. /////////////////////////////////////////////////////////////////////////////
  31. class CClusDisk;
  32. class CClusDisks;
  33. class CClusScsiAddress;
  34. /////////////////////////////////////////////////////////////////////////////
  35. //++
  36. //
  37. // class CClusDisk
  38. //
  39. // Description:
  40. // Cluster Disk Automation Class.
  41. //
  42. // Inheritance:
  43. // IDispatchImpl< ISClusDisk, &IID_ISClusDisk, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  44. // CSupportErrorInfo
  45. // CComObjectRootEx< CComSingleThreadModel >
  46. // CComCoClass< CClusDisk, &CLSID_ClusDisk >
  47. //
  48. //--
  49. /////////////////////////////////////////////////////////////////////////////
  50. class ATL_NO_VTABLE CClusDisk :
  51. public IDispatchImpl< ISClusDisk, &IID_ISClusDisk, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  52. public CSupportErrorInfo,
  53. public CComObjectRootEx< CComSingleThreadModel >,
  54. public CComCoClass< CClusDisk, &CLSID_ClusDisk >
  55. {
  56. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  57. public:
  58. CClusDisk( void );
  59. ~CClusDisk( void );
  60. BEGIN_COM_MAP(CClusDisk)
  61. COM_INTERFACE_ENTRY(IDispatch)
  62. COM_INTERFACE_ENTRY(ISClusDisk)
  63. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  64. END_COM_MAP()
  65. DECLARE_NOT_AGGREGATABLE(CClusDisk)
  66. DECLARE_NO_REGISTRY()
  67. private:
  68. CComObject< CClusPartitions > * m_pPartitions;
  69. DWORD m_dwSignature;
  70. DWORD m_dwDiskNumber;
  71. CLUS_SCSI_ADDRESS m_csaScsiAddress;
  72. public:
  73. HRESULT Create( IN HRESOURCE hResource );
  74. HRESULT HrCreate( IN OUT CClusPropValueList & rcpvl, OUT BOOL * pbEndFound );
  75. STDMETHODIMP get_Signature( OUT long * plSignature );
  76. STDMETHODIMP get_ScsiAddress( OUT ISClusScsiAddress ** ppScsiAddress );
  77. STDMETHODIMP get_DiskNumber( OUT long * plDiskNumber );
  78. STDMETHODIMP get_Partitions( OUT ISClusPartitions ** ppPartitions );
  79. }; //*** Class CClusDisk
  80. /////////////////////////////////////////////////////////////////////////////
  81. //++
  82. //
  83. // class CClusDisks
  84. //
  85. // Description:
  86. // Cluster Disk Collection Automation Class.
  87. //
  88. // Inheritance:
  89. // IDispatchImpl< ISClusDisks, &IID_ISClusDisks, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  90. // CSupportErrorInfo
  91. // CComObjectRootEx< CComSingleThreadModel >
  92. // CComCoClass< CClusDisks, &CLSID_ClusDisks >
  93. //
  94. //--
  95. /////////////////////////////////////////////////////////////////////////////
  96. class ATL_NO_VTABLE CClusDisks :
  97. public IDispatchImpl< ISClusDisks, &IID_ISClusDisks, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  98. public CSupportErrorInfo,
  99. public CComObjectRootEx< CComSingleThreadModel >,
  100. public CComCoClass< CClusDisks, &CLSID_ClusDisks >
  101. {
  102. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  103. public:
  104. CClusDisks( void );
  105. ~CClusDisks( void );
  106. BEGIN_COM_MAP(CClusDisks)
  107. COM_INTERFACE_ENTRY(IDispatch)
  108. COM_INTERFACE_ENTRY(ISClusDisks)
  109. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  110. END_COM_MAP()
  111. DECLARE_NOT_AGGREGATABLE(CClusDisks)
  112. DECLARE_NO_REGISTRY()
  113. HRESULT Create( IN const CClusPropValueList & rcpvl );
  114. HRESULT Create( ISClusRefObject * pClusRefObject, BSTR bstrResTypeName );
  115. private:
  116. typedef std::vector< CComObject< CClusDisk > * > DiskVector;
  117. DiskVector m_dvDisks;
  118. CComBSTR m_bstrResTypeName;
  119. ISClusRefObject * m_pClusRefObject;
  120. void Clear( void );
  121. HRESULT GetIndex( VARIANT varIndex, UINT *pnIndex );
  122. HRESULT HrCreateDisk( IN OUT CClusPropValueList & rcpvl, OUT BOOL * pbEndFound );
  123. public:
  124. STDMETHODIMP get_Count( OUT long * plCount );
  125. STDMETHODIMP get_Item( IN VARIANT varIndex, OUT ISClusDisk ** ppDisk );
  126. STDMETHODIMP get__NewEnum( OUT IUnknown ** ppunk );
  127. STDMETHODIMP Refresh( void );
  128. }; //*** Class CClusDisks
  129. /////////////////////////////////////////////////////////////////////////////
  130. //++
  131. //
  132. // class CClusScsiAddress
  133. //
  134. // Description:
  135. // Cluster SCSI Address Automation Class.
  136. //
  137. // Inheritance:
  138. // IDispatchImpl< ISClusScsiAddress, &IID_ISClusScsiAddress, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  139. // CSupportErrorInfo
  140. // CComObjectRootEx< CComSingleThreadModel >
  141. // CComCoClass< CClusScsiAddress, &CLSID_ClusScsiAddress >
  142. //
  143. //--
  144. /////////////////////////////////////////////////////////////////////////////
  145. class ATL_NO_VTABLE CClusScsiAddress :
  146. public IDispatchImpl< ISClusScsiAddress, &IID_ISClusScsiAddress, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  147. public CSupportErrorInfo,
  148. public CComObjectRootEx< CComSingleThreadModel >,
  149. public CComCoClass< CClusScsiAddress, &CLSID_ClusScsiAddress >
  150. {
  151. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  152. public:
  153. CClusScsiAddress( void );
  154. BEGIN_COM_MAP(CClusScsiAddress)
  155. COM_INTERFACE_ENTRY(IDispatch)
  156. COM_INTERFACE_ENTRY(ISClusScsiAddress)
  157. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  158. END_COM_MAP()
  159. DECLARE_NOT_AGGREGATABLE(CClusScsiAddress)
  160. DECLARE_NO_REGISTRY()
  161. private:
  162. CLUS_SCSI_ADDRESS m_csa;
  163. public:
  164. HRESULT Create( IN const CLUS_SCSI_ADDRESS & rcsa );
  165. STDMETHODIMP get_PortNumber( OUT VARIANT * pvarPortNumber );
  166. STDMETHODIMP get_PathId( OUT VARIANT * pvarPathId );
  167. STDMETHODIMP get_TargetId( OUT VARIANT * pvarTargetId );
  168. STDMETHODIMP get_Lun( OUT VARIANT * pvarLun );
  169. }; //*** Class CClusScsiAddress
  170. #endif // __CLUSDISK_H__