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.

223 lines
5.4 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1997-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ClusWrap.h
  7. //
  8. // Description:
  9. // Wrapper functions for Cluster APIs.
  10. //
  11. // Author:
  12. // Galen Barbee (galenb) 15-Aug-1998
  13. //
  14. // Notes:
  15. //
  16. /////////////////////////////////////////////////////////////////////////////
  17. #ifndef __CLUSWRAP_H
  18. #define __CLUSWRAP_H
  19. #include "clusapi.h"
  20. #define CLUS_DEFAULT_TIMEOUT 10000
  21. //////////////////////////////////////////////////////////////////////////
  22. // Standard cluster API wrappers.
  23. //////////////////////////////////////////////////////////////////////////
  24. DWORD WINAPI WrapGetClusterInformation(
  25. IN HCLUSTER hCluster,
  26. OUT LPWSTR * ppwszClusterName,
  27. OUT OPTIONAL LPCLUSTERVERSIONINFO pClusterInfo
  28. );
  29. DWORD WINAPI WrapGetClusterQuorumResource(
  30. IN HCLUSTER hCluster,
  31. OUT LPWSTR * ppwszResourceName,
  32. OUT LPWSTR * ppwszDeviceName,
  33. OUT LPDWORD pdwMaxQuorumLogSize
  34. );
  35. DWORD WINAPI WrapClusterEnum(
  36. IN HCLUSENUM hEnum,
  37. IN DWORD dwIndex,
  38. OUT LPDWORD pdwType,
  39. OUT LPWSTR * plpwszName
  40. );
  41. DWORD WINAPI WrapGetClusterNodeId(
  42. IN HNODE hNode,
  43. OUT LPWSTR * ppwszNodeId
  44. );
  45. CLUSTER_GROUP_STATE WINAPI WrapGetClusterGroupState(
  46. IN HGROUP hGroup,
  47. OUT OPTIONAL LPWSTR * ppwszNodeName = NULL
  48. );
  49. DWORD WINAPI WrapClusterGroupEnum(
  50. IN HGROUPENUM hGroupEnum,
  51. IN DWORD dwIndex,
  52. OUT LPDWORD pdwType,
  53. OUT LPWSTR * ppwszGroupName
  54. );
  55. DWORD WINAPI WrapClusterNodeEnum(
  56. IN HNODEENUM hEnum,
  57. IN DWORD dwIndex,
  58. OUT LPDWORD pdwType,
  59. OUT LPWSTR * ppwszNodeName
  60. );
  61. DWORD WINAPI WrapClusterNetworkEnum(
  62. IN HNETWORKENUM hEnum,
  63. IN DWORD dwIndex,
  64. OUT LPDWORD pdwType,
  65. OUT LPWSTR * ppwszNetworkName
  66. );
  67. CLUSTER_RESOURCE_STATE WINAPI WrapGetClusterResourceState(
  68. IN HRESOURCE hResource,
  69. OUT OPTIONAL LPWSTR * ppwszNodeName,
  70. OUT OPTIONAL LPWSTR * ppwszGroupName
  71. );
  72. DWORD WINAPI WrapClusterResourceEnum(
  73. IN HRESENUM hResEnum,
  74. IN DWORD dwIndex,
  75. OUT LPDWORD pdwType,
  76. OUT LPWSTR * ppwszResourceName
  77. );
  78. DWORD WINAPI WrapClusterResourceTypeEnum(
  79. IN HRESTYPEENUM hResEnum,
  80. IN DWORD dwIndex,
  81. OUT LPDWORD pdwType,
  82. OUT LPWSTR * ppwszResTyoeName
  83. );
  84. HRESULT HrWrapOnlineClusterResource(
  85. HCLUSTER hCluster,
  86. HRESOURCE hResource,
  87. DWORD nWait = 0,
  88. long * pbPending = NULL
  89. );
  90. DWORD ScWrapOnlineClusterResource(
  91. IN HCLUSTER hCluster,
  92. IN HRESOURCE hResource,
  93. IN DWORD nWait = 0,
  94. OUT long * pbPending = NULL
  95. );
  96. HRESULT HrWrapOfflineClusterResource(
  97. HCLUSTER hCluster,
  98. HRESOURCE hResource,
  99. DWORD nWait = 0,
  100. long * pbPending = NULL
  101. );
  102. DWORD ScWrapOfflineClusterResource(
  103. IN HCLUSTER hCluster,
  104. IN HRESOURCE hResource,
  105. IN DWORD nWait = 0,
  106. OUT long * pbPending = NULL
  107. );
  108. HRESULT HrWrapOnlineClusterGroup(
  109. IN HCLUSTER hCluster,
  110. IN HGROUP hGroup,
  111. IN HNODE hNode = NULL,
  112. IN DWORD nWait = 0,
  113. OUT long * pbPending = NULL
  114. );
  115. DWORD ScWrapOnlineClusterGroup(
  116. IN HCLUSTER hCluster,
  117. IN HGROUP hGroup,
  118. IN HNODE hNode = NULL,
  119. IN DWORD nWait = 0,
  120. OUT long * pbPending = NULL
  121. );
  122. HRESULT HrWrapOfflineClusterGroup(
  123. IN HCLUSTER hCluster,
  124. IN HGROUP hGroup,
  125. IN DWORD nWait = 0,
  126. OUT long * pbPending = NULL
  127. );
  128. DWORD ScWrapOfflineClusterGroup(
  129. IN HCLUSTER hCluster,
  130. IN HGROUP hGroup,
  131. IN DWORD nWait = 0,
  132. OUT long * pbPending = NULL
  133. );
  134. HRESULT HrWrapMoveClusterGroup(
  135. IN HCLUSTER hCluster,
  136. IN HGROUP hGroup,
  137. IN HNODE hNode = NULL,
  138. IN DWORD nWait = 0,
  139. OUT long * pbPending = NULL
  140. );
  141. DWORD ScWrapMoveClusterGroup(
  142. IN HCLUSTER hCluster,
  143. IN HGROUP hGroup,
  144. IN HNODE hNode = NULL,
  145. IN DWORD nWait = 0,
  146. OUT long * pbPending = NULL
  147. );
  148. ////////////////////////////////////////////////////////////////////
  149. // Custom helper functions/classes/etc.
  150. ////////////////////////////////////////////////////////////////////
  151. /////////////////////////////////////////////////////////////////////////////
  152. //++
  153. //
  154. // class CClusterNotifyPort
  155. //
  156. // Description:
  157. // This class is a wrapper for the cluster notify port
  158. //
  159. // Inheritance:
  160. // CObjectProperty
  161. //
  162. //--
  163. /////////////////////////////////////////////////////////////////////////////
  164. class CClusterNotifyPort
  165. {
  166. public:
  167. CClusterNotifyPort();
  168. ~CClusterNotifyPort();
  169. DWORD Create(
  170. HCHANGE hChange = (HCHANGE) INVALID_HANDLE_VALUE,
  171. HCLUSTER hCluster = (HCLUSTER) INVALID_HANDLE_VALUE,
  172. DWORD dwFilter = 0,
  173. DWORD_PTR dwNotifyKey = 0
  174. );
  175. DWORD Close();
  176. DWORD Register( DWORD dwFilterType, HANDLE hObject, DWORD_PTR dwNotifyKey = 0 );
  177. DWORD GetNotify();
  178. DWORD_PTR m_dwNotifyKey;
  179. DWORD m_dwFilterType;
  180. WCHAR* m_szName;
  181. DWORD m_cchName;
  182. protected:
  183. HCHANGE m_hChange;
  184. }; //*** class CClusterNotifyPort
  185. #endif __CLUSWRAP_H