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.

203 lines
6.1 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ClusResT.h
  7. //
  8. // Description:
  9. // Definition of the resource type classes for the MSCLUS automation
  10. // classes.
  11. //
  12. // Implementation File:
  13. // ClusNetI.cpp
  14. //
  15. // Author:
  16. // Charles Stacy Harris (stacyh) 28-Feb-1997
  17. // Galen Barbee (galenb) July 1998
  18. //
  19. // Revision History:
  20. // July 1998 GalenB Maaaaaajjjjjjjjjoooooorrrr clean up
  21. //
  22. // Notes:
  23. //
  24. /////////////////////////////////////////////////////////////////////////////
  25. #ifndef _CLUSREST_H_
  26. #define _CLUSREST_H_
  27. /////////////////////////////////////////////////////////////////////////////
  28. // Forward Class Declarations
  29. /////////////////////////////////////////////////////////////////////////////
  30. class CClusResType;
  31. class CClusResTypes;
  32. /////////////////////////////////////////////////////////////////////////////
  33. //++
  34. //
  35. // class CClusResType
  36. //
  37. // Description:
  38. // Cluster Resource Type Automation Class.
  39. //
  40. // Inheritance:
  41. // IDispatchImpl< ISClusResType, &IID_ISClusResType, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  42. // CSupportErrorInfo
  43. // CComObjectRootEx< CComSingleThreadModel >
  44. // CComCoClass< CClusResType, &CLSID_ClusResType >
  45. // CClusterObject
  46. //
  47. //--
  48. /////////////////////////////////////////////////////////////////////////////
  49. class ATL_NO_VTABLE CClusResType :
  50. public IDispatchImpl< ISClusResType, &IID_ISClusResType, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  51. public CSupportErrorInfo,
  52. public CComObjectRootEx< CComSingleThreadModel >,
  53. public CComCoClass< CClusResType, &CLSID_ClusResType >,
  54. public CClusterObject
  55. {
  56. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  57. public:
  58. CClusResType( void );
  59. ~CClusResType( void );
  60. BEGIN_COM_MAP(CClusResType)
  61. COM_INTERFACE_ENTRY(IDispatch)
  62. COM_INTERFACE_ENTRY(ISClusResType)
  63. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  64. END_COM_MAP()
  65. DECLARE_NOT_AGGREGATABLE(CClusResType)
  66. DECLARE_NO_REGISTRY()
  67. private:
  68. ISClusRefObject * m_pClusRefObject;
  69. CComObject< CClusProperties > * m_pCommonProperties;
  70. CComObject< CClusProperties > * m_pPrivateProperties;
  71. CComObject< CClusProperties > * m_pCommonROProperties;
  72. CComObject< CClusProperties > * m_pPrivateROProperties;
  73. CComObject<CClusResTypeResources> * m_pClusterResTypeResources;
  74. CComBSTR m_bstrResourceTypeName;
  75. HRESULT GetProperties( OUT ISClusProperties ** ppProperties, IN BOOL bPrivate, IN BOOL bReadOnly );
  76. protected:
  77. virtual DWORD ScWriteProperties( IN const CClusPropList & rcplPropList, IN BOOL bPrivate );
  78. public:
  79. HRESULT Create(
  80. ISClusRefObject * pClusRefObject,
  81. BSTR bstrResourceTypeName,
  82. BSTR bstrDisplayName,
  83. BSTR bstrResourceTypeDll,
  84. long dwLooksAlivePollInterval,
  85. long dwIsAlivePollInterval
  86. );
  87. HRESULT Open( IN ISClusRefObject * pClusRefObject, IN BSTR bstrResourceTypeName );
  88. STDMETHODIMP get_Name( OUT BSTR * pbstrTypeName );
  89. STDMETHODIMP Delete( void );
  90. STDMETHODIMP get_CommonProperties( OUT ISClusProperties ** ppProperties );
  91. STDMETHODIMP get_PrivateProperties( OUT ISClusProperties ** ppProperties );
  92. STDMETHODIMP get_CommonROProperties( OUT ISClusProperties ** ppProperties );
  93. STDMETHODIMP get_PrivateROProperties( OUT ISClusProperties ** ppProperties );
  94. STDMETHODIMP get_Resources( OUT ISClusResTypeResources ** ppClusterResTypeResources );
  95. STDMETHODIMP get_Cluster( OUT ISCluster ** ppCluster );
  96. STDMETHODIMP get_PossibleOwnerNodes( OUT ISClusResTypePossibleOwnerNodes ** ppOwnerNodes );
  97. STDMETHODIMP get_AvailableDisks( OUT ISClusDisks ** ppAvailableDisks );
  98. virtual HRESULT HrLoadProperties( IN OUT CClusPropList & rcplPropList, IN BOOL bReadOnly, IN BOOL bPrivate );
  99. const CComBSTR Name( void ) const { return m_bstrResourceTypeName ; };
  100. }; //*** Class CClusResType
  101. /////////////////////////////////////////////////////////////////////////////
  102. //++
  103. //
  104. // class CClusResTypes
  105. //
  106. // Description:
  107. // Cluster Resource Types Collection Automation Class.
  108. //
  109. // Inheritance:
  110. // IDispatchImpl< ISClusResTypes, &IID_ISClusResTypes, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  111. // CSupportErrorInfo
  112. // CComObjectRootEx< CComSingleThreadModel >
  113. // CComCoClass< CClusResTypes, &CLSID_ClusResTypes >
  114. //
  115. //--
  116. /////////////////////////////////////////////////////////////////////////////
  117. class ATL_NO_VTABLE CClusResTypes :
  118. public IDispatchImpl< ISClusResTypes, &IID_ISClusResTypes, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  119. public CSupportErrorInfo,
  120. public CComObjectRootEx< CComSingleThreadModel >,
  121. public CComCoClass< CClusResTypes, &CLSID_ClusResTypes >
  122. {
  123. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  124. public:
  125. CClusResTypes( void );
  126. ~CClusResTypes( void );
  127. BEGIN_COM_MAP(CClusResTypes)
  128. COM_INTERFACE_ENTRY(IDispatch)
  129. COM_INTERFACE_ENTRY(ISClusResTypes)
  130. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  131. END_COM_MAP()
  132. DECLARE_NOT_AGGREGATABLE(CClusResTypes)
  133. DECLARE_NO_REGISTRY()
  134. HRESULT Create( IN ISClusRefObject* pClusRefObject );
  135. protected:
  136. typedef std::vector< CComObject< CClusResType > * > ResourceTypeList;
  137. ResourceTypeList m_ResourceTypes;
  138. ISClusRefObject * m_pClusRefObject;
  139. void Clear( void );
  140. HRESULT FindItem( IN LPWSTR pszResourceTypeName, OUT UINT * pnIndex );
  141. HRESULT FindItem( IN ISClusResType * pResourceType, OUT UINT * pnIndex );
  142. HRESULT GetIndex( IN VARIANT varIndex, OUT UINT * pnIndex );
  143. HRESULT RemoveAt( OUT size_t pos );
  144. public:
  145. STDMETHODIMP get_Count( OUT long * plCount );
  146. STDMETHODIMP get_Item( IN VARIANT varIndex, OUT ISClusResType ** ppResourceType );
  147. STDMETHODIMP get__NewEnum( OUT IUnknown ** ppunk );
  148. STDMETHODIMP CreateItem(
  149. IN BSTR bstrResourceTypeName,
  150. IN BSTR bstrDisplayName,
  151. IN BSTR bstrResourceTypeDll,
  152. IN long dwLooksAlivePollInterval,
  153. IN long dwIsAlivePollInterval,
  154. OUT ISClusResType ** ppResourceType
  155. );
  156. STDMETHODIMP DeleteItem( IN VARIANT varIndex );
  157. STDMETHODIMP Refresh( void );
  158. }; //*** Class CClusResTypes
  159. #endif // _CLUSREST_H_