Source code of Windows XP (NT5)
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.7 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CBaseInfo.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CBaseInfo
  10. // class heirarchy.
  11. //
  12. // The class CBaseInfo is the base class of methods that abstract the
  13. // ClusAPI into objects with identical methods for open, close, & control.
  14. //
  15. // Documentation:
  16. //
  17. // Implementation Files:
  18. // CBaseInfo.cpp
  19. //
  20. // Maintained By:
  21. //
  22. //////////////////////////////////////////////////////////////////////////////
  23. #pragma once
  24. //
  25. // CtlCodeEnum
  26. //
  27. typedef enum _CtlCodeEnum
  28. {
  29. CONTROL_UNKNOWN = 0x00,
  30. CONTROL_ADD_CRYPTO_CHECKPOINT,
  31. CONTROL_ADD_REGISTRY_CHECKPOINT,
  32. CONTROL_GET_REGISTRY_CHECKPOINTS,
  33. CONTROL_GET_CRYPTO_CHECKPOINTS,
  34. CONTROL_DELETE_CRYPTO_CHECKPOINT,
  35. CONTROL_DELETE_REGISTRY_CHECKPOINT,
  36. CONTROL_VALIDATE_COMMON_PROPERTIES,
  37. CONTROL_VALIDATE_PRIVATE_PROPERTIES,
  38. CONTROL_ENUM_COMMON_PROPERTIES,
  39. CONTROL_ENUM_PRIVATE_PROPERTIES,
  40. CONTROL_GET_RO_COMMON_PROPERTIES,
  41. CONTROL_GET_RO_PRIVATE_PROPERTIES,
  42. CONTROL_GET_COMMON_PROPERTIES,
  43. CONTROL_GET_PRIVATE_PROPERTIES,
  44. CONTROL_SET_COMMON_PROPERTIES,
  45. CONTROL_SET_PRIVATE_PROPERTIES,
  46. CONTROL_GET_TYPE,
  47. CONTROL_GET_NAME,
  48. CONTROL_GET_ID,
  49. CONTROL_GET_FLAGS,
  50. CONTROL_GET_CLASS_INFO,
  51. CONTROL_GET_NETWORK_NAME,
  52. CONTROL_GET_CHARACTERISTICS,
  53. CONTROL_GET_REQUIRED_DEPENDENCIES,
  54. CONTROL_STORAGE_GET_DISK_INFO,
  55. CONTROL_STORAGE_IS_PATH_VALID,
  56. CONTROL_STORAGE_GET_AVAILABLE_DISKS,
  57. CONTROL_QUERY_DELETE,
  58. } CtlCodeEnum;
  59. //
  60. // Class CBaseInfo
  61. // This is the base class for the heirarchy.
  62. //
  63. class CBaseInfo
  64. {
  65. private:
  66. IClusterHandleProvider * m_pICHProvider;
  67. public:
  68. IClusterHandleProvider * getClusterHandleProvider() { return m_pICHProvider; };
  69. HCLUSTER getClusterHandle( void );
  70. HRESULT GetPropertyStringHelper( CBasePropList& cplIn, const WCHAR * pszPropertyIn, BSTR * pbstrResultOut );
  71. HRESULT GetPropertyDwordHelper( CBasePropList& cplIn, const WCHAR * pszPropertyIn, DWORD * pdwValueOut );
  72. HRESULT GetPropertyStringValue( CtlCodeEnum cceIn, const WCHAR * pszPropertyIn, BSTR * pbstrResultOut );
  73. HRESULT GetPropertyDwordValue( CtlCodeEnum cceIn, const WCHAR * pszPropertyIn, DWORD * pdwValueOut );
  74. HRESULT SetClusterHandleProvider( IClusterHandleProvider * pICHPIn );
  75. DWORD Control( CtlCodeEnum cceIn, VOID * pvBufferIn, DWORD dwLengthIn, VOID * pvBufferOut, DWORD dwBufferLength, DWORD * dwLengthOut, HNODE hHostNode = NULL )
  76. {
  77. DWORD sc;
  78. DWORD dw = ToCode( cceIn );
  79. if( dw == 0 )
  80. {
  81. sc = ERROR_INVALID_PARAMETER;
  82. }
  83. else
  84. {
  85. sc = Control( dw, pvBufferIn, dwLengthIn, pvBufferOut, dwBufferLength, dwLengthOut, hHostNode );
  86. }
  87. return sc;
  88. }
  89. public:
  90. CBaseInfo( void );
  91. virtual ~CBaseInfo( void );
  92. virtual DWORD ToCode( CtlCodeEnum )
  93. {
  94. return 0;
  95. }
  96. virtual HRESULT Close( void );
  97. virtual HRESULT Open( BSTR bstrName ) = 0;
  98. virtual DWORD Control( DWORD dwEnum, VOID * pvBufferIn, DWORD dwLengthIn, VOID * pvBufferOut, DWORD dwBufferLength, DWORD * dwLengthOut, HNODE hHostNode = NULL ) = 0;
  99. };
  100. //
  101. // CBaseClusterInfo
  102. //
  103. class CBaseClusterInfo
  104. : public CBaseInfo
  105. {
  106. public:
  107. virtual HRESULT Close( void );
  108. virtual HRESULT Open( BSTR bstrName );
  109. virtual DWORD Control( DWORD dwEnum, VOID * pvBufferIn, DWORD dwLengthIn, VOID * pvBufferOut, DWORD dwBufferLength, DWORD * dwLengthOut, HNODE hHostNode = NULL );
  110. virtual DWORD ToCode( CtlCodeEnum cceIn );
  111. };
  112. //
  113. // CBaseClusterGroupInfo
  114. //
  115. class CBaseClusterGroupInfo
  116. : public CBaseInfo
  117. {
  118. public:
  119. HGROUP m_hGroup;
  120. virtual HRESULT Close( void );
  121. virtual HRESULT Open( BSTR bstrGroupName );
  122. virtual DWORD Control( DWORD dwEnum, VOID * pvBufferIn, DWORD dwLengthIn, VOID * pvBufferOut, DWORD dwBufferLength, DWORD * dwLengthOut, HNODE hHostNode = NULL );
  123. virtual DWORD ToCode( CtlCodeEnum cceIn );
  124. };
  125. //
  126. // CBaseClusterResourceInfo
  127. //
  128. class CBaseClusterResourceInfo
  129. : public CBaseInfo
  130. {
  131. public:
  132. HRESOURCE m_hResource;
  133. virtual HRESULT Close( void );
  134. virtual HRESULT Open( BSTR bstrResourceName );
  135. virtual DWORD Control( DWORD dwEnum, VOID * pvBufferIn, DWORD dwLengthIn, VOID * pvBufferOut, DWORD dwBufferLength, DWORD * dwLengthOut, HNODE hHostNode = NULL );
  136. virtual DWORD ToCode( CtlCodeEnum cceIn );
  137. };
  138. //
  139. // CBaseClusterNodeInfo
  140. //
  141. class CBaseClusterNodeInfo
  142. : public CBaseInfo
  143. {
  144. public:
  145. HNODE m_hNode;
  146. virtual HRESULT Close( void );
  147. virtual HRESULT Open( BSTR bstrNodeName );
  148. virtual DWORD Control( DWORD dwEnum, VOID * pvBufferIn, DWORD dwLengthIn, VOID * pvBufferOut, DWORD dwBufferLength, DWORD * dwLengthOut, HNODE hHostNode = NULL );
  149. virtual DWORD ToCode( CtlCodeEnum cceIn );
  150. };
  151. //
  152. // CBaseClusterNetworkInfo
  153. //
  154. class CBaseClusterNetworkInfo
  155. : public CBaseInfo
  156. {
  157. public:
  158. HNETWORK m_hNetwork;
  159. virtual HRESULT Close( void );
  160. virtual HRESULT Open( BSTR bstrNetworkName );
  161. virtual DWORD Control( DWORD dwEnum, VOID * pvBufferIn, DWORD dwLengthIn, VOID * pvBufferOut, DWORD dwBufferLength, DWORD * dwLengthOut, HNODE hHostNode = NULL );
  162. virtual DWORD ToCode( CtlCodeEnum cceIn );
  163. };
  164. //
  165. // CBaseClusterNetInterfaceInfo
  166. //
  167. class CBaseClusterNetInterfaceInfo
  168. : public CBaseInfo
  169. {
  170. public:
  171. HNETINTERFACE m_hNetworkInterface;
  172. virtual HRESULT Close( void );
  173. virtual HRESULT Open( BSTR bstrNetworkName );
  174. virtual DWORD Control( DWORD dwEnum, VOID * pvBufferIn, DWORD dwLengthIn, VOID * pvBufferOut, DWORD dwBufferLength, DWORD * dwLengthOut, HNODE hHostNode = NULL );
  175. virtual DWORD ToCode( CtlCodeEnum cceIn );
  176. };