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.

244 lines
6.4 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ClusKeys.h
  7. //
  8. // Description:
  9. // Definition of the registry and crypto key collection classes for
  10. // the MSCLUS automation classes.
  11. //
  12. // Implementation File:
  13. // ClusKeys.cpp
  14. //
  15. // Author:
  16. // Galen Barbee (galenb) 12-Feb-1999
  17. //
  18. // Revision History:
  19. //
  20. // Notes:
  21. //
  22. /////////////////////////////////////////////////////////////////////////////
  23. #ifndef _CLUSKEYS_H_
  24. #define _CLUSKEYS_H_
  25. /////////////////////////////////////////////////////////////////////////////
  26. // Forward Class Declarations
  27. /////////////////////////////////////////////////////////////////////////////
  28. class CKeys;
  29. class CResourceKeys;
  30. class CResTypeKeys;
  31. class CClusResourceRegistryKeys;
  32. class CClusResourceCryptoKeys;
  33. class CClusResTypeRegistryKeys;
  34. class CClusResTypeCryptoKeys;
  35. /////////////////////////////////////////////////////////////////////////////
  36. //++
  37. //
  38. // class CKeys
  39. //
  40. // Description:
  41. // Cluster Keys Collection Implementation Class.
  42. //
  43. // Inheritance:
  44. //
  45. //--
  46. /////////////////////////////////////////////////////////////////////////////
  47. class CKeys
  48. {
  49. public:
  50. CKeys( void );
  51. ~CKeys( void );
  52. protected:
  53. typedef std::vector< CComBSTR * > KeyList;
  54. ISClusRefObject * m_pClusRefObject;
  55. KeyList m_klKeys;
  56. HRESULT HrCreate( ISClusRefObject * pClusRefObject );
  57. void Clear( void );
  58. HRESULT FindItem( IN LPWSTR lpszNodeName, OUT ULONG * pnIndex );
  59. HRESULT HrGetIndex( IN VARIANT varIndex, OUT ULONG * pnIndex );
  60. HRESULT HrGetItem( IN VARIANT varIndex, OUT BSTR * ppKey );
  61. HRESULT HrRemoveAt( IN size_t pos );
  62. HRESULT HrFindItem( IN BSTR bstrKey, OUT ULONG * pnIndex );
  63. HRESULT HrGetCount( OUT long * plCount );
  64. virtual HRESULT HrRemoveItem( IN VARIANT varIndex );
  65. virtual HRESULT HrAddItem( IN BSTR bstrKey );
  66. }; //*** Class CKeys
  67. /////////////////////////////////////////////////////////////////////////////
  68. //++
  69. //
  70. // class CResourceKeys
  71. //
  72. // Description:
  73. // Cluster Resource Keys Collection Implementation Class.
  74. //
  75. // Inheritance:
  76. // CKeys
  77. //
  78. //--
  79. /////////////////////////////////////////////////////////////////////////////
  80. class CResourceKeys: public CKeys
  81. {
  82. protected:
  83. HRESOURCE m_hResource;
  84. HRESULT HrRefresh( DWORD dwControlCode );
  85. virtual HRESULT HrRemoveItem( IN VARIANT varIndex, IN DWORD dwControlCode );
  86. virtual HRESULT HrAddItem( IN BSTR bstrKey, IN DWORD dwControlCode );
  87. }; //*** Class CResourceKeys
  88. /////////////////////////////////////////////////////////////////////////////
  89. //++
  90. //
  91. // class CResTypeKeys
  92. //
  93. // Description:
  94. // Cluster Resource Keys Collection Implementation Class.
  95. //
  96. // Inheritance:
  97. // CKeys
  98. //
  99. //--
  100. /////////////////////////////////////////////////////////////////////////////
  101. class CResTypeKeys: public CKeys
  102. {
  103. protected:
  104. CComBSTR m_bstrResourceTypeName;
  105. HRESULT HrRefresh( DWORD dwControlCode );
  106. }; //*** Class CResTypeKeys
  107. /////////////////////////////////////////////////////////////////////////////
  108. //++
  109. //
  110. // class CClusResourceRegistryKeys
  111. //
  112. // Description:
  113. // Cluster Registry Keys Collection Automation Class.
  114. //
  115. // Inheritance:
  116. // CResourceKeys
  117. // IDispatchImpl< ISClusRegistryKeys, &IID_ISClusRegistryKeys, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  118. // CSupportErrorInfo
  119. // CComObjectRootEx< CComSingleThreadModel >
  120. // CComCoClass< ClusRegistryKeys, &CLSID_ClusRegistryKeys >
  121. //
  122. //--
  123. /////////////////////////////////////////////////////////////////////////////
  124. class ATL_NO_VTABLE CClusResourceRegistryKeys :
  125. public CResourceKeys,
  126. public IDispatchImpl< ISClusRegistryKeys, &IID_ISClusRegistryKeys, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  127. public CSupportErrorInfo,
  128. public CComObjectRootEx< CComSingleThreadModel >,
  129. public CComCoClass< ClusRegistryKeys, &CLSID_ClusRegistryKeys >
  130. {
  131. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  132. public:
  133. CClusResourceRegistryKeys( void );
  134. BEGIN_COM_MAP(CClusResourceRegistryKeys)
  135. COM_INTERFACE_ENTRY(IDispatch)
  136. COM_INTERFACE_ENTRY(ISClusRegistryKeys)
  137. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  138. END_COM_MAP()
  139. DECLARE_NOT_AGGREGATABLE(CClusResourceRegistryKeys)
  140. DECLARE_NO_REGISTRY()
  141. HRESULT Create( HRESOURCE hResource );
  142. STDMETHODIMP get_Count( OUT long * plCount );
  143. STDMETHODIMP get_Item( IN VARIANT varIndex, OUT BSTR * ppbstrRegistryKey );
  144. STDMETHODIMP get__NewEnum( OUT IUnknown ** ppunk );
  145. STDMETHODIMP AddItem( IN BSTR bstrRegistryKey );
  146. STDMETHODIMP RemoveItem( IN VARIANT varIndex );
  147. STDMETHODIMP Refresh( void );
  148. }; //*** Class CClusResourceRegistryKeys
  149. #if CLUSAPI_VERSION >= 0x0500
  150. /////////////////////////////////////////////////////////////////////////////
  151. //++
  152. //
  153. // class CClusResourceCryptoKeys
  154. //
  155. // Description:
  156. // Cluster Crypto Keys Collection Automation Class.
  157. //
  158. // Inheritance:
  159. // CResourceKeys
  160. // IDispatchImpl< ISClusCryptoKeys, &IID_ISClusCryptoKeys, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  161. // CSupportErrorInfo
  162. // CComObjectRootEx< CComSingleThreadModel >
  163. // CComCoClass< ClusCryptoKeys, &CLSID_ClusCryptoKeys >
  164. //
  165. //--
  166. /////////////////////////////////////////////////////////////////////////////
  167. class ATL_NO_VTABLE CClusResourceCryptoKeys :
  168. public CResourceKeys,
  169. public IDispatchImpl< ISClusCryptoKeys, &IID_ISClusCryptoKeys, &LIBID_MSClusterLib, MAJORINTERFACEVER, MINORINTERFACEVER >,
  170. public CSupportErrorInfo,
  171. public CComObjectRootEx< CComSingleThreadModel >,
  172. public CComCoClass< ClusCryptoKeys, &CLSID_ClusCryptoKeys >
  173. {
  174. typedef CComObjectRootEx< CComSingleThreadModel > BaseComClass;
  175. public:
  176. CClusResourceCryptoKeys( void );
  177. BEGIN_COM_MAP(CClusResourceCryptoKeys)
  178. COM_INTERFACE_ENTRY(IDispatch)
  179. COM_INTERFACE_ENTRY(ISClusCryptoKeys)
  180. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  181. END_COM_MAP()
  182. DECLARE_NOT_AGGREGATABLE(CClusResourceCryptoKeys)
  183. DECLARE_NO_REGISTRY()
  184. HRESULT Create( HRESOURCE hResource );
  185. STDMETHODIMP get_Count( OUT long * plCount );
  186. STDMETHODIMP get_Item( IN VARIANT varIndex, OUT BSTR * ppbstrCryptoKey );
  187. STDMETHODIMP get__NewEnum( OUT IUnknown ** ppunk );
  188. STDMETHODIMP AddItem( IN BSTR bstrCryptoKey );
  189. STDMETHODIMP RemoveItem( IN VARIANT varIndex );
  190. STDMETHODIMP Refresh( void );
  191. }; //*** Class CClusResourceCryptoKeys
  192. #endif // CLUSAPI_VERSION >= 0x0500
  193. #endif // _CLUSKEYS_H_