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.

2632 lines
70 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. clusapi.h
  5. Abstract:
  6. This module defines the common management and application interface to
  7. the Microsoft Cluster Server services.
  8. Revision History:
  9. --*/
  10. #ifndef _CLUSTER_API_
  11. #define _CLUSTER_API_
  12. #define CLUSAPI_VERSION 0x0500
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #ifndef MIDL_PASS
  20. #if _MSC_VER >= 1200
  21. #pragma warning(push)
  22. #endif
  23. #pragma warning( disable : 4200 ) // nonstandard extension used : zero-sized array in struct/union
  24. #pragma warning( disable : 4201 ) // nonstandard extension used : nameless struct/union
  25. #endif // MIDL_PASS
  26. //
  27. // General cluster definitions
  28. //
  29. #ifndef _CLUSTER_API_TYPES_
  30. //
  31. // Defined cluster handle types.
  32. //
  33. typedef struct _HCLUSTER *HCLUSTER;
  34. typedef struct _HNODE *HNODE;
  35. typedef struct _HRESOURCE *HRESOURCE;
  36. typedef struct _HGROUP *HGROUP;
  37. //typedef struct _HRESTYPE *HRESTYPE;
  38. typedef struct _HNETWORK *HNETWORK;
  39. typedef struct _HNETINTERFACE *HNETINTERFACE;
  40. typedef struct _HCHANGE *HCHANGE;
  41. typedef struct _HCLUSENUM *HCLUSENUM;
  42. typedef struct _HGROUPENUM *HGROUPENUM;
  43. typedef struct _HRESENUM *HRESENUM;
  44. typedef struct _HNETWORKENUM *HNETWORKENUM;
  45. typedef struct _HNODEENUM *HNODEENUM;
  46. typedef struct _HRESTYPEENUM *HRESTYPEENUM;
  47. #endif // _CLUSTER_API_TYPES_
  48. //
  49. // Definitions used in cluster management routines.
  50. //
  51. #define MAX_CLUSTERNAME_LENGTH MAX_COMPUTERNAME_LENGTH
  52. #ifndef _CLUSTER_API_TYPES_
  53. //
  54. // Cluster-related structures and types
  55. //
  56. typedef enum CLUSTER_QUORUM_TYPE {
  57. OperationalQuorum,
  58. ModifyQuorum
  59. } CLUSTER_QUORUM_TYPE;
  60. #ifndef MIDL_PASS
  61. typedef struct CLUSTERVERSIONINFO_NT4 {
  62. DWORD dwVersionInfoSize;
  63. WORD MajorVersion;
  64. WORD MinorVersion;
  65. WORD BuildNumber;
  66. WCHAR szVendorId[64];
  67. WCHAR szCSDVersion[64];
  68. }CLUSTERVERSIONINFO_NT4, *PCLUSTERVERSIONINFO_NT4;
  69. typedef struct CLUSTERVERSIONINFO {
  70. DWORD dwVersionInfoSize;
  71. WORD MajorVersion;
  72. WORD MinorVersion;
  73. WORD BuildNumber;
  74. WCHAR szVendorId[64];
  75. WCHAR szCSDVersion[64];
  76. DWORD dwClusterHighestVersion;
  77. DWORD dwClusterLowestVersion;
  78. DWORD dwFlags;
  79. DWORD dwReserved;
  80. } CLUSTERVERSIONINFO, *LPCLUSTERVERSIONINFO, *PCLUSTERVERSIONINFO;
  81. typedef struct CLUS_STARTING_PARAMS {
  82. DWORD dwSize;
  83. BOOL bForm;
  84. BOOL bFirst;
  85. } CLUS_STARTING_PARAMS, * PCLUS_STARTING_PARAMS;
  86. #define CLUSTER_VERSION_FLAG_MIXED_MODE 0x00000001
  87. #define NT4_MAJOR_VERSION 1
  88. #define NT4SP4_MAJOR_VERSION 2
  89. #define NT5_MAJOR_VERSION 3
  90. #define NT51_MAJOR_VERSION 4
  91. #define CLUSTER_VERSION_UNKNOWN 0xFFFFFFFF
  92. //
  93. // Version number macros
  94. //
  95. #define CLUSTER_MAKE_VERSION( _maj, _min ) ((( _maj ) << 16 ) | ( _min ))
  96. #define CLUSTER_GET_MAJOR_VERSION( _ver ) (( _ver ) >> 16 )
  97. #define CLUSTER_GET_MINOR_VERSION( _ver ) (( _ver ) & 0xFFFF )
  98. //
  99. // Interfaces for the cluster state on a node
  100. //
  101. #define CLUSTER_INSTALLED 0x00000001
  102. #define CLUSTER_CONFIGURED 0x00000002
  103. #define CLUSTER_RUNNING 0x00000010
  104. typedef enum NODE_CLUSTER_STATE {
  105. ClusterStateNotInstalled = 0x00000000,
  106. ClusterStateNotConfigured = CLUSTER_INSTALLED,
  107. ClusterStateNotRunning = CLUSTER_INSTALLED | CLUSTER_CONFIGURED,
  108. ClusterStateRunning = CLUSTER_INSTALLED | CLUSTER_CONFIGURED | CLUSTER_RUNNING
  109. } NODE_CLUSTER_STATE;
  110. #endif // MIDL_PASS
  111. #endif // _CLUSTER_API_TYPES_
  112. //
  113. // Interfaces for managing clusters
  114. //
  115. //
  116. // Cluster API Specific Access Rights
  117. //
  118. #define CLUSAPI_READ_ACCESS 0x00000001L
  119. #define CLUSAPI_CHANGE_ACCESS 0x00000002L
  120. #define CLUSAPI_NO_ACCESS 0x00000004L
  121. #define CLUSAPI_ALL_ACCESS (CLUSAPI_READ_ACCESS | CLUSAPI_CHANGE_ACCESS)
  122. //
  123. // Flags that control the behavior of SetClusterServiceAccountPassword
  124. //
  125. typedef enum CLUSTER_SET_PASSWORD_FLAGS {
  126. CLUSTER_SET_PASSWORD_IGNORE_DOWN_NODES = 1
  127. } CLUSTER_SET_PASSWORD_FLAGS;
  128. #ifndef MIDL_PASS
  129. //
  130. // Structure used to return the status of a request to set the
  131. // password on the account used by the Cluster Service on each
  132. // cluster node.
  133. //
  134. typedef struct CLUSTER_SET_PASSWORD_STATUS {
  135. DWORD NodeId;
  136. BOOLEAN SetAttempted;
  137. DWORD ReturnStatus;
  138. } CLUSTER_SET_PASSWORD_STATUS, *PCLUSTER_SET_PASSWORD_STATUS;
  139. DWORD
  140. WINAPI
  141. GetNodeClusterState(
  142. IN LPCWSTR lpszNodeName,
  143. OUT DWORD *pdwClusterState
  144. );
  145. HCLUSTER
  146. WINAPI
  147. OpenCluster(
  148. IN LPCWSTR lpszClusterName
  149. );
  150. BOOL
  151. WINAPI
  152. CloseCluster(
  153. IN HCLUSTER hCluster
  154. );
  155. DWORD
  156. WINAPI
  157. SetClusterName(
  158. IN HCLUSTER hCluster,
  159. IN LPCWSTR lpszNewClusterName
  160. );
  161. DWORD
  162. WINAPI
  163. GetClusterInformation(
  164. IN HCLUSTER hCluster,
  165. OUT LPWSTR lpszClusterName,
  166. IN OUT LPDWORD lpcchClusterName,
  167. OUT OPTIONAL LPCLUSTERVERSIONINFO lpClusterInfo
  168. );
  169. DWORD
  170. WINAPI
  171. GetClusterQuorumResource(
  172. IN HCLUSTER hCluster,
  173. OUT LPWSTR lpszResourceName,
  174. IN OUT LPDWORD lpcchResourceName,
  175. OUT LPWSTR lpszDeviceName,
  176. IN OUT LPDWORD lpcchDeviceName,
  177. OUT LPDWORD lpdwMaxQuorumLogSize
  178. );
  179. DWORD
  180. WINAPI
  181. SetClusterQuorumResource(
  182. IN HRESOURCE hResource,
  183. IN LPCWSTR lpszDeviceName,
  184. IN DWORD dwMaxQuoLogSize
  185. );
  186. DWORD
  187. WINAPI
  188. BackupClusterDatabase(
  189. IN HCLUSTER hCluster,
  190. IN LPCWSTR lpszPathName
  191. );
  192. DWORD
  193. WINAPI
  194. RestoreClusterDatabase(
  195. IN LPCWSTR lpszPathName,
  196. IN BOOL bForce,
  197. IN OPTIONAL LPCWSTR lpszQuorumDriveLetter
  198. );
  199. DWORD
  200. WINAPI
  201. SetClusterNetworkPriorityOrder(
  202. IN HCLUSTER hCluster,
  203. IN DWORD NetworkCount,
  204. IN HNETWORK NetworkList[]
  205. );
  206. DWORD
  207. WINAPI
  208. SetClusterServiceAccountPassword(
  209. IN LPCWSTR ClusterName,
  210. IN LPCWSTR lpszNewPassword,
  211. IN DWORD dwFlags,
  212. OUT PCLUSTER_SET_PASSWORD_STATUS ReturnStatusBuffer,
  213. IN OUT LPDWORD ReturnStatusBufferSize
  214. );
  215. DWORD
  216. WINAPI
  217. ClusterControl(
  218. IN HCLUSTER hCluster,
  219. IN OPTIONAL HNODE hHostNode,
  220. IN DWORD dwControlCode,
  221. IN LPVOID lpInBuffer,
  222. IN DWORD nInBufferSize,
  223. OUT LPVOID lpOutBuffer,
  224. IN DWORD nOutBufferSize,
  225. OUT LPDWORD lpBytesReturned
  226. );
  227. #endif // MIDL_PASS
  228. //
  229. // Cluster Event Notification API
  230. //
  231. #ifndef _CLUSTER_API_TYPES_
  232. //
  233. // Cluster event filter flags.
  234. //
  235. typedef enum CLUSTER_CHANGE {
  236. CLUSTER_CHANGE_NODE_STATE = 0x00000001,
  237. CLUSTER_CHANGE_NODE_DELETED = 0x00000002,
  238. CLUSTER_CHANGE_NODE_ADDED = 0x00000004,
  239. CLUSTER_CHANGE_NODE_PROPERTY = 0x00000008,
  240. CLUSTER_CHANGE_REGISTRY_NAME = 0x00000010,
  241. CLUSTER_CHANGE_REGISTRY_ATTRIBUTES = 0x00000020,
  242. CLUSTER_CHANGE_REGISTRY_VALUE = 0x00000040,
  243. CLUSTER_CHANGE_REGISTRY_SUBTREE = 0x00000080,
  244. CLUSTER_CHANGE_RESOURCE_STATE = 0x00000100,
  245. CLUSTER_CHANGE_RESOURCE_DELETED = 0x00000200,
  246. CLUSTER_CHANGE_RESOURCE_ADDED = 0x00000400,
  247. CLUSTER_CHANGE_RESOURCE_PROPERTY = 0x00000800,
  248. CLUSTER_CHANGE_GROUP_STATE = 0x00001000,
  249. CLUSTER_CHANGE_GROUP_DELETED = 0x00002000,
  250. CLUSTER_CHANGE_GROUP_ADDED = 0x00004000,
  251. CLUSTER_CHANGE_GROUP_PROPERTY = 0x00008000,
  252. CLUSTER_CHANGE_RESOURCE_TYPE_DELETED = 0x00010000,
  253. CLUSTER_CHANGE_RESOURCE_TYPE_ADDED = 0x00020000,
  254. CLUSTER_CHANGE_RESOURCE_TYPE_PROPERTY = 0x00040000,
  255. CLUSTER_CHANGE_CLUSTER_RECONNECT = 0x00080000,
  256. CLUSTER_CHANGE_NETWORK_STATE = 0x00100000,
  257. CLUSTER_CHANGE_NETWORK_DELETED = 0x00200000,
  258. CLUSTER_CHANGE_NETWORK_ADDED = 0x00400000,
  259. CLUSTER_CHANGE_NETWORK_PROPERTY = 0x00800000,
  260. CLUSTER_CHANGE_NETINTERFACE_STATE = 0x01000000,
  261. CLUSTER_CHANGE_NETINTERFACE_DELETED = 0x02000000,
  262. CLUSTER_CHANGE_NETINTERFACE_ADDED = 0x04000000,
  263. CLUSTER_CHANGE_NETINTERFACE_PROPERTY = 0x08000000,
  264. CLUSTER_CHANGE_QUORUM_STATE = 0x10000000,
  265. CLUSTER_CHANGE_CLUSTER_STATE = 0x20000000,
  266. CLUSTER_CHANGE_CLUSTER_PROPERTY = 0x40000000,
  267. CLUSTER_CHANGE_HANDLE_CLOSE = 0x80000000,
  268. CLUSTER_CHANGE_ALL = (CLUSTER_CHANGE_NODE_STATE |
  269. CLUSTER_CHANGE_NODE_DELETED |
  270. CLUSTER_CHANGE_NODE_ADDED |
  271. CLUSTER_CHANGE_NODE_PROPERTY |
  272. CLUSTER_CHANGE_REGISTRY_NAME |
  273. CLUSTER_CHANGE_REGISTRY_ATTRIBUTES |
  274. CLUSTER_CHANGE_REGISTRY_VALUE |
  275. CLUSTER_CHANGE_REGISTRY_SUBTREE |
  276. CLUSTER_CHANGE_RESOURCE_STATE |
  277. CLUSTER_CHANGE_RESOURCE_DELETED |
  278. CLUSTER_CHANGE_RESOURCE_ADDED |
  279. CLUSTER_CHANGE_RESOURCE_PROPERTY |
  280. CLUSTER_CHANGE_GROUP_STATE |
  281. CLUSTER_CHANGE_GROUP_DELETED |
  282. CLUSTER_CHANGE_GROUP_ADDED |
  283. CLUSTER_CHANGE_GROUP_PROPERTY |
  284. CLUSTER_CHANGE_RESOURCE_TYPE_DELETED |
  285. CLUSTER_CHANGE_RESOURCE_TYPE_ADDED |
  286. CLUSTER_CHANGE_RESOURCE_TYPE_PROPERTY |
  287. CLUSTER_CHANGE_NETWORK_STATE |
  288. CLUSTER_CHANGE_NETWORK_DELETED |
  289. CLUSTER_CHANGE_NETWORK_ADDED |
  290. CLUSTER_CHANGE_NETWORK_PROPERTY |
  291. CLUSTER_CHANGE_NETINTERFACE_STATE |
  292. CLUSTER_CHANGE_NETINTERFACE_DELETED |
  293. CLUSTER_CHANGE_NETINTERFACE_ADDED |
  294. CLUSTER_CHANGE_NETINTERFACE_PROPERTY |
  295. CLUSTER_CHANGE_QUORUM_STATE |
  296. CLUSTER_CHANGE_CLUSTER_STATE |
  297. CLUSTER_CHANGE_CLUSTER_PROPERTY |
  298. CLUSTER_CHANGE_CLUSTER_RECONNECT |
  299. CLUSTER_CHANGE_HANDLE_CLOSE)
  300. } CLUSTER_CHANGE;
  301. #endif // _CLUSTER_API_TYPES_
  302. #ifndef MIDL_PASS
  303. HCHANGE
  304. WINAPI
  305. CreateClusterNotifyPort(
  306. IN OPTIONAL HCHANGE hChange,
  307. IN OPTIONAL HCLUSTER hCluster,
  308. IN DWORD dwFilter,
  309. IN DWORD_PTR dwNotifyKey
  310. );
  311. DWORD
  312. WINAPI
  313. RegisterClusterNotify(
  314. IN HCHANGE hChange,
  315. IN DWORD dwFilterType,
  316. IN HANDLE hObject,
  317. IN DWORD_PTR dwNotifyKey
  318. );
  319. DWORD
  320. WINAPI
  321. GetClusterNotify(
  322. IN HCHANGE hChange,
  323. OUT DWORD_PTR *lpdwNotifyKey,
  324. OUT LPDWORD lpdwFilterType,
  325. OUT OPTIONAL LPWSTR lpszName,
  326. IN OUT LPDWORD lpcchName,
  327. IN DWORD dwMilliseconds
  328. );
  329. BOOL
  330. WINAPI
  331. CloseClusterNotifyPort(
  332. IN HCHANGE hChange
  333. );
  334. #endif // MIDL_PASS
  335. //
  336. // Enumeration routines
  337. //
  338. #ifndef _CLUSTER_API_TYPES_
  339. //
  340. // Define enumerable types
  341. //
  342. typedef enum CLUSTER_ENUM {
  343. CLUSTER_ENUM_NODE = 0x00000001,
  344. CLUSTER_ENUM_RESTYPE = 0x00000002,
  345. CLUSTER_ENUM_RESOURCE = 0x00000004,
  346. CLUSTER_ENUM_GROUP = 0x00000008,
  347. CLUSTER_ENUM_NETWORK = 0x00000010,
  348. CLUSTER_ENUM_NETINTERFACE = 0x00000020,
  349. CLUSTER_ENUM_INTERNAL_NETWORK = 0x80000000,
  350. CLUSTER_ENUM_ALL = (CLUSTER_ENUM_NODE |
  351. CLUSTER_ENUM_RESTYPE |
  352. CLUSTER_ENUM_RESOURCE |
  353. CLUSTER_ENUM_GROUP |
  354. CLUSTER_ENUM_NETWORK |
  355. CLUSTER_ENUM_NETINTERFACE)
  356. } CLUSTER_ENUM;
  357. #endif // _CLUSTER_API_TYPES_
  358. #ifndef MIDL_PASS
  359. HCLUSENUM
  360. WINAPI
  361. ClusterOpenEnum(
  362. IN HCLUSTER hCluster,
  363. IN DWORD dwType
  364. );
  365. DWORD
  366. WINAPI
  367. ClusterGetEnumCount(
  368. IN HCLUSENUM hEnum
  369. );
  370. DWORD
  371. WINAPI
  372. ClusterEnum(
  373. IN HCLUSENUM hEnum,
  374. IN DWORD dwIndex,
  375. OUT LPDWORD lpdwType,
  376. OUT LPWSTR lpszName,
  377. IN OUT LPDWORD lpcchName
  378. );
  379. DWORD
  380. WINAPI
  381. ClusterCloseEnum(
  382. IN HCLUSENUM hEnum
  383. );
  384. #endif // MIDL_PASS
  385. #ifndef _CLUSTER_API_TYPES_
  386. //
  387. // Define enumerable node types
  388. //
  389. typedef enum CLUSTER_NODE_ENUM {
  390. CLUSTER_NODE_ENUM_NETINTERFACES = 0x00000001,
  391. CLUSTER_NODE_ENUM_ALL = (CLUSTER_NODE_ENUM_NETINTERFACES)
  392. } CLUSTER_NODE_ENUM;
  393. //
  394. // Node-related structures and types.
  395. //
  396. typedef enum CLUSTER_NODE_STATE {
  397. ClusterNodeStateUnknown = -1,
  398. ClusterNodeUp,
  399. ClusterNodeDown,
  400. ClusterNodePaused,
  401. ClusterNodeJoining
  402. } CLUSTER_NODE_STATE;
  403. #endif // _CLUSTER_API_TYPES_
  404. //
  405. // Interfaces for managing the nodes of a cluster.
  406. //
  407. #ifndef MIDL_PASS
  408. HNODE
  409. WINAPI
  410. OpenClusterNode(
  411. IN HCLUSTER hCluster,
  412. IN LPCWSTR lpszNodeName
  413. );
  414. BOOL
  415. WINAPI
  416. CloseClusterNode(
  417. IN HNODE hNode
  418. );
  419. CLUSTER_NODE_STATE
  420. WINAPI
  421. GetClusterNodeState(
  422. IN HNODE hNode
  423. );
  424. DWORD
  425. WINAPI
  426. GetClusterNodeId(
  427. IN HNODE hNode,
  428. OUT LPWSTR lpszNodeId,
  429. IN OUT LPDWORD lpcchName
  430. );
  431. #define GetCurrentClusterNodeId(_lpszNodeId_, _lpcchName_) \
  432. GetClusterNodeId(NULL, (_lpszNodeId_), (_lpcchName_))
  433. HCLUSTER
  434. WINAPI
  435. GetClusterFromNode(
  436. IN HNODE hNode
  437. );
  438. DWORD
  439. WINAPI
  440. PauseClusterNode(
  441. IN HNODE hNode
  442. );
  443. DWORD
  444. WINAPI
  445. ResumeClusterNode(
  446. IN HNODE hNode
  447. );
  448. DWORD
  449. WINAPI
  450. EvictClusterNode(
  451. IN HNODE hNode
  452. );
  453. HNODEENUM
  454. WINAPI
  455. ClusterNodeOpenEnum(
  456. IN HNODE hNode,
  457. IN DWORD dwType
  458. );
  459. DWORD
  460. WINAPI
  461. ClusterNodeGetEnumCount(
  462. IN HNODEENUM hNodeEnum
  463. );
  464. DWORD
  465. WINAPI
  466. ClusterNodeCloseEnum(
  467. IN HNODEENUM hNodeEnum
  468. );
  469. DWORD
  470. WINAPI
  471. ClusterNodeEnum(
  472. IN HNODEENUM hNodeEnum,
  473. IN DWORD dwIndex,
  474. OUT LPDWORD lpdwType,
  475. OUT LPWSTR lpszName,
  476. IN OUT LPDWORD lpcchName
  477. );
  478. DWORD
  479. WINAPI
  480. EvictClusterNodeEx(
  481. IN HNODE hNode,
  482. IN DWORD dwTimeOut,
  483. OUT HRESULT* phrCleanupStatus
  484. );
  485. #endif // MIDL_PASS
  486. //
  487. // Interfaces for managing the resource types in a cluster
  488. //
  489. #ifndef MIDL_PASS
  490. HKEY
  491. WINAPI
  492. GetClusterResourceTypeKey(
  493. IN HCLUSTER hCluster,
  494. IN LPCWSTR lpszTypeName,
  495. IN REGSAM samDesired
  496. );
  497. #endif // MIDL_PASS
  498. #ifndef _CLUSTER_API_TYPES_
  499. //
  500. // Define enumerable group types
  501. //
  502. typedef enum CLUSTER_GROUP_ENUM {
  503. CLUSTER_GROUP_ENUM_CONTAINS = 0x00000001,
  504. CLUSTER_GROUP_ENUM_NODES = 0x00000002,
  505. CLUSTER_GROUP_ENUM_ALL = (CLUSTER_GROUP_ENUM_CONTAINS |
  506. CLUSTER_GROUP_ENUM_NODES)
  507. } CLUSTER_GROUP_ENUM;
  508. //
  509. // Interfaces for managing the failover groups in a cluster.
  510. //
  511. typedef enum CLUSTER_GROUP_STATE {
  512. ClusterGroupStateUnknown = -1,
  513. ClusterGroupOnline,
  514. ClusterGroupOffline,
  515. ClusterGroupFailed,
  516. ClusterGroupPartialOnline,
  517. ClusterGroupPending
  518. } CLUSTER_GROUP_STATE;
  519. typedef enum CLUSTER_GROUP_AUTOFAILBACK_TYPE
  520. {
  521. ClusterGroupPreventFailback = 0,
  522. ClusterGroupAllowFailback,
  523. ClusterGroupFailbackTypeCount
  524. } CLUSTER_GROUP_AUTOFAILBACK_TYPE, CGAFT;
  525. #endif // _CLUSTER_API_TYPES_
  526. #ifndef MIDL_PASS
  527. HGROUP
  528. WINAPI
  529. CreateClusterGroup(
  530. IN HCLUSTER hCluster,
  531. IN LPCWSTR lpszGroupName
  532. );
  533. HGROUP
  534. WINAPI
  535. OpenClusterGroup(
  536. IN HCLUSTER hCluster,
  537. IN LPCWSTR lpszGroupName
  538. );
  539. BOOL
  540. WINAPI
  541. CloseClusterGroup(
  542. IN HGROUP hGroup
  543. );
  544. HCLUSTER
  545. WINAPI
  546. GetClusterFromGroup(
  547. IN HGROUP hGroup
  548. );
  549. CLUSTER_GROUP_STATE
  550. WINAPI
  551. GetClusterGroupState(
  552. IN HGROUP hGroup,
  553. OUT OPTIONAL LPWSTR lpszNodeName,
  554. IN OUT LPDWORD lpcchNodeName
  555. );
  556. DWORD
  557. WINAPI
  558. SetClusterGroupName(
  559. IN HGROUP hGroup,
  560. IN LPCWSTR lpszGroupName
  561. );
  562. DWORD
  563. WINAPI
  564. SetClusterGroupNodeList(
  565. IN HGROUP hGroup,
  566. IN DWORD NodeCount,
  567. IN HNODE NodeList[]
  568. );
  569. DWORD
  570. WINAPI
  571. OnlineClusterGroup(
  572. IN HGROUP hGroup,
  573. IN OPTIONAL HNODE hDestinationNode
  574. );
  575. DWORD
  576. WINAPI
  577. MoveClusterGroup(
  578. IN HGROUP hGroup,
  579. IN OPTIONAL HNODE hDestinationNode
  580. );
  581. DWORD
  582. WINAPI
  583. OfflineClusterGroup(
  584. IN HGROUP hGroup
  585. );
  586. DWORD
  587. WINAPI
  588. DeleteClusterGroup(
  589. IN HGROUP hGroup
  590. );
  591. HGROUPENUM
  592. WINAPI
  593. ClusterGroupOpenEnum(
  594. IN HGROUP hGroup,
  595. IN DWORD dwType
  596. );
  597. DWORD
  598. WINAPI
  599. ClusterGroupGetEnumCount(
  600. IN HGROUPENUM hGroupEnum
  601. );
  602. DWORD
  603. WINAPI
  604. ClusterGroupEnum(
  605. IN HGROUPENUM hGroupEnum,
  606. IN DWORD dwIndex,
  607. OUT LPDWORD lpdwType,
  608. OUT LPWSTR lpszResourceName,
  609. IN OUT LPDWORD lpcchName
  610. );
  611. DWORD
  612. WINAPI
  613. ClusterGroupCloseEnum(
  614. IN HGROUPENUM hGroupEnum
  615. );
  616. #endif // MIDL_PASS
  617. //
  618. // Definitions used in resource management routines.
  619. //
  620. #ifndef _CLUSTER_API_TYPES_
  621. //
  622. // Resource-related structures and types
  623. //
  624. typedef enum CLUSTER_RESOURCE_STATE {
  625. ClusterResourceStateUnknown = -1,
  626. ClusterResourceInherited,
  627. ClusterResourceInitializing,
  628. ClusterResourceOnline,
  629. ClusterResourceOffline,
  630. ClusterResourceFailed,
  631. ClusterResourcePending = 128,
  632. ClusterResourceOnlinePending,
  633. ClusterResourceOfflinePending
  634. } CLUSTER_RESOURCE_STATE;
  635. typedef enum CLUSTER_RESOURCE_RESTART_ACTION {
  636. ClusterResourceDontRestart = 0,
  637. ClusterResourceRestartNoNotify,
  638. ClusterResourceRestartNotify,
  639. ClusterResourceRestartActionCount
  640. } CLUSTER_RESOURCE_RESTART_ACTION, CRRA;
  641. //
  642. // Flags for resource creation
  643. //
  644. typedef enum CLUSTER_RESOURCE_CREATE_FLAGS {
  645. CLUSTER_RESOURCE_DEFAULT_MONITOR = 0,
  646. CLUSTER_RESOURCE_SEPARATE_MONITOR = 1,
  647. CLUSTER_RESOURCE_VALID_FLAGS = CLUSTER_RESOURCE_SEPARATE_MONITOR
  648. } CLUSTER_RESOURCE_CREATE_FLAGS;
  649. #endif // _CLUSTER_API_TYPES_
  650. //
  651. // Interfaces for managing the resources in a cluster
  652. //
  653. #ifndef MIDL_PASS
  654. HRESOURCE
  655. WINAPI
  656. CreateClusterResource(
  657. IN HGROUP hGroup,
  658. IN LPCWSTR lpszResourceName,
  659. IN LPCWSTR lpszResourceType,
  660. IN DWORD dwFlags
  661. );
  662. HRESOURCE
  663. WINAPI
  664. OpenClusterResource(
  665. IN HCLUSTER hCluster,
  666. IN LPCWSTR lpszResourceName
  667. );
  668. BOOL
  669. WINAPI
  670. CloseClusterResource(
  671. IN HRESOURCE hResource
  672. );
  673. HCLUSTER
  674. WINAPI
  675. GetClusterFromResource(
  676. IN HRESOURCE hResource
  677. );
  678. DWORD
  679. WINAPI
  680. DeleteClusterResource(
  681. IN HRESOURCE hResource
  682. );
  683. CLUSTER_RESOURCE_STATE
  684. WINAPI
  685. GetClusterResourceState(
  686. IN HRESOURCE hResource,
  687. OUT OPTIONAL LPWSTR lpszNodeName,
  688. IN OUT LPDWORD lpcchNodeName,
  689. OUT OPTIONAL LPWSTR lpszGroupName,
  690. IN OUT LPDWORD lpcchGroupName
  691. );
  692. DWORD
  693. WINAPI
  694. SetClusterResourceName(
  695. IN HRESOURCE hResource,
  696. IN LPCWSTR lpszResourceName
  697. );
  698. DWORD
  699. WINAPI
  700. FailClusterResource(
  701. IN HRESOURCE hResource
  702. );
  703. DWORD
  704. WINAPI
  705. OnlineClusterResource(
  706. IN HRESOURCE hResource
  707. );
  708. DWORD
  709. WINAPI
  710. OfflineClusterResource(
  711. IN HRESOURCE hResource
  712. );
  713. DWORD
  714. WINAPI
  715. ChangeClusterResourceGroup(
  716. IN HRESOURCE hResource,
  717. IN HGROUP hGroup
  718. );
  719. DWORD
  720. WINAPI
  721. AddClusterResourceNode(
  722. IN HRESOURCE hResource,
  723. IN HNODE hNode
  724. );
  725. DWORD
  726. WINAPI
  727. RemoveClusterResourceNode(
  728. IN HRESOURCE hResource,
  729. IN HNODE hNode
  730. );
  731. DWORD
  732. WINAPI
  733. AddClusterResourceDependency(
  734. IN HRESOURCE hResource,
  735. IN HRESOURCE hDependsOn
  736. );
  737. DWORD
  738. WINAPI
  739. RemoveClusterResourceDependency(
  740. IN HRESOURCE hResource,
  741. IN HRESOURCE hDependsOn
  742. );
  743. BOOL
  744. WINAPI
  745. CanResourceBeDependent(
  746. IN HRESOURCE hResource,
  747. IN HRESOURCE hResourceDependent
  748. );
  749. DWORD
  750. WINAPI
  751. ClusterResourceControl(
  752. IN HRESOURCE hResource,
  753. IN OPTIONAL HNODE hHostNode,
  754. IN DWORD dwControlCode,
  755. IN LPVOID lpInBuffer,
  756. IN DWORD cbInBufferSize,
  757. OUT LPVOID lpOutBuffer,
  758. IN DWORD cbOutBufferSize,
  759. OUT LPDWORD lpcbBytesReturned
  760. );
  761. DWORD
  762. WINAPI
  763. ClusterResourceTypeControl(
  764. IN HCLUSTER hCluster,
  765. IN LPCWSTR ResourceTypeName,
  766. IN OPTIONAL HNODE hHostNode,
  767. IN DWORD dwControlCode,
  768. IN LPVOID lpInBuffer,
  769. IN DWORD cbInBufferSize,
  770. OUT LPVOID lpOutBuffer,
  771. IN DWORD cbOutBufferSize,
  772. OUT LPDWORD lpcbBytesReturned
  773. );
  774. DWORD
  775. WINAPI
  776. ClusterGroupControl(
  777. IN HGROUP hGroup,
  778. IN OPTIONAL HNODE hHostNode,
  779. IN DWORD dwControlCode,
  780. IN LPVOID lpInBuffer,
  781. IN DWORD cbInBufferSize,
  782. OUT LPVOID lpOutBuffer,
  783. IN DWORD cbOutBufferSize,
  784. OUT LPDWORD lpcbBytesReturned
  785. );
  786. DWORD
  787. WINAPI
  788. ClusterNodeControl(
  789. IN HNODE hNode,
  790. IN OPTIONAL HNODE hHostNode,
  791. IN DWORD dwControlCode,
  792. IN LPVOID lpInBuffer,
  793. IN DWORD cbInBufferSize,
  794. OUT LPVOID lpOutBuffer,
  795. IN DWORD cbOutBufferSize,
  796. OUT LPDWORD lpcbBytesReturned
  797. );
  798. BOOL
  799. WINAPI
  800. GetClusterResourceNetworkName(
  801. IN HRESOURCE hResource,
  802. OUT LPWSTR lpBuffer,
  803. IN OUT LPDWORD nSize
  804. );
  805. #endif // MIDL_PASS
  806. //
  807. // Cluster control properties
  808. //
  809. #ifndef _CLUSTER_API_TYPES_
  810. //
  811. // Cluster Control Property Data - Types (a WORD)
  812. //
  813. typedef enum CLUSTER_PROPERTY_TYPE {
  814. CLUSPROP_TYPE_UNKNOWN = -1,
  815. CLUSPROP_TYPE_ENDMARK = 0,
  816. CLUSPROP_TYPE_LIST_VALUE,
  817. CLUSPROP_TYPE_RESCLASS,
  818. CLUSPROP_TYPE_RESERVED1,
  819. CLUSPROP_TYPE_NAME,
  820. CLUSPROP_TYPE_SIGNATURE,
  821. CLUSPROP_TYPE_SCSI_ADDRESS,
  822. CLUSPROP_TYPE_DISK_NUMBER,
  823. CLUSPROP_TYPE_PARTITION_INFO,
  824. CLUSPROP_TYPE_FTSET_INFO,
  825. CLUSPROP_TYPE_DISK_SERIALNUMBER,
  826. CLUSPROP_TYPE_USER=32768
  827. } CLUSTER_PROPERTY_TYPE;
  828. //
  829. // Cluster Control Property Data - Formats (a WORD)
  830. //
  831. typedef enum CLUSTER_PROPERTY_FORMAT {
  832. CLUSPROP_FORMAT_UNKNOWN = 0,
  833. CLUSPROP_FORMAT_BINARY,
  834. CLUSPROP_FORMAT_DWORD,
  835. CLUSPROP_FORMAT_SZ,
  836. CLUSPROP_FORMAT_EXPAND_SZ,
  837. CLUSPROP_FORMAT_MULTI_SZ,
  838. CLUSPROP_FORMAT_ULARGE_INTEGER,
  839. CLUSPROP_FORMAT_LONG,
  840. CLUSPROP_FORMAT_EXPANDED_SZ,
  841. CLUSPROP_FORMAT_SECURITY_DESCRIPTOR,
  842. CLUSPROP_FORMAT_LARGE_INTEGER,
  843. CLUSPROP_FORMAT_WORD,
  844. CLUSPROP_FORMAT_USER=32768
  845. } CLUSTER_PROPERTY_FORMAT;
  846. #endif // _CLUSTER_API_TYPES_
  847. //
  848. // Cluster Control Property Data - Syntax
  849. //
  850. #define CLUSPROP_SYNTAX_VALUE( type, format ) ((DWORD) ((type << 16) | format))
  851. #ifndef _CLUSTER_API_TYPES_
  852. typedef enum CLUSTER_PROPERTY_SYNTAX {
  853. CLUSPROP_SYNTAX_ENDMARK = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_ENDMARK, CLUSPROP_FORMAT_UNKNOWN ),
  854. CLUSPROP_SYNTAX_NAME = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_NAME, CLUSPROP_FORMAT_SZ ),
  855. CLUSPROP_SYNTAX_RESCLASS = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_RESCLASS, CLUSPROP_FORMAT_DWORD ),
  856. CLUSPROP_SYNTAX_LIST_VALUE_SZ = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_LIST_VALUE, CLUSPROP_FORMAT_SZ ),
  857. CLUSPROP_SYNTAX_LIST_VALUE_EXPAND_SZ = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_LIST_VALUE, CLUSPROP_FORMAT_EXPAND_SZ ),
  858. CLUSPROP_SYNTAX_LIST_VALUE_DWORD = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_LIST_VALUE, CLUSPROP_FORMAT_DWORD ),
  859. CLUSPROP_SYNTAX_LIST_VALUE_BINARY = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_LIST_VALUE, CLUSPROP_FORMAT_BINARY ),
  860. CLUSPROP_SYNTAX_LIST_VALUE_MULTI_SZ = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_LIST_VALUE, CLUSPROP_FORMAT_MULTI_SZ ),
  861. CLUSPROP_SYNTAX_LIST_VALUE_LONG = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_LIST_VALUE, CLUSPROP_FORMAT_LONG ),
  862. CLUSPROP_SYNTAX_LIST_VALUE_EXPANDED_SZ = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_LIST_VALUE, CLUSPROP_FORMAT_EXPANDED_SZ ),
  863. CLUSPROP_SYNTAX_LIST_VALUE_SECURITY_DESCRIPTOR = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_LIST_VALUE, CLUSPROP_FORMAT_SECURITY_DESCRIPTOR ),
  864. CLUSPROP_SYNTAX_LIST_VALUE_LARGE_INTEGER = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_LIST_VALUE, CLUSPROP_FORMAT_LARGE_INTEGER ),
  865. // Storage syntax values
  866. CLUSPROP_SYNTAX_DISK_SIGNATURE = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_SIGNATURE, CLUSPROP_FORMAT_DWORD ),
  867. CLUSPROP_SYNTAX_SCSI_ADDRESS = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_SCSI_ADDRESS, CLUSPROP_FORMAT_DWORD ),
  868. CLUSPROP_SYNTAX_DISK_NUMBER = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_DISK_NUMBER, CLUSPROP_FORMAT_DWORD ),
  869. CLUSPROP_SYNTAX_PARTITION_INFO = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_PARTITION_INFO, CLUSPROP_FORMAT_BINARY ),
  870. CLUSPROP_SYNTAX_FTSET_INFO = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_FTSET_INFO, CLUSPROP_FORMAT_BINARY ),
  871. CLUSPROP_SYNTAX_DISK_SERIALNUMBER = CLUSPROP_SYNTAX_VALUE( CLUSPROP_TYPE_DISK_SERIALNUMBER, CLUSPROP_FORMAT_SZ )
  872. } CLUSTER_PROPERTY_SYNTAX;
  873. #endif // _CLUSTER_API_TYPES_
  874. //
  875. // Define Cluster Control Code access methods
  876. //
  877. #define CLUS_ACCESS_ANY 0
  878. #define CLUS_ACCESS_READ 0x01
  879. #define CLUS_ACCESS_WRITE 0x02
  880. //
  881. // Define Cluster Control Code modification actions
  882. //
  883. #define CLUS_NO_MODIFY 0
  884. #define CLUS_MODIFY 0x01
  885. //
  886. // Define Cluster Control Code Global actions
  887. //
  888. #define CLUS_NOT_GLOBAL 0
  889. #define CLUS_GLOBAL 0x01
  890. #ifndef _CLUSTER_API_TYPES_
  891. //
  892. // Define Cluster Control Code target objects
  893. //
  894. typedef enum CLUSTER_CONTROL_OBJECT {
  895. CLUS_OBJECT_INVALID=0,
  896. CLUS_OBJECT_RESOURCE,
  897. CLUS_OBJECT_RESOURCE_TYPE,
  898. CLUS_OBJECT_GROUP,
  899. CLUS_OBJECT_NODE,
  900. CLUS_OBJECT_NETWORK,
  901. CLUS_OBJECT_NETINTERFACE,
  902. CLUS_OBJECT_CLUSTER,
  903. CLUS_OBJECT_USER=128
  904. } CLUSTER_CONTROL_OBJECT;
  905. #endif // _CLUSTER_API_TYPES_
  906. //
  907. // Macro to generate full cluster control codes
  908. //
  909. // 31 24 23 22 21 20 19 16 15 2 1 0
  910. // +----------+--+--+--+--+-----------+-----------------------+------+
  911. // | OBJECT |G |M |U |I CLUSTER CONTROL CODES |ACCESS|
  912. // +----------+--+--+--+--+-----------+-----------------------+------+
  913. //
  914. // OBJECT - Object identifier (8 bits)
  915. // G - Global bit (operation must be performed on all nodes of cluster)
  916. // M - Modify bit (code causes a modification, may cause event notification)
  917. // U - User code bit (splits the control codes into 2 spaces each 2^^19 in size)
  918. // I - Internal code bit (only for non-user control codes)
  919. // CLUSTER CONTROL CODES - 2^^18 (256 thousand possible control codes)
  920. // ACCESS - Access mode (2 bits)
  921. //
  922. //
  923. // Define control code shifts
  924. //
  925. #define CLUSCTL_ACCESS_SHIFT 0
  926. #define CLUSCTL_FUNCTION_SHIFT 2
  927. #define CLCTL_INTERNAL_SHIFT 20
  928. #define CLCTL_USER_SHIFT 21
  929. #define CLCTL_MODIFY_SHIFT 22
  930. #define CLCTL_GLOBAL_SHIFT 23
  931. #define CLUSCTL_OBJECT_SHIFT 24
  932. //
  933. // Define control code masks
  934. //
  935. #define CLCTL_INTERNAL_MASK (1<<CLCTL_INTERNAL_SHIFT)
  936. #define CLCTL_USER_MASK (1<<CLCTL_USER_SHIFT)
  937. #define CLCTL_MODIFY_MASK (1<<CLCTL_MODIFY_SHIFT)
  938. #define CLCTL_GLOBAL_MASK (1<<CLCTL_GLOBAL_SHIFT)
  939. #define CLUSCTL_CONTROL_CODE_MASK 0x3FFFFF // Includes access mask
  940. #define CLUSCTL_OBJECT_MASK 0xFF
  941. #define CLUSCTL_ACCESS_MODE_MASK 0x03
  942. //
  943. // Cluster Control function codes (a DWORD)
  944. //
  945. #define CLCTL_CLUSTER_BASE 0 // Start of cluster defined functions
  946. #define CLCTL_USER_BASE (1<<CLCTL_USER_SHIFT) // Start of user functions
  947. #define CLCTL_EXTERNAL_CODE( Function, Access, Modify ) ( \
  948. ((Access) << CLUSCTL_ACCESS_SHIFT) | \
  949. ((CLCTL_CLUSTER_BASE + Function) << CLUSCTL_FUNCTION_SHIFT) | \
  950. ((Modify) << CLCTL_MODIFY_SHIFT) )
  951. #define CLCTL_INTERNAL_CODE( Function, Access, Modify ) ( \
  952. ((Access) << CLUSCTL_ACCESS_SHIFT) | \
  953. CLCTL_INTERNAL_MASK | \
  954. ((CLCTL_CLUSTER_BASE + Function) << CLUSCTL_FUNCTION_SHIFT) | \
  955. ((Modify) << CLCTL_MODIFY_SHIFT) )
  956. #ifndef _CLUSTER_API_TYPES_
  957. typedef enum CLCTL_CODES {
  958. //
  959. // External control codes
  960. //
  961. CLCTL_UNKNOWN = CLCTL_EXTERNAL_CODE( 0, CLUS_ACCESS_ANY, CLUS_NO_MODIFY ),
  962. CLCTL_GET_CHARACTERISTICS = CLCTL_EXTERNAL_CODE( 1, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  963. CLCTL_GET_FLAGS = CLCTL_EXTERNAL_CODE( 2, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  964. CLCTL_GET_CLASS_INFO = CLCTL_EXTERNAL_CODE( 3, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  965. CLCTL_GET_REQUIRED_DEPENDENCIES = CLCTL_EXTERNAL_CODE( 4, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  966. CLCTL_GET_NAME = CLCTL_EXTERNAL_CODE( 10, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  967. CLCTL_GET_RESOURCE_TYPE = CLCTL_EXTERNAL_CODE( 11, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  968. CLCTL_GET_NODE = CLCTL_EXTERNAL_CODE( 12, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  969. CLCTL_GET_NETWORK = CLCTL_EXTERNAL_CODE( 13, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  970. CLCTL_GET_ID = CLCTL_EXTERNAL_CODE( 14, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  971. CLCTL_GET_FQDN = CLCTL_EXTERNAL_CODE( 15, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  972. CLCTL_ENUM_COMMON_PROPERTIES = CLCTL_EXTERNAL_CODE( 20, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  973. CLCTL_GET_RO_COMMON_PROPERTIES = CLCTL_EXTERNAL_CODE( 21, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  974. CLCTL_GET_COMMON_PROPERTIES = CLCTL_EXTERNAL_CODE( 22, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  975. CLCTL_SET_COMMON_PROPERTIES = CLCTL_EXTERNAL_CODE( 23, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  976. CLCTL_VALIDATE_COMMON_PROPERTIES = CLCTL_EXTERNAL_CODE( 24, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  977. CLCTL_GET_COMMON_PROPERTY_FMTS = CLCTL_EXTERNAL_CODE( 25, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  978. CLCTL_GET_COMMON_RESOURCE_PROPERTY_FMTS = CLCTL_EXTERNAL_CODE( 26, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  979. CLCTL_ENUM_PRIVATE_PROPERTIES = CLCTL_EXTERNAL_CODE( 30, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  980. CLCTL_GET_RO_PRIVATE_PROPERTIES = CLCTL_EXTERNAL_CODE( 31, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  981. CLCTL_GET_PRIVATE_PROPERTIES = CLCTL_EXTERNAL_CODE( 32, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  982. CLCTL_SET_PRIVATE_PROPERTIES = CLCTL_EXTERNAL_CODE( 33, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  983. CLCTL_VALIDATE_PRIVATE_PROPERTIES = CLCTL_EXTERNAL_CODE( 34, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  984. CLCTL_GET_PRIVATE_PROPERTY_FMTS = CLCTL_EXTERNAL_CODE( 35, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  985. CLCTL_GET_PRIVATE_RESOURCE_PROPERTY_FMTS= CLCTL_EXTERNAL_CODE( 36, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  986. CLCTL_ADD_REGISTRY_CHECKPOINT = CLCTL_EXTERNAL_CODE( 40, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  987. CLCTL_DELETE_REGISTRY_CHECKPOINT = CLCTL_EXTERNAL_CODE( 41, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  988. CLCTL_GET_REGISTRY_CHECKPOINTS = CLCTL_EXTERNAL_CODE( 42, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  989. CLCTL_ADD_CRYPTO_CHECKPOINT = CLCTL_EXTERNAL_CODE( 43, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  990. CLCTL_DELETE_CRYPTO_CHECKPOINT = CLCTL_EXTERNAL_CODE( 44, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  991. CLCTL_GET_CRYPTO_CHECKPOINTS = CLCTL_EXTERNAL_CODE( 45, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  992. CLCTL_RESOURCE_UPGRADE_DLL = CLCTL_EXTERNAL_CODE( 46, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  993. CLCTL_GET_LOADBAL_PROCESS_LIST = CLCTL_EXTERNAL_CODE( 50, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  994. CLCTL_GET_NETWORK_NAME = CLCTL_EXTERNAL_CODE( 90, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  995. CLCTL_STORAGE_GET_DISK_INFO = CLCTL_EXTERNAL_CODE( 100, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  996. CLCTL_STORAGE_GET_AVAILABLE_DISKS = CLCTL_EXTERNAL_CODE( 101, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  997. CLCTL_STORAGE_IS_PATH_VALID = CLCTL_EXTERNAL_CODE( 102, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  998. CLCTL_STORAGE_GET_ALL_AVAILABLE_DISKS = (CLCTL_EXTERNAL_CODE( 103, CLUS_ACCESS_READ, CLUS_NO_MODIFY ) | CLCTL_GLOBAL_MASK),
  999. CLCTL_QUERY_DELETE = CLCTL_EXTERNAL_CODE( 110, CLUS_ACCESS_READ, CLUS_NO_MODIFY ),
  1000. //
  1001. // Internal control codes
  1002. //
  1003. CLCTL_DELETE = CLCTL_INTERNAL_CODE( 1, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1004. CLCTL_INSTALL_NODE = CLCTL_INTERNAL_CODE( 2, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1005. CLCTL_EVICT_NODE = CLCTL_INTERNAL_CODE( 3, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1006. CLCTL_ADD_DEPENDENCY = CLCTL_INTERNAL_CODE( 4, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1007. CLCTL_REMOVE_DEPENDENCY = CLCTL_INTERNAL_CODE( 5, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1008. CLCTL_ADD_OWNER = CLCTL_INTERNAL_CODE( 6, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1009. CLCTL_REMOVE_OWNER = CLCTL_INTERNAL_CODE( 7, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1010. //************ Hole here at 8
  1011. CLCTL_SET_NAME = CLCTL_INTERNAL_CODE( 9, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1012. CLCTL_CLUSTER_NAME_CHANGED = CLCTL_INTERNAL_CODE( 10, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1013. CLCTL_CLUSTER_VERSION_CHANGED = CLCTL_INTERNAL_CODE( 11, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1014. CLCTL_FIXUP_ON_UPGRADE = CLCTL_INTERNAL_CODE( 12, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1015. CLCTL_STARTING_PHASE1 = CLCTL_INTERNAL_CODE( 13, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1016. CLCTL_STARTING_PHASE2 = CLCTL_INTERNAL_CODE( 14, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1017. CLCTL_HOLD_IO = CLCTL_INTERNAL_CODE( 15, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1018. CLCTL_RESUME_IO = CLCTL_INTERNAL_CODE( 16, CLUS_ACCESS_WRITE, CLUS_MODIFY ),
  1019. CLCTL_FORCE_QUORUM = CLCTL_INTERNAL_CODE( 17, CLUS_ACCESS_WRITE, CLUS_MODIFY )
  1020. } CLCTL_CODES;
  1021. #endif // _CLUSTER_API_TYPES_
  1022. //
  1023. // Define macros to generate object specific control codes
  1024. //
  1025. #define CLUSCTL_RESOURCE_CODE( Function ) ( \
  1026. ((CLUS_OBJECT_RESOURCE << CLUSCTL_OBJECT_SHIFT) | Function) )
  1027. #define CLUSCTL_RESOURCE_TYPE_CODE( Function ) ( \
  1028. ((CLUS_OBJECT_RESOURCE_TYPE << CLUSCTL_OBJECT_SHIFT) | Function) )
  1029. #define CLUSCTL_GROUP_CODE( Function ) ( \
  1030. ((CLUS_OBJECT_GROUP << CLUSCTL_OBJECT_SHIFT) | Function) )
  1031. #define CLUSCTL_NODE_CODE( Function ) ( \
  1032. ((CLUS_OBJECT_NODE << CLUSCTL_OBJECT_SHIFT) | Function) )
  1033. #define CLUSCTL_NETWORK_CODE( Function ) ( \
  1034. ((CLUS_OBJECT_NETWORK << CLUSCTL_OBJECT_SHIFT) | Function) )
  1035. #define CLUSCTL_NETINTERFACE_CODE( Function ) ( \
  1036. ((CLUS_OBJECT_NETINTERFACE << CLUSCTL_OBJECT_SHIFT) | Function) )
  1037. #define CLUSCTL_CLUSTER_CODE( Function ) ( \
  1038. ((CLUS_OBJECT_CLUSTER << CLUSCTL_OBJECT_SHIFT) | Function) )
  1039. #define CLUSCTL_USER_CODE( Function, Object ) ( \
  1040. ((Object) << CLUSCTL_OBJECT_SHIFT) | ((CLCTL_USER_BASE + Function) << CLUSCTL_FUNCTION_SHIFT) )
  1041. //
  1042. // Define macros to get the function or access mode out of a control code
  1043. //
  1044. #define CLUSCTL_GET_CONTROL_FUNCTION( ControlCode ) \
  1045. ((ControlCode >> CLUSCTL_ACCESS_SHIFT) & CLUSCTL_CONTROL_CODE_MASK)
  1046. #define CLUSCTL_GET_ACCESS_MODE( ControlCode ) \
  1047. ((ControlCode >> CLUSCTL_ACCESS_SHIFT) & CLUSCTL_ACCESS_MODE_MASK)
  1048. #define CLUSCTL_GET_CONTROL_OBJECT( ControlCode ) \
  1049. ((ControlCode >> CLUSCTL_OBJECT_SHIFT) & CLUSCTL_OBJECT_MASK)
  1050. #ifndef _CLUSTER_API_TYPES_
  1051. //
  1052. // Cluster Control Codes for Resources
  1053. //
  1054. typedef enum CLUSCTL_RESOURCE_CODES {
  1055. // External
  1056. CLUSCTL_RESOURCE_UNKNOWN =
  1057. CLUSCTL_RESOURCE_CODE( CLCTL_UNKNOWN ),
  1058. CLUSCTL_RESOURCE_GET_CHARACTERISTICS =
  1059. CLUSCTL_RESOURCE_CODE( CLCTL_GET_CHARACTERISTICS ),
  1060. CLUSCTL_RESOURCE_GET_FLAGS =
  1061. CLUSCTL_RESOURCE_CODE( CLCTL_GET_FLAGS ),
  1062. CLUSCTL_RESOURCE_GET_CLASS_INFO =
  1063. CLUSCTL_RESOURCE_CODE( CLCTL_GET_CLASS_INFO ),
  1064. CLUSCTL_RESOURCE_GET_REQUIRED_DEPENDENCIES =
  1065. CLUSCTL_RESOURCE_CODE( CLCTL_GET_REQUIRED_DEPENDENCIES ),
  1066. CLUSCTL_RESOURCE_GET_NAME =
  1067. CLUSCTL_RESOURCE_CODE( CLCTL_GET_NAME ),
  1068. CLUSCTL_RESOURCE_GET_ID =
  1069. CLUSCTL_RESOURCE_CODE( CLCTL_GET_ID ),
  1070. CLUSCTL_RESOURCE_GET_RESOURCE_TYPE =
  1071. CLUSCTL_RESOURCE_CODE( CLCTL_GET_RESOURCE_TYPE ),
  1072. CLUSCTL_RESOURCE_ENUM_COMMON_PROPERTIES =
  1073. CLUSCTL_RESOURCE_CODE( CLCTL_ENUM_COMMON_PROPERTIES ),
  1074. CLUSCTL_RESOURCE_GET_RO_COMMON_PROPERTIES =
  1075. CLUSCTL_RESOURCE_CODE( CLCTL_GET_RO_COMMON_PROPERTIES ),
  1076. CLUSCTL_RESOURCE_GET_COMMON_PROPERTIES =
  1077. CLUSCTL_RESOURCE_CODE( CLCTL_GET_COMMON_PROPERTIES ),
  1078. CLUSCTL_RESOURCE_SET_COMMON_PROPERTIES =
  1079. CLUSCTL_RESOURCE_CODE( CLCTL_SET_COMMON_PROPERTIES ),
  1080. CLUSCTL_RESOURCE_VALIDATE_COMMON_PROPERTIES =
  1081. CLUSCTL_RESOURCE_CODE( CLCTL_VALIDATE_COMMON_PROPERTIES ),
  1082. CLUSCTL_RESOURCE_GET_COMMON_PROPERTY_FMTS =
  1083. CLUSCTL_RESOURCE_CODE( CLCTL_GET_COMMON_PROPERTY_FMTS ),
  1084. CLUSCTL_RESOURCE_ENUM_PRIVATE_PROPERTIES =
  1085. CLUSCTL_RESOURCE_CODE( CLCTL_ENUM_PRIVATE_PROPERTIES ),
  1086. CLUSCTL_RESOURCE_GET_RO_PRIVATE_PROPERTIES =
  1087. CLUSCTL_RESOURCE_CODE( CLCTL_GET_RO_PRIVATE_PROPERTIES ),
  1088. CLUSCTL_RESOURCE_GET_PRIVATE_PROPERTIES =
  1089. CLUSCTL_RESOURCE_CODE( CLCTL_GET_PRIVATE_PROPERTIES ),
  1090. CLUSCTL_RESOURCE_SET_PRIVATE_PROPERTIES =
  1091. CLUSCTL_RESOURCE_CODE( CLCTL_SET_PRIVATE_PROPERTIES ),
  1092. CLUSCTL_RESOURCE_VALIDATE_PRIVATE_PROPERTIES =
  1093. CLUSCTL_RESOURCE_CODE( CLCTL_VALIDATE_PRIVATE_PROPERTIES ),
  1094. CLUSCTL_RESOURCE_GET_PRIVATE_PROPERTY_FMTS =
  1095. CLUSCTL_RESOURCE_CODE( CLCTL_GET_PRIVATE_PROPERTY_FMTS ),
  1096. CLUSCTL_RESOURCE_ADD_REGISTRY_CHECKPOINT =
  1097. CLUSCTL_RESOURCE_CODE( CLCTL_ADD_REGISTRY_CHECKPOINT ),
  1098. CLUSCTL_RESOURCE_DELETE_REGISTRY_CHECKPOINT =
  1099. CLUSCTL_RESOURCE_CODE( CLCTL_DELETE_REGISTRY_CHECKPOINT ),
  1100. CLUSCTL_RESOURCE_GET_REGISTRY_CHECKPOINTS =
  1101. CLUSCTL_RESOURCE_CODE( CLCTL_GET_REGISTRY_CHECKPOINTS ),
  1102. CLUSCTL_RESOURCE_ADD_CRYPTO_CHECKPOINT =
  1103. CLUSCTL_RESOURCE_CODE( CLCTL_ADD_CRYPTO_CHECKPOINT ),
  1104. CLUSCTL_RESOURCE_DELETE_CRYPTO_CHECKPOINT =
  1105. CLUSCTL_RESOURCE_CODE( CLCTL_DELETE_CRYPTO_CHECKPOINT ),
  1106. CLUSCTL_RESOURCE_GET_CRYPTO_CHECKPOINTS =
  1107. CLUSCTL_RESOURCE_CODE( CLCTL_GET_CRYPTO_CHECKPOINTS ),
  1108. CLUSCTL_RESOURCE_GET_LOADBAL_PROCESS_LIST =
  1109. CLUSCTL_RESOURCE_CODE( CLCTL_GET_LOADBAL_PROCESS_LIST ),
  1110. CLUSCTL_RESOURCE_GET_NETWORK_NAME =
  1111. CLUSCTL_RESOURCE_CODE( CLCTL_GET_NETWORK_NAME ),
  1112. CLUSCTL_RESOURCE_STORAGE_GET_DISK_INFO =
  1113. CLUSCTL_RESOURCE_CODE( CLCTL_STORAGE_GET_DISK_INFO ),
  1114. CLUSCTL_RESOURCE_STORAGE_IS_PATH_VALID =
  1115. CLUSCTL_RESOURCE_CODE( CLCTL_STORAGE_IS_PATH_VALID ),
  1116. CLUSCTL_RESOURCE_QUERY_DELETE =
  1117. CLUSCTL_RESOURCE_CODE( CLCTL_QUERY_DELETE ),
  1118. CLUSCTL_RESOURCE_UPGRADE_DLL =
  1119. CLUSCTL_RESOURCE_CODE( CLCTL_RESOURCE_UPGRADE_DLL ),
  1120. // Internal
  1121. CLUSCTL_RESOURCE_DELETE =
  1122. CLUSCTL_RESOURCE_CODE( CLCTL_DELETE ),
  1123. CLUSCTL_RESOURCE_INSTALL_NODE =
  1124. CLUSCTL_RESOURCE_CODE( CLCTL_INSTALL_NODE ),
  1125. CLUSCTL_RESOURCE_EVICT_NODE =
  1126. CLUSCTL_RESOURCE_CODE( CLCTL_EVICT_NODE ),
  1127. CLUSCTL_RESOURCE_ADD_DEPENDENCY =
  1128. CLUSCTL_RESOURCE_CODE( CLCTL_ADD_DEPENDENCY ),
  1129. CLUSCTL_RESOURCE_REMOVE_DEPENDENCY =
  1130. CLUSCTL_RESOURCE_CODE( CLCTL_REMOVE_DEPENDENCY ),
  1131. CLUSCTL_RESOURCE_ADD_OWNER =
  1132. CLUSCTL_RESOURCE_CODE( CLCTL_ADD_OWNER ),
  1133. CLUSCTL_RESOURCE_REMOVE_OWNER =
  1134. CLUSCTL_RESOURCE_CODE( CLCTL_REMOVE_OWNER ),
  1135. CLUSCTL_RESOURCE_SET_NAME =
  1136. CLUSCTL_RESOURCE_CODE( CLCTL_SET_NAME ),
  1137. CLUSCTL_RESOURCE_CLUSTER_NAME_CHANGED =
  1138. CLUSCTL_RESOURCE_CODE( CLCTL_CLUSTER_NAME_CHANGED ),
  1139. CLUSCTL_RESOURCE_CLUSTER_VERSION_CHANGED =
  1140. CLUSCTL_RESOURCE_CODE( CLCTL_CLUSTER_VERSION_CHANGED ),
  1141. CLUSCTL_RESOURCE_FORCE_QUORUM =
  1142. CLUSCTL_RESOURCE_CODE( CLCTL_FORCE_QUORUM )
  1143. } CLUSCTL_RESOURCE_CODES;
  1144. //
  1145. // Cluster Control Codes for Resource Types
  1146. //
  1147. typedef enum CLUSCTL_RESOURCE_TYPE_CODES {
  1148. // External
  1149. CLUSCTL_RESOURCE_TYPE_UNKNOWN =
  1150. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_UNKNOWN ),
  1151. CLUSCTL_RESOURCE_TYPE_GET_CHARACTERISTICS =
  1152. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_CHARACTERISTICS ),
  1153. CLUSCTL_RESOURCE_TYPE_GET_FLAGS =
  1154. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_FLAGS ),
  1155. CLUSCTL_RESOURCE_TYPE_GET_CLASS_INFO =
  1156. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_CLASS_INFO ),
  1157. CLUSCTL_RESOURCE_TYPE_GET_REQUIRED_DEPENDENCIES =
  1158. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_REQUIRED_DEPENDENCIES ),
  1159. CLUSCTL_RESOURCE_TYPE_ENUM_COMMON_PROPERTIES =
  1160. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_ENUM_COMMON_PROPERTIES ),
  1161. CLUSCTL_RESOURCE_TYPE_GET_RO_COMMON_PROPERTIES =
  1162. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_RO_COMMON_PROPERTIES ),
  1163. CLUSCTL_RESOURCE_TYPE_GET_COMMON_PROPERTIES =
  1164. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_COMMON_PROPERTIES ),
  1165. CLUSCTL_RESOURCE_TYPE_VALIDATE_COMMON_PROPERTIES =
  1166. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_VALIDATE_COMMON_PROPERTIES ),
  1167. CLUSCTL_RESOURCE_TYPE_SET_COMMON_PROPERTIES =
  1168. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_SET_COMMON_PROPERTIES ),
  1169. CLUSCTL_RESOURCE_TYPE_GET_COMMON_PROPERTY_FMTS =
  1170. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_COMMON_PROPERTY_FMTS ),
  1171. CLUSCTL_RESOURCE_TYPE_GET_COMMON_RESOURCE_PROPERTY_FMTS =
  1172. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_COMMON_RESOURCE_PROPERTY_FMTS ),
  1173. CLUSCTL_RESOURCE_TYPE_ENUM_PRIVATE_PROPERTIES =
  1174. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_ENUM_PRIVATE_PROPERTIES ),
  1175. CLUSCTL_RESOURCE_TYPE_GET_RO_PRIVATE_PROPERTIES =
  1176. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_RO_PRIVATE_PROPERTIES ),
  1177. CLUSCTL_RESOURCE_TYPE_GET_PRIVATE_PROPERTIES =
  1178. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_PRIVATE_PROPERTIES ),
  1179. CLUSCTL_RESOURCE_TYPE_SET_PRIVATE_PROPERTIES =
  1180. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_SET_PRIVATE_PROPERTIES ),
  1181. CLUSCTL_RESOURCE_TYPE_VALIDATE_PRIVATE_PROPERTIES =
  1182. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_VALIDATE_PRIVATE_PROPERTIES ),
  1183. CLUSCTL_RESOURCE_TYPE_GET_PRIVATE_PROPERTY_FMTS =
  1184. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_PRIVATE_PROPERTY_FMTS ),
  1185. CLUSCTL_RESOURCE_TYPE_GET_PRIVATE_RESOURCE_PROPERTY_FMTS =
  1186. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_PRIVATE_RESOURCE_PROPERTY_FMTS ),
  1187. CLUSCTL_RESOURCE_TYPE_GET_REGISTRY_CHECKPOINTS =
  1188. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_REGISTRY_CHECKPOINTS ),
  1189. CLUSCTL_RESOURCE_TYPE_GET_CRYPTO_CHECKPOINTS =
  1190. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_GET_CRYPTO_CHECKPOINTS ),
  1191. CLUSCTL_RESOURCE_TYPE_STORAGE_GET_AVAILABLE_DISKS =
  1192. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_STORAGE_GET_AVAILABLE_DISKS ),
  1193. CLUSCTL_RESOURCE_TYPE_QUERY_DELETE =
  1194. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_QUERY_DELETE ),
  1195. // Internal
  1196. CLUSCTL_RESOURCE_TYPE_INSTALL_NODE =
  1197. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_INSTALL_NODE ),
  1198. CLUSCTL_RESOURCE_TYPE_EVICT_NODE =
  1199. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_EVICT_NODE ),
  1200. CLUSCTL_RESOURCE_TYPE_CLUSTER_VERSION_CHANGED =
  1201. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_CLUSTER_VERSION_CHANGED ),
  1202. CLUSCTL_RESOURCE_TYPE_FIXUP_ON_UPGRADE =
  1203. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_FIXUP_ON_UPGRADE ),
  1204. CLUSCTL_RESOURCE_TYPE_STARTING_PHASE1 =
  1205. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_STARTING_PHASE1 ),
  1206. CLUSCTL_RESOURCE_TYPE_STARTING_PHASE2 =
  1207. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_STARTING_PHASE2 ),
  1208. CLUSCTL_RESOURCE_TYPE_HOLD_IO =
  1209. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_HOLD_IO ),
  1210. CLUSCTL_RESOURCE_TYPE_RESUME_IO =
  1211. CLUSCTL_RESOURCE_TYPE_CODE( CLCTL_RESUME_IO )
  1212. } CLUSCTL_RESOURCE_TYPE_CODES;
  1213. //
  1214. // Cluster Control Codes for Groups
  1215. //
  1216. typedef enum CLUSCTL_GROUP_CODES {
  1217. // External
  1218. CLUSCTL_GROUP_UNKNOWN =
  1219. CLUSCTL_GROUP_CODE( CLCTL_UNKNOWN ),
  1220. CLUSCTL_GROUP_GET_CHARACTERISTICS =
  1221. CLUSCTL_GROUP_CODE( CLCTL_GET_CHARACTERISTICS ),
  1222. CLUSCTL_GROUP_GET_FLAGS =
  1223. CLUSCTL_GROUP_CODE( CLCTL_GET_FLAGS ),
  1224. CLUSCTL_GROUP_GET_NAME =
  1225. CLUSCTL_GROUP_CODE( CLCTL_GET_NAME ),
  1226. CLUSCTL_GROUP_GET_ID =
  1227. CLUSCTL_GROUP_CODE( CLCTL_GET_ID ),
  1228. CLUSCTL_GROUP_ENUM_COMMON_PROPERTIES =
  1229. CLUSCTL_GROUP_CODE( CLCTL_ENUM_COMMON_PROPERTIES ),
  1230. CLUSCTL_GROUP_GET_RO_COMMON_PROPERTIES =
  1231. CLUSCTL_GROUP_CODE( CLCTL_GET_RO_COMMON_PROPERTIES ),
  1232. CLUSCTL_GROUP_GET_COMMON_PROPERTIES =
  1233. CLUSCTL_GROUP_CODE( CLCTL_GET_COMMON_PROPERTIES ),
  1234. CLUSCTL_GROUP_SET_COMMON_PROPERTIES =
  1235. CLUSCTL_GROUP_CODE( CLCTL_SET_COMMON_PROPERTIES ),
  1236. CLUSCTL_GROUP_VALIDATE_COMMON_PROPERTIES =
  1237. CLUSCTL_GROUP_CODE( CLCTL_VALIDATE_COMMON_PROPERTIES ),
  1238. CLUSCTL_GROUP_ENUM_PRIVATE_PROPERTIES =
  1239. CLUSCTL_GROUP_CODE( CLCTL_ENUM_PRIVATE_PROPERTIES ),
  1240. CLUSCTL_GROUP_GET_RO_PRIVATE_PROPERTIES =
  1241. CLUSCTL_GROUP_CODE( CLCTL_GET_RO_PRIVATE_PROPERTIES ),
  1242. CLUSCTL_GROUP_GET_PRIVATE_PROPERTIES =
  1243. CLUSCTL_GROUP_CODE( CLCTL_GET_PRIVATE_PROPERTIES ),
  1244. CLUSCTL_GROUP_SET_PRIVATE_PROPERTIES =
  1245. CLUSCTL_GROUP_CODE( CLCTL_SET_PRIVATE_PROPERTIES ),
  1246. CLUSCTL_GROUP_VALIDATE_PRIVATE_PROPERTIES =
  1247. CLUSCTL_GROUP_CODE( CLCTL_VALIDATE_PRIVATE_PROPERTIES ),
  1248. CLUSCTL_GROUP_QUERY_DELETE =
  1249. CLUSCTL_GROUP_CODE( CLCTL_QUERY_DELETE ),
  1250. CLUSCTL_GROUP_GET_COMMON_PROPERTY_FMTS=
  1251. CLUSCTL_GROUP_CODE( CLCTL_GET_COMMON_PROPERTY_FMTS ),
  1252. CLUSCTL_GROUP_GET_PRIVATE_PROPERTY_FMTS=
  1253. CLUSCTL_GROUP_CODE( CLCTL_GET_PRIVATE_PROPERTY_FMTS )
  1254. // Internal
  1255. } CLUSCTL_GROUP_CODES;
  1256. //
  1257. // Cluster Control Codes for Nodes
  1258. //
  1259. typedef enum CLUSCTL_NODE_CODES {
  1260. // External
  1261. CLUSCTL_NODE_UNKNOWN =
  1262. CLUSCTL_NODE_CODE( CLCTL_UNKNOWN ),
  1263. CLUSCTL_NODE_GET_CHARACTERISTICS =
  1264. CLUSCTL_NODE_CODE( CLCTL_GET_CHARACTERISTICS ),
  1265. CLUSCTL_NODE_GET_FLAGS =
  1266. CLUSCTL_NODE_CODE( CLCTL_GET_FLAGS ),
  1267. CLUSCTL_NODE_GET_NAME =
  1268. CLUSCTL_NODE_CODE( CLCTL_GET_NAME ),
  1269. CLUSCTL_NODE_GET_ID =
  1270. CLUSCTL_NODE_CODE( CLCTL_GET_ID ),
  1271. CLUSCTL_NODE_ENUM_COMMON_PROPERTIES =
  1272. CLUSCTL_NODE_CODE( CLCTL_ENUM_COMMON_PROPERTIES ),
  1273. CLUSCTL_NODE_GET_RO_COMMON_PROPERTIES =
  1274. CLUSCTL_NODE_CODE( CLCTL_GET_RO_COMMON_PROPERTIES ),
  1275. CLUSCTL_NODE_GET_COMMON_PROPERTIES =
  1276. CLUSCTL_NODE_CODE( CLCTL_GET_COMMON_PROPERTIES ),
  1277. CLUSCTL_NODE_SET_COMMON_PROPERTIES =
  1278. CLUSCTL_NODE_CODE( CLCTL_SET_COMMON_PROPERTIES ),
  1279. CLUSCTL_NODE_VALIDATE_COMMON_PROPERTIES =
  1280. CLUSCTL_NODE_CODE( CLCTL_VALIDATE_COMMON_PROPERTIES ),
  1281. CLUSCTL_NODE_ENUM_PRIVATE_PROPERTIES =
  1282. CLUSCTL_NODE_CODE( CLCTL_ENUM_PRIVATE_PROPERTIES ),
  1283. CLUSCTL_NODE_GET_RO_PRIVATE_PROPERTIES =
  1284. CLUSCTL_NODE_CODE( CLCTL_GET_RO_PRIVATE_PROPERTIES ),
  1285. CLUSCTL_NODE_GET_PRIVATE_PROPERTIES =
  1286. CLUSCTL_NODE_CODE( CLCTL_GET_PRIVATE_PROPERTIES ),
  1287. CLUSCTL_NODE_SET_PRIVATE_PROPERTIES =
  1288. CLUSCTL_NODE_CODE( CLCTL_SET_PRIVATE_PROPERTIES ),
  1289. CLUSCTL_NODE_VALIDATE_PRIVATE_PROPERTIES =
  1290. CLUSCTL_NODE_CODE( CLCTL_VALIDATE_PRIVATE_PROPERTIES ),
  1291. CLUSCTL_NODE_GET_COMMON_PROPERTY_FMTS=
  1292. CLUSCTL_NODE_CODE( CLCTL_GET_COMMON_PROPERTY_FMTS ),
  1293. CLUSCTL_NODE_GET_PRIVATE_PROPERTY_FMTS=
  1294. CLUSCTL_NODE_CODE( CLCTL_GET_PRIVATE_PROPERTY_FMTS )
  1295. } CLUSCTL_NODE_CODES;
  1296. //
  1297. // Cluster Control Codes for Networks
  1298. //
  1299. typedef enum CLUSCTL_NETWORK_CODES {
  1300. // External
  1301. CLUSCTL_NETWORK_UNKNOWN =
  1302. CLUSCTL_NETWORK_CODE( CLCTL_UNKNOWN ),
  1303. CLUSCTL_NETWORK_GET_CHARACTERISTICS =
  1304. CLUSCTL_NETWORK_CODE( CLCTL_GET_CHARACTERISTICS ),
  1305. CLUSCTL_NETWORK_GET_FLAGS =
  1306. CLUSCTL_NETWORK_CODE( CLCTL_GET_FLAGS ),
  1307. CLUSCTL_NETWORK_GET_NAME =
  1308. CLUSCTL_NETWORK_CODE( CLCTL_GET_NAME ),
  1309. CLUSCTL_NETWORK_GET_ID =
  1310. CLUSCTL_NETWORK_CODE( CLCTL_GET_ID ),
  1311. CLUSCTL_NETWORK_ENUM_COMMON_PROPERTIES =
  1312. CLUSCTL_NETWORK_CODE( CLCTL_ENUM_COMMON_PROPERTIES ),
  1313. CLUSCTL_NETWORK_GET_RO_COMMON_PROPERTIES =
  1314. CLUSCTL_NETWORK_CODE( CLCTL_GET_RO_COMMON_PROPERTIES ),
  1315. CLUSCTL_NETWORK_GET_COMMON_PROPERTIES =
  1316. CLUSCTL_NETWORK_CODE( CLCTL_GET_COMMON_PROPERTIES ),
  1317. CLUSCTL_NETWORK_SET_COMMON_PROPERTIES =
  1318. CLUSCTL_NETWORK_CODE( CLCTL_SET_COMMON_PROPERTIES ),
  1319. CLUSCTL_NETWORK_VALIDATE_COMMON_PROPERTIES =
  1320. CLUSCTL_NETWORK_CODE( CLCTL_VALIDATE_COMMON_PROPERTIES ),
  1321. CLUSCTL_NETWORK_ENUM_PRIVATE_PROPERTIES =
  1322. CLUSCTL_NETWORK_CODE( CLCTL_ENUM_PRIVATE_PROPERTIES ),
  1323. CLUSCTL_NETWORK_GET_RO_PRIVATE_PROPERTIES =
  1324. CLUSCTL_NETWORK_CODE( CLCTL_GET_RO_PRIVATE_PROPERTIES ),
  1325. CLUSCTL_NETWORK_GET_PRIVATE_PROPERTIES =
  1326. CLUSCTL_NETWORK_CODE( CLCTL_GET_PRIVATE_PROPERTIES ),
  1327. CLUSCTL_NETWORK_SET_PRIVATE_PROPERTIES =
  1328. CLUSCTL_NETWORK_CODE( CLCTL_SET_PRIVATE_PROPERTIES ),
  1329. CLUSCTL_NETWORK_VALIDATE_PRIVATE_PROPERTIES =
  1330. CLUSCTL_NETWORK_CODE( CLCTL_VALIDATE_PRIVATE_PROPERTIES ),
  1331. CLUSCTL_NETWORK_GET_COMMON_PROPERTY_FMTS=
  1332. CLUSCTL_NETWORK_CODE( CLCTL_GET_COMMON_PROPERTY_FMTS ),
  1333. CLUSCTL_NETWORK_GET_PRIVATE_PROPERTY_FMTS=
  1334. CLUSCTL_NETWORK_CODE( CLCTL_GET_PRIVATE_PROPERTY_FMTS )
  1335. } CLUSCTL_NETWORK_CODES;
  1336. //
  1337. // Cluster Control Codes for Network Interfaces
  1338. //
  1339. typedef enum CLUSCTL_NETINTERFACE_CODES {
  1340. // External
  1341. CLUSCTL_NETINTERFACE_UNKNOWN =
  1342. CLUSCTL_NETINTERFACE_CODE( CLCTL_UNKNOWN ),
  1343. CLUSCTL_NETINTERFACE_GET_CHARACTERISTICS =
  1344. CLUSCTL_NETINTERFACE_CODE( CLCTL_GET_CHARACTERISTICS ),
  1345. CLUSCTL_NETINTERFACE_GET_FLAGS =
  1346. CLUSCTL_NETINTERFACE_CODE( CLCTL_GET_FLAGS ),
  1347. CLUSCTL_NETINTERFACE_GET_NAME =
  1348. CLUSCTL_NETINTERFACE_CODE( CLCTL_GET_NAME ),
  1349. CLUSCTL_NETINTERFACE_GET_ID =
  1350. CLUSCTL_NETINTERFACE_CODE( CLCTL_GET_ID ),
  1351. CLUSCTL_NETINTERFACE_GET_NODE =
  1352. CLUSCTL_NETINTERFACE_CODE( CLCTL_GET_NODE ),
  1353. CLUSCTL_NETINTERFACE_GET_NETWORK =
  1354. CLUSCTL_NETINTERFACE_CODE( CLCTL_GET_NETWORK ),
  1355. CLUSCTL_NETINTERFACE_ENUM_COMMON_PROPERTIES =
  1356. CLUSCTL_NETINTERFACE_CODE( CLCTL_ENUM_COMMON_PROPERTIES ),
  1357. CLUSCTL_NETINTERFACE_GET_RO_COMMON_PROPERTIES =
  1358. CLUSCTL_NETINTERFACE_CODE( CLCTL_GET_RO_COMMON_PROPERTIES ),
  1359. CLUSCTL_NETINTERFACE_GET_COMMON_PROPERTIES =
  1360. CLUSCTL_NETINTERFACE_CODE( CLCTL_GET_COMMON_PROPERTIES ),
  1361. CLUSCTL_NETINTERFACE_SET_COMMON_PROPERTIES =
  1362. CLUSCTL_NETINTERFACE_CODE( CLCTL_SET_COMMON_PROPERTIES ),
  1363. CLUSCTL_NETINTERFACE_VALIDATE_COMMON_PROPERTIES =
  1364. CLUSCTL_NETINTERFACE_CODE( CLCTL_VALIDATE_COMMON_PROPERTIES ),
  1365. CLUSCTL_NETINTERFACE_ENUM_PRIVATE_PROPERTIES =
  1366. CLUSCTL_NETINTERFACE_CODE( CLCTL_ENUM_PRIVATE_PROPERTIES ),
  1367. CLUSCTL_NETINTERFACE_GET_RO_PRIVATE_PROPERTIES =
  1368. CLUSCTL_NETINTERFACE_CODE( CLCTL_GET_RO_PRIVATE_PROPERTIES ),
  1369. CLUSCTL_NETINTERFACE_GET_PRIVATE_PROPERTIES =
  1370. CLUSCTL_NETINTERFACE_CODE( CLCTL_GET_PRIVATE_PROPERTIES ),
  1371. CLUSCTL_NETINTERFACE_SET_PRIVATE_PROPERTIES =
  1372. CLUSCTL_NETINTERFACE_CODE( CLCTL_SET_PRIVATE_PROPERTIES ),
  1373. CLUSCTL_NETINTERFACE_VALIDATE_PRIVATE_PROPERTIES =
  1374. CLUSCTL_NETINTERFACE_CODE( CLCTL_VALIDATE_PRIVATE_PROPERTIES ),
  1375. CLUSCTL_NETINTERFACE_GET_COMMON_PROPERTY_FMTS=
  1376. CLUSCTL_NETINTERFACE_CODE( CLCTL_GET_COMMON_PROPERTY_FMTS ),
  1377. CLUSCTL_NETINTERFACE_GET_PRIVATE_PROPERTY_FMTS=
  1378. CLUSCTL_NETINTERFACE_CODE( CLCTL_GET_PRIVATE_PROPERTY_FMTS )
  1379. } CLUSCTL_NETINTERFACE_CODES;
  1380. //
  1381. // Cluster Control Codes for Nodes
  1382. //
  1383. typedef enum CLUSCTL_CLUSTER_CODES {
  1384. // External
  1385. CLUSCTL_CLUSTER_UNKNOWN =
  1386. CLUSCTL_CLUSTER_CODE( CLCTL_UNKNOWN ),
  1387. CLUSCTL_CLUSTER_GET_FQDN =
  1388. CLUSCTL_CLUSTER_CODE( CLCTL_GET_FQDN ),
  1389. CLUSCTL_CLUSTER_ENUM_COMMON_PROPERTIES =
  1390. CLUSCTL_CLUSTER_CODE( CLCTL_ENUM_COMMON_PROPERTIES ),
  1391. CLUSCTL_CLUSTER_GET_RO_COMMON_PROPERTIES =
  1392. CLUSCTL_CLUSTER_CODE( CLCTL_GET_RO_COMMON_PROPERTIES ),
  1393. CLUSCTL_CLUSTER_GET_COMMON_PROPERTIES =
  1394. CLUSCTL_CLUSTER_CODE( CLCTL_GET_COMMON_PROPERTIES ),
  1395. CLUSCTL_CLUSTER_SET_COMMON_PROPERTIES =
  1396. CLUSCTL_CLUSTER_CODE( CLCTL_SET_COMMON_PROPERTIES ),
  1397. CLUSCTL_CLUSTER_VALIDATE_COMMON_PROPERTIES =
  1398. CLUSCTL_CLUSTER_CODE( CLCTL_VALIDATE_COMMON_PROPERTIES ),
  1399. CLUSCTL_CLUSTER_ENUM_PRIVATE_PROPERTIES =
  1400. CLUSCTL_CLUSTER_CODE( CLCTL_ENUM_PRIVATE_PROPERTIES ),
  1401. CLUSCTL_CLUSTER_GET_RO_PRIVATE_PROPERTIES =
  1402. CLUSCTL_CLUSTER_CODE( CLCTL_GET_RO_PRIVATE_PROPERTIES ),
  1403. CLUSCTL_CLUSTER_GET_PRIVATE_PROPERTIES =
  1404. CLUSCTL_CLUSTER_CODE( CLCTL_GET_PRIVATE_PROPERTIES ),
  1405. CLUSCTL_CLUSTER_SET_PRIVATE_PROPERTIES =
  1406. CLUSCTL_CLUSTER_CODE( CLCTL_SET_PRIVATE_PROPERTIES ),
  1407. CLUSCTL_CLUSTER_VALIDATE_PRIVATE_PROPERTIES =
  1408. CLUSCTL_CLUSTER_CODE( CLCTL_VALIDATE_PRIVATE_PROPERTIES ),
  1409. CLUSCTL_CLUSTER_GET_COMMON_PROPERTY_FMTS=
  1410. CLUSCTL_CLUSTER_CODE( CLCTL_GET_COMMON_PROPERTY_FMTS ),
  1411. CLUSCTL_CLUSTER_GET_PRIVATE_PROPERTY_FMTS=
  1412. CLUSCTL_CLUSTER_CODE( CLCTL_GET_PRIVATE_PROPERTY_FMTS )
  1413. } CLUSCTL_CLUSTER_CODES;
  1414. //
  1415. // Cluster Resource Class types
  1416. //
  1417. typedef enum CLUSTER_RESOURCE_CLASS {
  1418. CLUS_RESCLASS_UNKNOWN = 0,
  1419. CLUS_RESCLASS_STORAGE,
  1420. CLUS_RESCLASS_USER = 32768
  1421. } CLUSTER_RESOURCE_CLASS;
  1422. //
  1423. // Define Resource SubClass bits
  1424. //
  1425. typedef enum CLUS_RESSUBCLASS {
  1426. CLUS_RESSUBCLASS_SHARED = 0x80000000
  1427. } CLUS_RESSUBCLASS;
  1428. //
  1429. // Cluster Characteristics
  1430. //
  1431. typedef enum CLUS_CHARACTERISTICS {
  1432. CLUS_CHAR_UNKNOWN = 0x00000000,
  1433. CLUS_CHAR_QUORUM = 0x00000001,
  1434. CLUS_CHAR_DELETE_REQUIRES_ALL_NODES = 0x00000002,
  1435. CLUS_CHAR_LOCAL_QUORUM = 0x00000004,
  1436. CLUS_CHAR_LOCAL_QUORUM_DEBUG = 0x00000008
  1437. } CLUS_CHARACTERISTICS;
  1438. //
  1439. // Cluster Flags
  1440. //
  1441. typedef enum CLUS_FLAGS {
  1442. CLUS_FLAG_CORE = 0x00000001
  1443. } CLUS_FLAGS;
  1444. //
  1445. // Cluster Resource Property Helper Structures
  1446. //
  1447. #ifndef MIDL_PASS
  1448. // Property syntax. Used for property names and values.
  1449. typedef union CLUSPROP_SYNTAX {
  1450. DWORD dw;
  1451. struct {
  1452. WORD wFormat;
  1453. WORD wType;
  1454. };
  1455. } CLUSPROP_SYNTAX, *PCLUSPROP_SYNTAX;
  1456. // Property value.
  1457. typedef struct CLUSPROP_VALUE {
  1458. CLUSPROP_SYNTAX Syntax;
  1459. DWORD cbLength;
  1460. } CLUSPROP_VALUE, *PCLUSPROP_VALUE;
  1461. // Binary property value.
  1462. #ifdef __cplusplus
  1463. typedef struct CLUSPROP_BINARY : public CLUSPROP_VALUE {
  1464. #else
  1465. typedef struct CLUSPROP_BINARY {
  1466. CLUSPROP_VALUE;
  1467. #endif
  1468. BYTE rgb[];
  1469. } CLUSPROP_BINARY, *PCLUSPROP_BINARY;
  1470. // WORD property value.
  1471. #ifdef __cplusplus
  1472. typedef struct CLUSPROP_WORD : public CLUSPROP_VALUE {
  1473. #else
  1474. typedef struct CLUSPROP_WORD {
  1475. CLUSPROP_VALUE;
  1476. #endif
  1477. WORD w;
  1478. } CLUSPROP_WORD, *PCLUSPROP_WORD;
  1479. // DWORD property value.
  1480. #ifdef __cplusplus
  1481. typedef struct CLUSPROP_DWORD : public CLUSPROP_VALUE {
  1482. #else
  1483. typedef struct CLUSPROP_DWORD {
  1484. CLUSPROP_VALUE;
  1485. #endif
  1486. DWORD dw;
  1487. } CLUSPROP_DWORD, *PCLUSPROP_DWORD;
  1488. // LONG property value.
  1489. #ifdef __cplusplus
  1490. typedef struct CLUSPROP_LONG : public CLUSPROP_VALUE {
  1491. #else
  1492. typedef struct CLUSPROP_LONG {
  1493. CLUSPROP_VALUE;
  1494. #endif
  1495. LONG l;
  1496. } CLUSPROP_LONG, *PCLUSPROP_LONG;
  1497. // String property value.
  1498. #ifdef __cplusplus
  1499. typedef struct CLUSPROP_SZ : public CLUSPROP_VALUE {
  1500. #else
  1501. typedef struct CLUSPROP_SZ {
  1502. CLUSPROP_VALUE;
  1503. #endif
  1504. WCHAR sz[];
  1505. } CLUSPROP_SZ, *PCLUSPROP_SZ;
  1506. // Multiple string property value.
  1507. typedef CLUSPROP_SZ CLUSPROP_MULTI_SZ, *PCLUSPROP_MULTI_SZ;
  1508. // Property name.
  1509. typedef CLUSPROP_SZ CLUSPROP_PROPERTY_NAME, *PCLUSPROP_PROPERTY_NAME;
  1510. // Unsigned large Integer property value.
  1511. #ifdef __cplusplus
  1512. typedef struct CLUSPROP_ULARGE_INTEGER
  1513. : public CLUSPROP_VALUE {
  1514. #else
  1515. typedef struct CLUSPROP_ULARGE_INTEGER {
  1516. CLUSPROP_VALUE;
  1517. #endif
  1518. ULARGE_INTEGER li;
  1519. } CLUSPROP_ULARGE_INTEGER, *PCLUSPROP_ULARGE_INTEGER;
  1520. // Signed large Integer property value.
  1521. #ifdef __cplusplus
  1522. typedef struct CLUSPROP_LARGE_INTEGER
  1523. : public CLUSPROP_VALUE {
  1524. #else
  1525. typedef struct CLUSPROP_LARGE_INTEGER {
  1526. CLUSPROP_VALUE;
  1527. #endif
  1528. LARGE_INTEGER li;
  1529. } CLUSPROP_LARGE_INTEGER, *PCLUSPROP_LARGE_INTEGER;
  1530. // Security Descriptor property value.
  1531. #ifdef __cplusplus
  1532. typedef struct CLUSPROP_SECURITY_DESCRIPTOR : public CLUSPROP_VALUE {
  1533. #else
  1534. typedef struct CLUSPROP_SECURITY_DESCRIPTOR {
  1535. CLUSPROP_VALUE;
  1536. #endif
  1537. union {
  1538. SECURITY_DESCRIPTOR_RELATIVE sd;
  1539. BYTE rgbSecurityDescriptor[];
  1540. };
  1541. } CLUSPROP_SECURITY_DESCRIPTOR, *PCLUSPROP_SECURITY_DESCRIPTOR;
  1542. // Resource class info returned by CLCTL_GET_CLASS_INFO control functions.
  1543. typedef struct CLUS_RESOURCE_CLASS_INFO {
  1544. union {
  1545. struct {
  1546. union {
  1547. DWORD dw;
  1548. CLUSTER_RESOURCE_CLASS rc;
  1549. };
  1550. DWORD SubClass;
  1551. };
  1552. ULARGE_INTEGER li;
  1553. };
  1554. } CLUS_RESOURCE_CLASS_INFO, *PCLUS_RESOURCE_CLASS_INFO;
  1555. // Resource class property value.
  1556. #ifdef __cplusplus
  1557. typedef struct CLUSPROP_RESOURCE_CLASS
  1558. : public CLUSPROP_VALUE {
  1559. #else
  1560. typedef struct CLUSPROP_RESOURCE_CLASS {
  1561. CLUSPROP_VALUE;
  1562. #endif
  1563. CLUSTER_RESOURCE_CLASS rc;
  1564. } CLUSPROP_RESOURCE_CLASS, *PCLUSPROP_RESOURCE_CLASS;
  1565. // Resource class info property value.
  1566. #ifdef __cplusplus
  1567. typedef struct CLUSPROP_RESOURCE_CLASS_INFO
  1568. : public CLUSPROP_VALUE
  1569. , public CLUS_RESOURCE_CLASS_INFO {
  1570. #else
  1571. typedef struct CLUSPROP_RESOURCE_CLASS_INFO {
  1572. CLUSPROP_VALUE;
  1573. CLUS_RESOURCE_CLASS_INFO;
  1574. #endif
  1575. } CLUSPROP_RESOURCE_CLASS_INFO, *PCLUSPROP_RESOURCE_CLASS_INFO;
  1576. // One entry from list returned by CLCTL_GET_REQUIRED_DEPENDENCIES control functions.
  1577. typedef union CLUSPROP_REQUIRED_DEPENDENCY {
  1578. CLUSPROP_VALUE Value;
  1579. CLUSPROP_RESOURCE_CLASS ResClass;
  1580. CLUSPROP_SZ ResTypeName;
  1581. } CLUSPROP_REQUIRED_DEPENDENCY, *PCLUSPROP_REQUIRED_DEPENDENCY;
  1582. typedef CLUSPROP_DWORD CLUSPROP_DISK_NUMBER, *PCLUSPROP_DISK_NUMBER;
  1583. #endif // MIDL_PASS
  1584. #endif // _CLUSTER_API_TYPES_
  1585. //#ifdef MIDL_PASS
  1586. //#ifndef MAX_PATH
  1587. //#define MAX_PATH 260
  1588. //#endif
  1589. //#endif // if MIDL_PASS
  1590. #ifndef _CLUSTER_API_TYPES_
  1591. // Disk partition information flags.
  1592. typedef enum CLUSPROP_PIFLAGS {
  1593. CLUSPROP_PIFLAG_STICKY = 0x00000001,
  1594. CLUSPROP_PIFLAG_REMOVABLE = 0x00000002,
  1595. CLUSPROP_PIFLAG_USABLE = 0x00000004,
  1596. CLUSPROP_PIFLAG_DEFAULT_QUORUM = 0x00000008
  1597. } CLUSPROP_PIFLAGS;
  1598. #ifndef MIDL_PASS
  1599. //force quorum information, useful for QON type resources
  1600. //to be able to continue operation without the quorum
  1601. typedef struct CLUS_FORCE_QUORUM_INFO {
  1602. DWORD dwSize; // size of this struct including the nodes list.
  1603. DWORD dwNodeBitMask; // a bit mask representing the max assumed node set
  1604. DWORD dwMaxNumberofNodes; // the number of bits set in the mask
  1605. WCHAR multiszNodeList[1]; // Multi sz list of nodes
  1606. } CLUS_FORCE_QUORUM_INFO, *PCLUS_FORCE_QUORUM_INFO;
  1607. // Disk partition information.
  1608. typedef struct CLUS_PARTITION_INFO {
  1609. DWORD dwFlags;
  1610. WCHAR szDeviceName[MAX_PATH];
  1611. WCHAR szVolumeLabel[MAX_PATH];
  1612. DWORD dwSerialNumber;
  1613. DWORD rgdwMaximumComponentLength;
  1614. DWORD dwFileSystemFlags;
  1615. WCHAR szFileSystem[32];
  1616. } CLUS_PARTITION_INFO, *PCLUS_PARTITION_INFO;
  1617. // Disk partition information property value.
  1618. #ifdef __cplusplus
  1619. typedef struct CLUSPROP_PARTITION_INFO
  1620. : public CLUSPROP_VALUE
  1621. , public CLUS_PARTITION_INFO {
  1622. #else
  1623. typedef struct CLUSPROP_PARTITION_INFO {
  1624. CLUSPROP_VALUE;
  1625. CLUS_PARTITION_INFO;
  1626. #endif
  1627. } CLUSPROP_PARTITION_INFO, *PCLUSPROP_PARTITION_INFO;
  1628. //
  1629. // FT set information.
  1630. //
  1631. typedef struct CLUS_FTSET_INFO {
  1632. DWORD dwRootSignature;
  1633. DWORD dwFtType;
  1634. } CLUS_FTSET_INFO, *PCLUS_FTSET_INFO;
  1635. // Disk partition information property value.
  1636. #ifdef __cplusplus
  1637. typedef struct CLUSPROP_FTSET_INFO
  1638. : public CLUSPROP_VALUE
  1639. , public CLUS_FTSET_INFO {
  1640. #else
  1641. typedef struct CLUSPROP_FTSET_INFO {
  1642. CLUSPROP_VALUE;
  1643. CLUS_FTSET_INFO;
  1644. #endif
  1645. } CLUSPROP_FTSET_INFO, *PCLUSPROP_FTSET_INFO;
  1646. // Disk Signature property value.
  1647. typedef CLUSPROP_DWORD CLUSPROP_DISK_SIGNATURE, *PCLUSPROP_DISK_SIGNATURE;
  1648. // SCSI Address.
  1649. typedef struct CLUS_SCSI_ADDRESS {
  1650. union {
  1651. struct {
  1652. UCHAR PortNumber;
  1653. UCHAR PathId;
  1654. UCHAR TargetId;
  1655. UCHAR Lun;
  1656. };
  1657. DWORD dw;
  1658. };
  1659. } CLUS_SCSI_ADDRESS, *PCLUS_SCSI_ADDRESS;
  1660. // SCSI Address property value.
  1661. #ifdef __cplusplus
  1662. typedef struct CLUSPROP_SCSI_ADDRESS
  1663. : public CLUSPROP_VALUE
  1664. , public CLUS_SCSI_ADDRESS {
  1665. #else
  1666. typedef struct CLUSPROP_SCSI_ADDRESS {
  1667. CLUSPROP_VALUE;
  1668. CLUS_SCSI_ADDRESS;
  1669. #endif
  1670. } CLUSPROP_SCSI_ADDRESS, *PCLUSPROP_SCSI_ADDRESS;
  1671. // Beginning of a property list.
  1672. typedef struct CLUSPROP_LIST {
  1673. DWORD nPropertyCount;
  1674. CLUSPROP_PROPERTY_NAME PropertyName;
  1675. } CLUSPROP_LIST, *PCLUSPROP_LIST;
  1676. // Helper for building or parsing a property list buffer.
  1677. typedef union CLUSPROP_BUFFER_HELPER {
  1678. BYTE * pb;
  1679. WORD * pw;
  1680. DWORD * pdw;
  1681. LONG * pl;
  1682. LPWSTR psz;
  1683. PCLUSPROP_LIST pList;
  1684. PCLUSPROP_SYNTAX pSyntax;
  1685. PCLUSPROP_PROPERTY_NAME pName;
  1686. PCLUSPROP_VALUE pValue;
  1687. PCLUSPROP_BINARY pBinaryValue;
  1688. PCLUSPROP_WORD pWordValue;
  1689. PCLUSPROP_DWORD pDwordValue;
  1690. PCLUSPROP_LONG pLongValue;
  1691. PCLUSPROP_ULARGE_INTEGER pULargeIntegerValue;
  1692. PCLUSPROP_LARGE_INTEGER pLargeIntegerValue;
  1693. PCLUSPROP_SZ pStringValue;
  1694. PCLUSPROP_MULTI_SZ pMultiSzValue;
  1695. PCLUSPROP_SECURITY_DESCRIPTOR pSecurityDescriptor;
  1696. PCLUSPROP_RESOURCE_CLASS pResourceClassValue;
  1697. PCLUSPROP_RESOURCE_CLASS_INFO pResourceClassInfoValue;
  1698. PCLUSPROP_DISK_SIGNATURE pDiskSignatureValue;
  1699. PCLUSPROP_SCSI_ADDRESS pScsiAddressValue;
  1700. PCLUSPROP_DISK_NUMBER pDiskNumberValue;
  1701. PCLUSPROP_PARTITION_INFO pPartitionInfoValue;
  1702. PCLUSPROP_REQUIRED_DEPENDENCY pRequiredDependencyValue;
  1703. } CLUSPROP_BUFFER_HELPER, *PCLUSPROP_BUFFER_HELPER;
  1704. #endif // MIDL_PASS
  1705. #endif // _CLUSTER_API_TYPES_
  1706. // Macro for aligning CLUSPROP buffers on a DWORD boundary.
  1707. #define ALIGN_CLUSPROP( count ) ((count + 3) & ~3)
  1708. // Macros for declaring array format values
  1709. #define CLUSPROP_BINARY_DECLARE( name, cb ) \
  1710. struct { \
  1711. CLUSPROP_SYNTAX Syntax; \
  1712. DWORD cbLength; \
  1713. BYTE rgb[(cb + 3) & ~3]; \
  1714. } name
  1715. #define CLUSPROP_SZ_DECLARE( name, cch ) \
  1716. struct { \
  1717. CLUSPROP_SYNTAX Syntax; \
  1718. DWORD cbLength; \
  1719. WCHAR sz[(cch + 1) & ~1]; \
  1720. } name
  1721. #define CLUSPROP_PROPERTY_NAME_DECLARE( name, cch ) CLUSPROP_SZ_DECLARE( name, cch )
  1722. //
  1723. // Cluster resource property enumeration.
  1724. //
  1725. #ifndef _CLUSTER_API_TYPES_
  1726. //
  1727. // Define enumerable types
  1728. //
  1729. typedef enum CLUSTER_RESOURCE_ENUM {
  1730. CLUSTER_RESOURCE_ENUM_DEPENDS = 0x00000001,
  1731. CLUSTER_RESOURCE_ENUM_PROVIDES = 0x00000002,
  1732. CLUSTER_RESOURCE_ENUM_NODES = 0x00000004,
  1733. CLUSTER_RESOURCE_ENUM_ALL = (CLUSTER_RESOURCE_ENUM_DEPENDS |
  1734. CLUSTER_RESOURCE_ENUM_PROVIDES |
  1735. CLUSTER_RESOURCE_ENUM_NODES)
  1736. } CLUSTER_RESOURCE_ENUM;
  1737. typedef enum CLUSTER_RESOURCE_TYPE_ENUM {
  1738. CLUSTER_RESOURCE_TYPE_ENUM_NODES = 0x00000001,
  1739. CLUSTER_RESOURCE_TYPE_ENUM_ALL = (CLUSTER_RESOURCE_TYPE_ENUM_NODES)
  1740. } CLUSTER_RESOURCE_TYPE_ENUM;
  1741. #endif // _CLUSTER_API_TYPES_
  1742. #ifndef MIDL_PASS
  1743. HRESENUM
  1744. WINAPI
  1745. ClusterResourceOpenEnum(
  1746. IN HRESOURCE hResource,
  1747. IN DWORD dwType
  1748. );
  1749. DWORD
  1750. WINAPI
  1751. ClusterResourceGetEnumCount(
  1752. IN HRESENUM hResEnum
  1753. );
  1754. DWORD
  1755. WINAPI
  1756. ClusterResourceEnum(
  1757. IN HRESENUM hResEnum,
  1758. IN DWORD dwIndex,
  1759. OUT LPDWORD lpdwType,
  1760. OUT LPWSTR lpszName,
  1761. IN OUT LPDWORD lpcchName
  1762. );
  1763. DWORD
  1764. WINAPI
  1765. ClusterResourceCloseEnum(
  1766. IN HRESENUM hResEnum
  1767. );
  1768. DWORD
  1769. WINAPI
  1770. CreateClusterResourceType(
  1771. IN HCLUSTER hCluster,
  1772. IN LPCWSTR lpszResourceTypeName,
  1773. IN LPCWSTR lpszDisplayName,
  1774. IN LPCWSTR lpszResourceTypeDll,
  1775. IN DWORD dwLooksAlivePollInterval,
  1776. IN DWORD dwIsAlivePollInterval
  1777. );
  1778. DWORD
  1779. WINAPI
  1780. DeleteClusterResourceType(
  1781. IN HCLUSTER hCluster,
  1782. IN LPCWSTR lpszResourceTypeName
  1783. );
  1784. HRESTYPEENUM
  1785. WINAPI
  1786. ClusterResourceTypeOpenEnum(
  1787. IN HCLUSTER hCluster,
  1788. IN LPCWSTR lpszResourceTypeName,
  1789. IN DWORD dwType
  1790. );
  1791. DWORD
  1792. WINAPI
  1793. ClusterResourceTypeGetEnumCount(
  1794. IN HRESTYPEENUM hResTypeEnum
  1795. );
  1796. DWORD
  1797. WINAPI
  1798. ClusterResourceTypeEnum(
  1799. IN HRESTYPEENUM hResTypeEnum,
  1800. IN DWORD dwIndex,
  1801. OUT LPDWORD lpdwType,
  1802. OUT LPWSTR lpszName,
  1803. IN OUT LPDWORD lpcchName
  1804. );
  1805. DWORD
  1806. WINAPI
  1807. ClusterResourceTypeCloseEnum(
  1808. IN HRESTYPEENUM hResTypeEnum
  1809. );
  1810. #endif // MIDL_PASS
  1811. //
  1812. // Network-related structures and types.
  1813. //
  1814. #ifndef _CLUSTER_API_TYPES_
  1815. //
  1816. // Define enumerable group types
  1817. //
  1818. typedef enum CLUSTER_NETWORK_ENUM {
  1819. CLUSTER_NETWORK_ENUM_NETINTERFACES = 0x00000001,
  1820. CLUSTER_NETWORK_ENUM_ALL = CLUSTER_NETWORK_ENUM_NETINTERFACES
  1821. } CLUSTER_NETWORK_ENUM;
  1822. typedef enum CLUSTER_NETWORK_STATE {
  1823. ClusterNetworkStateUnknown = -1,
  1824. ClusterNetworkUnavailable,
  1825. ClusterNetworkDown,
  1826. ClusterNetworkPartitioned,
  1827. ClusterNetworkUp
  1828. } CLUSTER_NETWORK_STATE;
  1829. // Role the network plays in the cluster. This is a bitmask.
  1830. typedef enum CLUSTER_NETWORK_ROLE {
  1831. ClusterNetworkRoleNone = 0,
  1832. ClusterNetworkRoleInternalUse = 0x00000001,
  1833. ClusterNetworkRoleClientAccess = 0x00000002,
  1834. ClusterNetworkRoleInternalAndClient = 0x00000003
  1835. } CLUSTER_NETWORK_ROLE;
  1836. #endif // _CLUSTER_API_TYPES_
  1837. //
  1838. // Interfaces for managing the networks of a cluster.
  1839. //
  1840. #ifndef MIDL_PASS
  1841. HNETWORK
  1842. WINAPI
  1843. OpenClusterNetwork(
  1844. IN HCLUSTER hCluster,
  1845. IN LPCWSTR lpszNetworkName
  1846. );
  1847. BOOL
  1848. WINAPI
  1849. CloseClusterNetwork(
  1850. IN HNETWORK hNetwork
  1851. );
  1852. HCLUSTER
  1853. WINAPI
  1854. GetClusterFromNetwork(
  1855. IN HNETWORK hNetwork
  1856. );
  1857. HNETWORKENUM
  1858. WINAPI
  1859. ClusterNetworkOpenEnum(
  1860. IN HNETWORK hNetwork,
  1861. IN DWORD dwType
  1862. );
  1863. DWORD
  1864. WINAPI
  1865. ClusterNetworkGetEnumCount(
  1866. IN HNETWORKENUM hNetworkEnum
  1867. );
  1868. DWORD
  1869. WINAPI
  1870. ClusterNetworkEnum(
  1871. IN HNETWORKENUM hNetworkEnum,
  1872. IN DWORD dwIndex,
  1873. OUT LPDWORD lpdwType,
  1874. OUT LPWSTR lpszName,
  1875. IN OUT LPDWORD lpcchName
  1876. );
  1877. DWORD
  1878. WINAPI
  1879. ClusterNetworkCloseEnum(
  1880. IN HNETWORKENUM hNetworkEnum
  1881. );
  1882. CLUSTER_NETWORK_STATE
  1883. WINAPI
  1884. GetClusterNetworkState(
  1885. IN HNETWORK hNetwork
  1886. );
  1887. DWORD
  1888. WINAPI
  1889. SetClusterNetworkName(
  1890. IN HNETWORK hNetwork,
  1891. IN LPCWSTR lpszName
  1892. );
  1893. DWORD
  1894. WINAPI
  1895. GetClusterNetworkId(
  1896. IN HNETWORK hNetwork,
  1897. OUT LPWSTR lpszNetworkId,
  1898. IN OUT LPDWORD lpcchNetworkId
  1899. );
  1900. DWORD
  1901. WINAPI
  1902. ClusterNetworkControl(
  1903. IN HNETWORK hNetwork,
  1904. IN OPTIONAL HNODE hHostNode,
  1905. IN DWORD dwControlCode,
  1906. IN LPVOID lpInBuffer,
  1907. IN DWORD cbInBufferSize,
  1908. OUT LPVOID lpOutBuffer,
  1909. IN DWORD cbOutBufferSize,
  1910. OUT LPDWORD lpcbBytesReturned
  1911. );
  1912. #endif // MIDL_PASS
  1913. #ifndef _CLUSTER_API_TYPES_
  1914. //
  1915. // Network interface-related structures and types.
  1916. //
  1917. typedef enum CLUSTER_NETINTERFACE_STATE {
  1918. ClusterNetInterfaceStateUnknown = -1,
  1919. ClusterNetInterfaceUnavailable,
  1920. ClusterNetInterfaceFailed,
  1921. ClusterNetInterfaceUnreachable,
  1922. ClusterNetInterfaceUp
  1923. } CLUSTER_NETINTERFACE_STATE;
  1924. #endif // _CLUSTER_API_TYPES_
  1925. //
  1926. // Interfaces for managing the network interfaces of a cluster.
  1927. //
  1928. #ifndef MIDL_PASS
  1929. HNETINTERFACE
  1930. WINAPI
  1931. OpenClusterNetInterface(
  1932. IN HCLUSTER hCluster,
  1933. IN LPCWSTR lpszInterfaceName
  1934. );
  1935. DWORD
  1936. WINAPI
  1937. GetClusterNetInterface(
  1938. IN HCLUSTER hCluster,
  1939. IN LPCWSTR lpszNodeName,
  1940. IN LPCWSTR lpszNetworkName,
  1941. OUT LPWSTR lpszInterfaceName,
  1942. IN OUT LPDWORD lpcchInterfaceName
  1943. );
  1944. BOOL
  1945. WINAPI
  1946. CloseClusterNetInterface(
  1947. IN HNETINTERFACE hNetInterface
  1948. );
  1949. HCLUSTER
  1950. WINAPI
  1951. GetClusterFromNetInterface(
  1952. IN HNETINTERFACE hNetInterface
  1953. );
  1954. CLUSTER_NETINTERFACE_STATE
  1955. WINAPI
  1956. GetClusterNetInterfaceState(
  1957. IN HNETINTERFACE hNetInterface
  1958. );
  1959. DWORD
  1960. WINAPI
  1961. ClusterNetInterfaceControl(
  1962. IN HNETINTERFACE hNetInterface,
  1963. IN OPTIONAL HNODE hHostNode,
  1964. IN DWORD dwControlCode,
  1965. IN LPVOID lpInBuffer,
  1966. IN DWORD cbInBufferSize,
  1967. OUT LPVOID lpOutBuffer,
  1968. IN DWORD cbOutBufferSize,
  1969. OUT LPDWORD lpcbBytesReturned
  1970. );
  1971. #endif // MIDL_PASS
  1972. //
  1973. // Cluster registry update and access routines
  1974. //
  1975. #ifndef MIDL_PASS
  1976. HKEY
  1977. WINAPI
  1978. GetClusterKey(
  1979. IN HCLUSTER hCluster,
  1980. IN REGSAM samDesired
  1981. );
  1982. HKEY
  1983. WINAPI
  1984. GetClusterGroupKey(
  1985. IN HGROUP hGroup,
  1986. IN REGSAM samDesired
  1987. );
  1988. HKEY
  1989. WINAPI
  1990. GetClusterResourceKey(
  1991. IN HRESOURCE hResource,
  1992. IN REGSAM samDesired
  1993. );
  1994. HKEY
  1995. WINAPI
  1996. GetClusterNodeKey(
  1997. IN HNODE hNode,
  1998. IN REGSAM samDesired
  1999. );
  2000. HKEY
  2001. WINAPI
  2002. GetClusterNetworkKey(
  2003. IN HNETWORK hNetwork,
  2004. IN REGSAM samDesired
  2005. );
  2006. HKEY
  2007. WINAPI
  2008. GetClusterNetInterfaceKey(
  2009. IN HNETINTERFACE hNetInterface,
  2010. IN REGSAM samDesired
  2011. );
  2012. LONG
  2013. WINAPI
  2014. ClusterRegCreateKey(
  2015. IN HKEY hKey,
  2016. IN LPCWSTR lpszSubKey,
  2017. IN DWORD dwOptions,
  2018. IN REGSAM samDesired,
  2019. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  2020. OUT PHKEY phkResult,
  2021. OUT OPTIONAL LPDWORD lpdwDisposition
  2022. );
  2023. LONG
  2024. WINAPI
  2025. ClusterRegOpenKey(
  2026. IN HKEY hKey,
  2027. IN LPCWSTR lpszSubKey,
  2028. IN REGSAM samDesired,
  2029. OUT PHKEY phkResult
  2030. );
  2031. LONG
  2032. WINAPI
  2033. ClusterRegDeleteKey(
  2034. IN HKEY hKey,
  2035. IN LPCWSTR lpszSubKey
  2036. );
  2037. LONG
  2038. WINAPI
  2039. ClusterRegCloseKey(
  2040. IN HKEY hKey
  2041. );
  2042. LONG
  2043. WINAPI
  2044. ClusterRegEnumKey(
  2045. IN HKEY hKey,
  2046. IN DWORD dwIndex,
  2047. OUT LPWSTR lpszName,
  2048. IN OUT LPDWORD lpcchName,
  2049. OUT PFILETIME lpftLastWriteTime
  2050. );
  2051. DWORD
  2052. WINAPI
  2053. ClusterRegSetValue(
  2054. IN HKEY hKey,
  2055. IN LPCWSTR lpszValueName,
  2056. IN DWORD dwType,
  2057. IN CONST BYTE* lpData,
  2058. IN DWORD cbData
  2059. );
  2060. DWORD
  2061. WINAPI
  2062. ClusterRegDeleteValue(
  2063. IN HKEY hKey,
  2064. IN LPCWSTR lpszValueName
  2065. );
  2066. LONG
  2067. WINAPI
  2068. ClusterRegQueryValue(
  2069. IN HKEY hKey,
  2070. IN LPCWSTR lpszValueName,
  2071. OUT LPDWORD lpdwValueType,
  2072. OUT LPBYTE lpData,
  2073. IN OUT LPDWORD lpcbData
  2074. );
  2075. DWORD
  2076. WINAPI
  2077. ClusterRegEnumValue(
  2078. IN HKEY hKey,
  2079. IN DWORD dwIndex,
  2080. OUT LPWSTR lpszValueName,
  2081. IN OUT LPDWORD lpcchValueName,
  2082. OUT LPDWORD lpdwType,
  2083. OUT LPBYTE lpData,
  2084. IN OUT LPDWORD lpcbData
  2085. );
  2086. LONG
  2087. WINAPI
  2088. ClusterRegQueryInfoKey(
  2089. IN HKEY hKey,
  2090. IN LPDWORD lpcSubKeys,
  2091. IN LPDWORD lpcchMaxSubKeyLen,
  2092. IN LPDWORD lpcValues,
  2093. IN LPDWORD lpcchMaxValueNameLen,
  2094. IN LPDWORD lpcbMaxValueLen,
  2095. IN LPDWORD lpcbSecurityDescriptor,
  2096. IN PFILETIME lpftLastWriteTime
  2097. );
  2098. LONG
  2099. WINAPI
  2100. ClusterRegGetKeySecurity (
  2101. IN HKEY hKey,
  2102. IN SECURITY_INFORMATION RequestedInformation,
  2103. OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  2104. IN LPDWORD lpcbSecurityDescriptor
  2105. );
  2106. LONG
  2107. WINAPI
  2108. ClusterRegSetKeySecurity(
  2109. IN HKEY hKey,
  2110. IN SECURITY_INFORMATION SecurityInformation,
  2111. IN PSECURITY_DESCRIPTOR pSecurityDescriptor
  2112. );
  2113. #if _MSC_VER >= 1200
  2114. #pragma warning(pop) // restore 4200/4201
  2115. #else
  2116. #pragma warning( default : 4200 ) // nonstandard extension used : zero-sized array in struct/union
  2117. #pragma warning( default : 4201 ) // nonstandard extension used : nameless struct/union
  2118. #endif
  2119. #endif // MIDL_PASS
  2120. #ifdef __cplusplus
  2121. }
  2122. #endif
  2123. #ifndef _CLUSTER_API_TYPES_
  2124. #define _CLUSTER_API_TYPES_
  2125. #endif // _CLUSTER_API_TYPES_
  2126. #endif // _CLUSTER_API_