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.

2367 lines
46 KiB

  1. #ifndef _FMP_H
  2. #define _FMP_H
  3. /*++
  4. Copyright (c) 1996-1999 Microsoft Corporation
  5. Module Name:
  6. fmp.h
  7. Abstract:
  8. Private data structures and procedure prototypes for
  9. the Failover Manager subcomponent of the NT Cluster
  10. Service
  11. Author:
  12. John Vert (jvert) 7-Feb-1996
  13. Revision History:
  14. --*/
  15. #define UNICODE 1
  16. #include "nt.h"
  17. #include "ntrtl.h"
  18. #include "nturtl.h"
  19. #include "service.h"
  20. #include "clusudef.h"
  21. #include "rm_rpc.h"
  22. #include "stdlib.h"
  23. #define LOG_CURRENT_MODULE LOG_MODULE_FM
  24. #define FMGUM 1
  25. #define RMNOTIFY 2
  26. #define RESOURCE 3
  27. #define FMAPI 4
  28. #define GROUP 5
  29. #define RECV 6
  30. #define EVENT 7
  31. #define FMCLIENT 8
  32. #define TREE 9
  33. #define FMINIT 10
  34. #define IOCTL 11
  35. #define FMREG 12
  36. #define RESMONF 13 //for resmon.c
  37. #define WORKER 14
  38. #define RESFAIL 15
  39. #define GROUPARB 16
  40. //
  41. // RPC timeout constant (borrowed from nmp.h)
  42. // Node Intracluster RPC record/cancellation routines.
  43. // Useful to terminate outstanding RPCs to failed nodes.
  44. //
  45. #define FM_RPC_TIMEOUT 45000 // 45 secs
  46. //
  47. // Monitor shutdown timeout
  48. //
  49. #define FM_MONITOR_SHUTDOWN_TIMEOUT 15 * 60 * 1000 // 15 min
  50. typedef CLUSTER_EVENT FM_EVENT;
  51. //fm event handling
  52. //events generated by the service
  53. #define FM_EVENT_NODE_DOWN 1
  54. #define FM_EVENT_SHUTDOWN 2
  55. #define FM_EVENT_RESOURCE_ADDED 3
  56. #define FM_EVENT_RESOURCE_DELETED 4
  57. #define FM_EVENT_GROUP_FAILED 5
  58. #define FM_EVENT_NODE_ADDED 6
  59. #define FM_EVENT_CLUSTER_PROPERTY_CHANGE 7
  60. #define FM_EVENT_RESOURCE_PROPERTY_CHANGE 8
  61. //#define FM_EVENT_GROUP_PROPERTY_CHANGE 9
  62. #define FM_EVENT_RESOURCE_CHANGE 10
  63. #define FM_EVENT_NODE_EVICTED 11
  64. //events generated due to resource dll's
  65. #define FM_EVENT_RES_RESOURCE_TRANSITION 128
  66. #define FM_EVENT_RES_RESOURCE_FAILED 129
  67. //generated when DealyedRestart timer fires
  68. #define FM_EVENT_RES_RETRY_TIMER 131
  69. #define FM_EVENT_INTERNAL_PROP_GROUP_STATE 256
  70. #define FM_EVENT_INTERNAL_SHUTDOWN_CLEANUP 258
  71. #define FM_EVENT_INTERNAL_RETRY_ONLINE 259
  72. #define FM_EVENT_INTERNAL_RESOURCE_CHANGE_PARAMS 260
  73. #define FM_EVENT_INTERNAL_ONLINE_GROUPLIST 261
  74. #define FM_EVENT_RESOURCE_NAME_CHANGE 262
  75. // timer activities ( in msec)
  76. #define FM_TIMER_RESLIST_ONLINE_RETRY 1 * 60 * 1000 //( 1 minute)
  77. //
  78. // Global defines
  79. //
  80. #define FMP_GROUP_NAME L"Group"
  81. #define FMP_RESOURCE_NAME L"Resource"
  82. #define FMP_RESOURCE_TYPE_NAME L"ResType"
  83. #define FMP_GROUP_SIGNATURE 'rGmF'
  84. #define FMP_RESOURCE_SIGNATURE 'sRmF'
  85. #define FMP_RESOURCE_TYPE_SIGNATURE 'tRmF'
  86. #define FMP_RESMON_SIGNATURE 'mRmF'
  87. #define PENDING_TIMEOUT (4*1000) // retry pending operations every 4 secs
  88. //
  89. // Globals
  90. //
  91. extern HANDLE FmpShutdownEvent;
  92. extern DWORD FmpFMOnline;
  93. extern DWORD FmpFMFormPhaseProcessing;
  94. extern DWORD FmpFMGroupsInited;
  95. extern BOOL FmpShutdown;
  96. extern BOOL FmpMajorEvent;
  97. extern CRITICAL_SECTION FmpResourceLock;
  98. extern CRITICAL_SECTION FmpGroupLock;
  99. extern CRITICAL_SECTION FmpMonitorLock;
  100. //
  101. // 185575: remove use of unique RPC binding handles.
  102. //
  103. //extern CRITICAL_SECTION FmpBindingLock;
  104. extern CL_QUEUE FmpWorkQueue;
  105. //global data relating to the quorum resource
  106. #if NO_SHARED_LOCKS
  107. extern CRITICAL_SECTION gQuoLock;
  108. #else
  109. extern RTL_RESOURCE gQuoLock;
  110. #endif
  111. #if NO_SHARED_LOCKS
  112. extern CRITICAL_SECTION gQuoChangeLock;
  113. #else
  114. extern RTL_RESOURCE gQuoChangeLock;
  115. #endif
  116. #if NO_SHARED_LOCKS
  117. extern CRITICAL_SECTION gResTypeLock;
  118. #else
  119. extern RTL_RESOURCE gResTypeLock;
  120. #endif
  121. extern PFM_RESOURCE gpQuoResource;
  122. extern HANDLE ghQuoOnlineEvent;
  123. extern DWORD gdwQuoBlockingResources;
  124. extern RPC_BINDING_HANDLE FmpRpcBindings[];
  125. extern RPC_BINDING_HANDLE FmpRpcQuorumBindings[];
  126. extern RESUTIL_PROPERTY_ITEM FmpGroupCommonProperties[];
  127. typedef struct FM_NODE{
  128. DWORD dwNodeDownProcessingInProgress;
  129. PNM_NODE pNode;
  130. }FM_NODE, *PFM_NODE;
  131. extern PFM_NODE gFmpNodeArray;
  132. //
  133. // Macros
  134. //
  135. #define FmpMustBeOnline( ) \
  136. if ( !FmpFMOnline ) { \
  137. if ( FmpShutdown ) { \
  138. return(ERROR_CLUSTER_NODE_SHUTTING_DOWN); \
  139. } else { \
  140. return(ERROR_CLUSTER_NODE_NOT_READY); \
  141. } \
  142. }
  143. #define FmpMustBeOnlineEx( ReturnValue ) \
  144. if ( !FmpFMOnline ) { \
  145. if ( FmpShutdown ) { \
  146. SetLastError(ERROR_CLUSTER_NODE_SHUTTING_DOWN); \
  147. } else { \
  148. SetLastError(ERROR_CLUSTER_NODE_NOT_READY); \
  149. } \
  150. return(ReturnValue); \
  151. }
  152. typedef struct WORK_ITEM {
  153. LIST_ENTRY ListEntry;
  154. CLUSTER_EVENT Event;
  155. PVOID Context1;
  156. ULONG_PTR Context2;
  157. } WORK_ITEM, *PWORK_ITEM;
  158. // structures for timer activity
  159. typedef struct _FM_RESLIST_ONLINE_RETRY_INFO{
  160. PFM_GROUP pGroup;
  161. RESOURCE_ENUM ResourceEnum;
  162. }FM_RESLIST_ONLINE_RETRY_INFO, *PFM_RESLIST_ONLINE_RETRY_INFO;
  163. //structure for cleanup at shutdown
  164. typedef struct FM_CLEANUP_INFO{
  165. PGROUP_ENUM pGroupEnum;
  166. BOOL bContainsQuorumGroup;
  167. DWORD dwTimeOut;
  168. }FM_CLEANUP_INFO, *PFM_CLEANUP_INFO;
  169. //
  170. // Wait block used for waiting on completion of pending
  171. // events
  172. //
  173. typedef struct FM_WAIT_BLOCK {
  174. LIST_ENTRY ListEntry;
  175. HANDLE hEvent;
  176. DWORD Status;
  177. } FM_WAIT_BLOCK, *PFM_WAIT_BLOCK;
  178. //
  179. // Group Move structure
  180. //
  181. typedef struct MOVE_GROUP {
  182. PFM_GROUP Group;
  183. PNM_NODE DestinationNode;
  184. } MOVE_GROUP, *PMOVE_GROUP;
  185. //
  186. // Information for group affinity calculation.
  187. //
  188. typedef struct GROUP_AFFINITY_NODE_INFO {
  189. PFM_GROUP pGroup;
  190. PNM_NODE *ppNmNodeList;
  191. BOOL fDidPruningOccur;
  192. } GROUP_AFFINITY_NODE_INFO, *PGROUP_AFFINITY_NODE_INFO;
  193. //
  194. // Define types of pending routines
  195. //
  196. typedef enum {
  197. OfflinePending
  198. } PENDING_ROUTINE;
  199. //
  200. // Define types of Group failbacks
  201. //
  202. typedef enum {
  203. FailbackNot,
  204. FailbackOkay,
  205. FailbackMaximum
  206. } FAILBACK_TYPE;
  207. //
  208. // Define resource restart actions
  209. //
  210. typedef enum {
  211. RestartNot,
  212. RestartLocal,
  213. RestartGroup,
  214. RestartMaximum
  215. } RESTART_ACTION;
  216. //
  217. // Define FM to Resmon event types.
  218. //
  219. typedef enum {
  220. ResourceTransition,
  221. ResourceResuscitate,
  222. RmWorkerTerminate,
  223. RmUpdateResource,
  224. RmRestartResource
  225. } RM_EVENT_TYPE;
  226. DWORD
  227. WINAPI
  228. FmpGumReceiveUpdates(
  229. IN DWORD Context,
  230. IN BOOL SourceNode,
  231. IN DWORD BufferLength,
  232. IN PVOID Buffer
  233. );
  234. DWORD
  235. WINAPI
  236. FmpGumVoteHandler(
  237. IN DWORD dwContext,
  238. IN DWORD dwInputBufLength,
  239. IN PVOID pInputBuf,
  240. IN DWORD dwVoteLength,
  241. OUT PVOID pVoteBuf
  242. );
  243. //
  244. // Gum update message buffers.
  245. //
  246. // UpdateResourceState
  247. typedef struct GUM_RESOURCE_STATE {
  248. CLUSTER_RESOURCE_STATE State;
  249. CLUSTER_RESOURCE_STATE PersistentState;
  250. DWORD StateSequence;
  251. } GUM_RESOURCE_STATE, *PGUM_RESOURCE_STATE;
  252. // UpdateGroupState
  253. typedef struct GUM_GROUP_STATE {
  254. CLUSTER_GROUP_STATE State;
  255. CLUSTER_GROUP_STATE PersistentState;
  256. DWORD StateSequence;
  257. } GUM_GROUP_STATE, *PGUM_GROUP_STATE;
  258. // UpdateGroupFailureCount
  259. typedef struct GUM_FAILURE_COUNT {
  260. DWORD Count;
  261. DWORD NewTime;
  262. WCHAR GroupId[1];
  263. } GUM_FAILURE_COUNT, *PGUM_FAILURE_COUNT;
  264. typedef struct GUM_CREATE_GROUP {
  265. PFM_GROUP Group;
  266. DWORD GroupIdLen;
  267. DWORD GroupNameLen;
  268. WCHAR GroupId[1];
  269. // WCHAR GroupName[1];
  270. // WCHAR NodeName[1];
  271. } GUM_CREATE_GROUP, *PGUM_CREATE_GROUP;
  272. typedef struct GUM_DELETE_GROUP {
  273. WCHAR GroupId[1];
  274. } GUM_DELETE_GROUP, *PGUM_DELETE_GROUP;
  275. typedef struct GUM_CREATE_RESOURCE {
  276. PFM_RESOURCE Resource;
  277. DWORD GroupIdLen;
  278. DWORD ResourceIdLen;
  279. WCHAR GroupId[1];
  280. // WCHAR ResourceId[1];
  281. // WCHAR ResourceName[1];
  282. } GUM_CREATE_RESOURCE, *PGUM_CREATE_RESOURCE;
  283. typedef struct GUM_INIT_RESOURCE {
  284. DWORD ResourceIdLen;
  285. WCHAR ResourceId[1];
  286. } GUM_INIT_RESOURCE, *PGUM_INIT_RESOURCE;
  287. typedef struct GUM_CHANGE_POSSIBLE_NODE {
  288. DWORD ResourceIdLen;
  289. WCHAR ResourceId[1];
  290. // WCHAR NodeName[1];
  291. } GUM_CHANGE_POSSIBLE_NODE, *PGUM_CHANGE_POSSIBLE_NODE;
  292. typedef struct GUM_CREATE_RESOURCE_TYPE {
  293. WCHAR TypeName[1];
  294. } GUM_CREATE_RESOURCE_TYPE, *PGUM_CREATE_RESOURCE_TYPE;
  295. typedef struct GUM_DELETE_RESOURCE_TYPE {
  296. WCHAR TypeName[1];
  297. } GUM_DELETE_RESOURCE_TYPE, *PGUM_DELETE_RESOURCE_TYPE;
  298. typedef struct GUM_CHANGE_GROUP {
  299. DWORD ResourceIdLen;
  300. WCHAR ResourceId[1];
  301. // WCHAR GroupName[1];
  302. } GUM_CHANGE_GROUP, *PGUM_CHANGE_GROUP;
  303. #if 0
  304. typedef struct GUM_SET_POSSIBLE_NODE_FORRESTYPE{
  305. DWORD ResTypeNameLen;
  306. WCHAR ResTypeName[1];
  307. } GUM_SET_POSSIBLE_OWNER_FORRESTYPE, *PGUM_SET_POSSIBLE_OWNER_FORRESTYPE;
  308. #endif
  309. typedef struct _FMP_POSSIBLE_NODE {
  310. PFM_RESOURCE Resource;
  311. PNM_NODE Node;
  312. DWORD ControlCode;
  313. } FMP_POSSIBLE_NODE, *PFMP_POSSIBLE_NODE;
  314. //VOTE STRUCTURES
  315. typedef struct _FMP_VOTE_POSSIBLE_NODE_FOR_RESTYPE{
  316. DWORD dwSize;
  317. DWORD dwNodeId;
  318. BOOL bPossibleNode;
  319. }FMP_VOTE_POSSIBLE_NODE_FOR_RESTYPE, *PFMP_VOTE_POSSIBLE_NODE_FOR_RESTYPE;
  320. typedef struct _FM_RES_CHANGE_NAME {
  321. PFM_RESOURCE pResource;
  322. WCHAR szNewResourceName[1];
  323. } FM_RES_CHANGE_NAME, *PFM_RES_CHANGE_NAME;
  324. //
  325. // Monitor resource enumeration
  326. //
  327. typedef struct MONITOR_RESOURCE_ENUM {
  328. DWORD EntryCount;
  329. DWORD CurrentIndex;
  330. BOOL fCreateMonitors;
  331. PFM_RESOURCE Entry[1];
  332. } MONITOR_RESOURCE_ENUM, *PMONITOR_RESOURCE_ENUM;
  333. #define ENUM_GROW_SIZE 16
  334. //
  335. // Resource enumeration interface
  336. //
  337. #define RESOURCE_SIZE(Entries) ((Entries-1) * sizeof(RESOURCE_ENUM_ENTRY) + sizeof(RESOURCE_ENUM))
  338. #define MONITOR_RESOURCE_SIZE(Entries) ((Entries-1) * sizeof(PFM_GROUP) + \
  339. sizeof(MONITOR_RESOURCE_ENUM))
  340. //
  341. // Group and resource enumeration entries.
  342. //
  343. #define GROUP_SIZE(Entries) ((Entries-1) * sizeof(GROUP_ENUM_ENTRY) + sizeof(GROUP_ENUM))
  344. #define NODE_SIZE(Entries) ((Entries-1) * sizeof (NM_NODE_INFO2) + sizeof(NM_NODE_ENUM2))
  345. #define RESOURCE_SIZE(Entries) ((Entries-1) * sizeof(RESOURCE_ENUM_ENTRY) + sizeof(RESOURCE_ENUM))
  346. //
  347. // Define structure for a Resource Monitor process
  348. //
  349. typedef struct RESMON {
  350. DWORD Signature;
  351. HANDLE Process;
  352. HANDLE NotifyThread;
  353. BOOL Shutdown;
  354. DWORD RefCount;
  355. RPC_BINDING_HANDLE Binding;
  356. struct MONITOR_STATE *SharedState;
  357. } RESMON, *PRESMON;
  358. //
  359. // Monitor list enumeration info used for resource DLL upgrade.
  360. //
  361. typedef struct _FM_MONITOR_ENUM_HEADER
  362. {
  363. DWORD cEntries;
  364. DWORD cAllocated;
  365. BOOL fDefaultMonitorAdded;
  366. PRESMON *ppMonitorList;
  367. } FM_MONITOR_ENUM_HEADER, *PFM_MONITOR_ENUM_HEADER;
  368. //
  369. // Structure definitions for passing around group preferred node list info on a node
  370. // down.
  371. //
  372. typedef struct _FM_GROUP_NODE_LIST_ENTRY
  373. {
  374. DWORD dwPreferredNodeId;
  375. WCHAR szGroupId[1]; // Always at the end to help marshalling
  376. } FM_GROUP_NODE_LIST_ENTRY, *PFM_GROUP_NODE_LIST_ENTRY;
  377. typedef struct _FM_GROUP_NODE_LIST
  378. {
  379. DWORD cbGroupNodeList;
  380. FM_GROUP_NODE_LIST_ENTRY leGroupNodeList[1]; // Always at the end to help marshalling
  381. } FM_GROUP_NODE_LIST, *PFM_GROUP_NODE_LIST;
  382. //flags for cluster propery change
  383. #define CLUSTER_NAME_CHANGE 0x00000001
  384. #define CLUSTER_QUORUM_CHANGE 0x00000002
  385. // FM event handling structures
  386. typedef struct CLUSTER_EVENT_PROPERTY_CONTEXT{
  387. DWORD dwFlags;
  388. PVOID pContext1;
  389. PVOID pContext2;
  390. }CLUSTER_EVENT_PROPERTY_CONTEXT, *PCLUSTER_EVENT_PROPERTY_CONTEXT;
  391. typedef struct RESOURCE_STATE_CHANGE{
  392. PFM_RESOURCE pResource;
  393. CLUSTER_RESOURCE_STATE OldState;
  394. CLUSTER_RESOURCE_STATE NewState;
  395. }RESOURCE_STATE_CHANGE, *PRESOURCE_STATE_CHANGE;
  396. //Cluster Name management
  397. DWORD
  398. FmpRegUpdateClusterName(
  399. IN LPCWSTR szNewClusterName
  400. );
  401. //
  402. // Quorum resource Arbitration.
  403. //
  404. DWORD
  405. FmpRmArbitrateResource(
  406. IN PFM_RESOURCE Resource
  407. );
  408. DWORD
  409. FmpRmReleaseResource(
  410. IN PFM_RESOURCE Resource
  411. );
  412. //
  413. // Interfaces for managing the registry.
  414. //
  415. DWORD
  416. FmpRegEnumerateKey(
  417. IN HDMKEY ListKey,
  418. IN DWORD Index,
  419. IN LPWSTR *Name,
  420. IN OUT LPDWORD NameMaxSize
  421. );
  422. //
  423. // Gum interfaces
  424. //
  425. DWORD
  426. FmpEnableGum(
  427. );
  428. //
  429. // Interfaces for managing Resource Monitor processes
  430. //
  431. PRESMON
  432. FmpCreateMonitor(
  433. LPWSTR DebugPrefix,
  434. BOOL SeparateMonitor
  435. );
  436. VOID
  437. FmpShutdownMonitor(
  438. IN PRESMON Monitor
  439. );
  440. BOOL
  441. FmpRestartMonitor(
  442. IN PRESMON Monitor
  443. );
  444. DWORD
  445. FmpCreateMonitorRestartThread(
  446. IN PRESMON pMonitor
  447. );
  448. //
  449. // Interfaces for managing resources via the Resource Monitors
  450. //
  451. DWORD
  452. FmpRmCreateResource(
  453. PFM_RESOURCE Resource
  454. );
  455. DWORD
  456. FmpRmCloseResource(
  457. PFM_RESOURCE Resource
  458. );
  459. DWORD
  460. FmpRmOnlineResource(
  461. PFM_RESOURCE Resource
  462. );
  463. DWORD
  464. FmpRmOfflineResource(
  465. PFM_RESOURCE Resource
  466. );
  467. VOID
  468. FmpRmTerminateResource(
  469. PFM_RESOURCE Resource
  470. );
  471. DWORD
  472. FmpRmFailResource(
  473. PFM_RESOURCE Resource
  474. );
  475. DWORD
  476. FmpRmChangeResourceParams(
  477. PFM_RESOURCE Resource
  478. );
  479. DWORD
  480. FmpRmResourceTypeControl(
  481. IN LPCWSTR ResourceTypeName,
  482. IN DWORD ControlCode,
  483. IN PUCHAR InBuffer,
  484. IN DWORD InBufferSize,
  485. OUT PUCHAR OutBuffer,
  486. IN DWORD OutBufferSize,
  487. OUT LPDWORD BytesReturned,
  488. OUT LPDWORD Required
  489. );
  490. DWORD
  491. FmpRmResourceControl(
  492. IN PFM_RESOURCE Resource,
  493. IN DWORD ControlCode,
  494. IN PUCHAR InBuffer,
  495. IN DWORD InBufferSize,
  496. OUT PUCHAR OutBuffer,
  497. IN DWORD OutBufferSize,
  498. OUT LPDWORD BytesReturned,
  499. OUT LPDWORD Required
  500. );
  501. DWORD FmpRmLoadResTypeDll(
  502. IN PFM_RESTYPE pResType
  503. );
  504. DWORD
  505. FmpPostProcessResourceControl(
  506. IN PFM_RESOURCE Resource,
  507. IN DWORD ControlCode,
  508. IN PUCHAR InBuffer,
  509. IN DWORD InBufferSize,
  510. OUT PUCHAR OutBuffer,
  511. IN DWORD OutBufferSize,
  512. OUT LPDWORD BytesReturned,
  513. OUT LPDWORD Required
  514. );
  515. //
  516. // Interfaces for managing resources
  517. //
  518. DWORD
  519. FmpInitResource(
  520. VOID
  521. );
  522. VOID
  523. FmpCleanupResource(
  524. VOID
  525. );
  526. PFM_RESOURCE
  527. FmpCreateResource(
  528. IN PFM_GROUP Group,
  529. IN LPCWSTR ResourceId,
  530. IN LPCWSTR ResourceName,
  531. IN BOOL Initialize
  532. );
  533. VOID
  534. FmpDestroyResource(
  535. IN PFM_RESOURCE Resource,
  536. IN BOOL bDeleteObjOnly
  537. );
  538. VOID
  539. FmpResourceLastReference(
  540. IN PFM_RESOURCE Resource
  541. );
  542. DWORD
  543. FmpInitializeResource(
  544. IN PFM_RESOURCE Resource,
  545. IN BOOL Initialize
  546. );
  547. DWORD
  548. FmpOnlineResource(
  549. IN PFM_RESOURCE Resource,
  550. IN BOOL ForceOnline
  551. );
  552. DWORD
  553. FmpOfflineResource(
  554. IN PFM_RESOURCE Resource,
  555. IN BOOL bForceOffline
  556. );
  557. DWORD
  558. FmpDoOnlineResource(
  559. IN PFM_RESOURCE Resource,
  560. IN BOOL ForceOnline
  561. );
  562. DWORD
  563. FmpDoOfflineResource(
  564. IN PFM_RESOURCE Resource,
  565. IN BOOL bForceOffline
  566. );
  567. VOID
  568. FmpSetResourcePersistentState(
  569. IN PFM_RESOURCE Resource,
  570. IN CLUSTER_RESOURCE_STATE State
  571. );
  572. VOID
  573. FmpCallResourceNotifyCb(
  574. IN PFM_RESOURCE Resource,
  575. IN CLUSTER_RESOURCE_STATE State
  576. );
  577. DWORD
  578. FmpPropagateResourceState(
  579. IN PFM_RESOURCE Resource,
  580. IN CLUSTER_RESOURCE_STATE State
  581. );
  582. DWORD
  583. FmpGetResourceList(
  584. OUT PRESOURCE_ENUM *ReturnEnum,
  585. IN PFM_GROUP Group
  586. );
  587. DWORD FmpSubmitRetryOnline(
  588. IN PRESOURCE_ENUM pResourceEnum);
  589. VOID
  590. FmpDeleteResourceEnum(
  591. IN PRESOURCE_ENUM Enum
  592. );
  593. DWORD
  594. FmpOnlineResourceList(
  595. IN PRESOURCE_ENUM Enum,
  596. IN PFM_GROUP pGroup
  597. );
  598. DWORD
  599. FmpOfflineResourceList(
  600. IN PRESOURCE_ENUM Enum,
  601. IN BOOL Restore
  602. );
  603. DWORD
  604. FmpTerminateResourceList(
  605. IN PRESOURCE_ENUM Enum
  606. );
  607. VOID
  608. FmpPrunePreferredList(
  609. IN PFM_RESOURCE Resource
  610. );
  611. DWORD
  612. FmpCleanupPossibleNodeList(
  613. IN PFM_RESOURCE pResource
  614. );
  615. DWORD
  616. FmpSetPreferredEntry(
  617. IN PFM_GROUP Group,
  618. IN PNM_NODE Node
  619. );
  620. DWORD
  621. FmpAddPossibleNode(
  622. IN PFM_RESOURCE Resource,
  623. IN PNM_NODE Node
  624. );
  625. DWORD
  626. FmpAddPossibleEntry(
  627. IN PFM_RESOURCE Resource,
  628. IN PNM_NODE Node
  629. );
  630. DWORD
  631. FmpRemovePossibleNode(
  632. IN PFM_RESOURCE Resource,
  633. IN PNM_NODE Node,
  634. IN BOOL RemoveQuorum
  635. );
  636. DWORD
  637. FmpRemoveResourceDependency(
  638. IN HXSACTION hXsaction,
  639. IN PFM_RESOURCE Resource,
  640. IN PFM_RESOURCE DependsOn
  641. );
  642. BOOL
  643. FmpFindQuorumResource(
  644. IN OUT PFM_RESOURCE *QuorumResource,
  645. IN PVOID Context2,
  646. IN PFM_RESOURCE Resource,
  647. IN LPCWSTR Name
  648. );
  649. DWORD
  650. FmpGetQuorumDiskSignature(
  651. IN LPCWSTR lpQuorumId,
  652. OUT LPDWORD lpdwSignature
  653. );
  654. BOOL
  655. FmpReturnResourceType(
  656. IN OUT PFM_RESTYPE *FoundResourceType,
  657. IN LPCWSTR ResourceTypeName,
  658. IN PFM_RESTYPE ResourceType,
  659. IN LPCWSTR Name
  660. );
  661. DWORD
  662. FmpChangeResourceMonitor(
  663. IN PFM_RESOURCE Resource,
  664. IN DWORD SeparateMonitor
  665. );
  666. DWORD
  667. FmpChangeResourceGroup(
  668. IN PFM_RESOURCE Resource,
  669. IN PFM_GROUP Group
  670. );
  671. DWORD
  672. FmpValAddResourceDependency(
  673. IN PFM_RESOURCE pResource,
  674. IN PFM_RESOURCE pDependentResource
  675. );
  676. DWORD
  677. FmpValRemoveResourceDependency(
  678. IN PFM_RESOURCE pResource,
  679. IN PFM_RESOURCE pDependentResource
  680. );
  681. DWORD
  682. FmpUpdateChangeResourceName(
  683. IN BOOL bSourceNode,
  684. IN LPCWSTR lpszResourceId,
  685. IN LPCWSTR lpszNewName
  686. );
  687. DWORD
  688. FmpUpdateDeleteResource(
  689. IN BOOL SourceNode,
  690. IN LPCWSTR ResourceId
  691. );
  692. DWORD
  693. FmpUpdateAddDependency(
  694. IN BOOL SourceNode,
  695. IN LPCWSTR ResourceId,
  696. IN LPCWSTR DependsOnId
  697. );
  698. DWORD
  699. FmpUpdateRemoveDependency(
  700. IN BOOL SourceNode,
  701. IN LPCWSTR ResourceId,
  702. IN LPCWSTR DependsOnId
  703. );
  704. DWORD
  705. FmpUpdateAssignOwnerToGroups(
  706. IN BOOL SourceNode,
  707. IN LPCWSTR pszNodeId
  708. );
  709. DWORD
  710. FmpUpdateApproveJoin(
  711. IN BOOL SourceNode,
  712. IN LPCWSTR pszNodeId
  713. );
  714. DWORD
  715. FmpUpdateCreateGroup(
  716. IN PGUM_CREATE_GROUP pGumGroup,
  717. IN BOOL bSourceNode
  718. );
  719. DWORD
  720. FmpUpdateCreateResource(
  721. IN OUT PGUM_CREATE_RESOURCE pGumResource
  722. );
  723. DWORD
  724. FmpUpdateCompleteGroupMove(
  725. IN BOOL SourceNode,
  726. IN LPCWSTR pszNodeId,
  727. IN LPCWSTR pszGroupId
  728. );
  729. DWORD
  730. FmpUpdateCheckAndSetGroupOwner(
  731. IN BOOL bSourceNode,
  732. IN LPCWSTR lpszGroupId,
  733. IN LPCWSTR lpszNodeId
  734. );
  735. DWORD
  736. FmpUpdateCreateResourceType(
  737. IN PVOID Buffer
  738. );
  739. DWORD FmpSetResourceName(
  740. IN PFM_RESOURCE pResource,
  741. IN LPCWSTR lpszFriendlyName
  742. );
  743. DWORD
  744. FmpClusterEventPropHandler(
  745. IN PFM_RESOURCE pResource
  746. );
  747. BOOL
  748. FmpEnumResourceNodeEvict(
  749. IN PVOID Context1,
  750. IN PVOID Context2,
  751. IN PVOID Object,
  752. IN LPCWSTR Name
  753. );
  754. DWORD FmpPrepareQuorumResChange(
  755. IN PFM_RESOURCE pNewQuoRes,
  756. IN LPCWSTR lpszQuoLogPath,
  757. IN DWORD dwMaxQuoLogSize
  758. );
  759. DWORD
  760. FmpCompleteQuorumResChange(
  761. IN LPCWSTR lpszOldQuoResId,
  762. IN LPCWSTR lpszQuoLogPath
  763. );
  764. DWORD
  765. FmpBackupClusterDatabase(
  766. IN PFM_RESOURCE pQuoRes,
  767. IN LPCWSTR lpszPathName
  768. );
  769. //
  770. // Interfaces for handling pending online/offline requests.
  771. //
  772. VOID
  773. FmpSignalGroupWaiters(
  774. IN PFM_GROUP Group
  775. );
  776. DWORD
  777. FmpWaitForGroup(
  778. IN PFM_GROUP Group
  779. );
  780. #define FmpIsGroupPending(_group_) (!IsListEmpty(&((_group_)->WaitQueue)))
  781. //
  782. // There is currently one default monitor process, and resources
  783. // with the SeparateMonitor property have a monitor created for them.
  784. //
  785. extern PRESMON FmpDefaultMonitor;
  786. //
  787. // Interface for notification module
  788. //
  789. DWORD
  790. FmpInitializeNotify(
  791. VOID
  792. );
  793. BOOL
  794. FmpPostNotification(
  795. IN RM_NOTIFY_KEY NotifyKey,
  796. IN DWORD NotifyEvent,
  797. IN CLUSTER_RESOURCE_STATE CurrentState
  798. );
  799. //
  800. // Event processing routines
  801. //
  802. DWORD
  803. FmpStartWorkerThread(
  804. VOID
  805. );
  806. VOID
  807. FmpPostWorkItem(
  808. IN CLUSTER_EVENT Event,
  809. IN PVOID Context1,
  810. IN ULONG_PTR Context2
  811. );
  812. VOID
  813. FmpHandleGroupFailure(
  814. IN PFM_GROUP Group
  815. );
  816. DWORD
  817. FmpNodeUp(
  818. PVOID Context
  819. );
  820. DWORD
  821. FmpNodeDown(
  822. PVOID Context
  823. );
  824. VOID
  825. FmpPropagateState(
  826. VOID
  827. );
  828. DWORD
  829. FmpSetPossibleNodeForResType(
  830. IN LPCWSTR TypeName,
  831. IN BOOL bAssumeSupported
  832. );
  833. DWORD
  834. FmpRemovePossibleNodeForResType(
  835. IN LPCWSTR TypeName,
  836. IN PNM_NODE pNode
  837. );
  838. //
  839. // Object Manager callback routines.
  840. //
  841. DWORD
  842. WINAPI
  843. FmpQueryGroupInfo(
  844. IN PVOID Object,
  845. IN BOOL Initialize
  846. );
  847. DWORD
  848. WINAPI
  849. FmpQueryResourceInfo(
  850. IN PVOID Object,
  851. IN BOOL Initialize
  852. );
  853. DWORD
  854. WINAPI
  855. FmpQueryResTypeInfo(
  856. IN PVOID Object
  857. );
  858. DWORD
  859. WINAPI
  860. FmpFixupGroupInfo(
  861. IN PFM_GROUP Group
  862. );
  863. DWORD
  864. WINAPI
  865. FmpFixupResourceInfo(
  866. IN PFM_RESOURCE Resource
  867. );
  868. //
  869. // Synchronization macros
  870. //
  871. #define FmpAcquireResourceLock() EnterCriticalSection(&FmpResourceLock)
  872. #define FmpReleaseResourceLock() LeaveCriticalSection(&FmpResourceLock)
  873. #define FmpAcquireGroupLock() EnterCriticalSection(&FmpGroupLock)
  874. #define FmpReleaseGroupLock() LeaveCriticalSection(&FmpGroupLock)
  875. #define FmpAcquireMonitorLock() EnterCriticalSection(&FmpMonitorLock)
  876. #define FmpReleaseMonitorLock() LeaveCriticalSection(&FmpMonitorLock)
  877. #if 0
  878. // 185575: remove unique RPC binding handles
  879. #define FmpAcquireBindingLock() EnterCriticalSection(&FmpBindingLock)
  880. #define FmpReleaseBindingLock() LeaveCriticalSection(&FmpBindingLock)
  881. #endif
  882. #define FmpTryAcquireGroupLock( Locked, Timeout ) \
  883. { \
  884. DWORD _retry = (Timeout + 19) / 20; \
  885. do { \
  886. Locked = TryEnterCriticalSection(&FmpGroupLock); \
  887. if ( !Locked ) Sleep( 20 ); \
  888. } while (_retry-- && !Locked ); \
  889. }
  890. // Group and Resource Specific locks
  891. #if 1 // DBG
  892. #define FmpAcquireLocalGroupLock( Group ) \
  893. { \
  894. DWORD _fmpLockIndx; \
  895. EnterCriticalSection( &Group->Lock ); \
  896. _fmpLockIndx = Group->LockIndex & (FM_MAX_LOCK_ENTRIES - 1); \
  897. Group->LockTable[_fmpLockIndx].Module = LOG_MODULE; \
  898. Group->LockTable[_fmpLockIndx].ThreadId = GetCurrentThreadId(); \
  899. Group->LockTable[_fmpLockIndx].LineNumber = __LINE__; \
  900. Group->LockIndex = ++_fmpLockIndx; \
  901. }
  902. #define FmpTryAcquireLocalGroupLock( Group, Locked ) \
  903. { \
  904. DWORD _fmpLockIndx; \
  905. Locked = TryEnterCriticalSection( &Group->Lock ); \
  906. if ( Locked ) { \
  907. _fmpLockIndx = Group->LockIndex & (FM_MAX_LOCK_ENTRIES - 1); \
  908. Group->LockTable[_fmpLockIndx].Module = LOG_MODULE; \
  909. Group->LockTable[_fmpLockIndx].ThreadId = GetCurrentThreadId(); \
  910. Group->LockTable[_fmpLockIndx].LineNumber = __LINE__; \
  911. Group->LockIndex = ++_fmpLockIndx; \
  912. } \
  913. }
  914. #define FmpReleaseLocalGroupLock( Group ) \
  915. { \
  916. DWORD _fmpLockIndx; \
  917. CL_ASSERT(HandleToUlong(Group->Lock.OwningThread) == GetCurrentThreadId()); \
  918. _fmpLockIndx = Group->UnlockIndex & (FM_MAX_LOCK_ENTRIES - 1); \
  919. Group->UnlockTable[_fmpLockIndx].Module = LOG_MODULE; \
  920. Group->UnlockTable[_fmpLockIndx].ThreadId = GetCurrentThreadId(); \
  921. Group->UnlockTable[_fmpLockIndx].LineNumber = __LINE__; \
  922. Group->UnlockIndex = ++_fmpLockIndx; \
  923. LeaveCriticalSection( &Group->Lock ); \
  924. }
  925. #define FmpAcquireLocalResourceLock( Resource ) \
  926. { \
  927. DWORD _fmpLockIndx; \
  928. PFM_GROUP pGroup; \
  929. while( 1 ) { \
  930. pGroup = Resource->Group; \
  931. EnterCriticalSection( &pGroup->Lock );\
  932. if( pGroup == Resource->Group ) break; \
  933. LeaveCriticalSection( &pGroup->Lock ); \
  934. } \
  935. _fmpLockIndx = Resource->Group->LockIndex & (FM_MAX_LOCK_ENTRIES - 1); \
  936. Resource->Group->LockTable[_fmpLockIndx].Module = LOG_MODULE; \
  937. Resource->Group->LockTable[_fmpLockIndx].ThreadId = GetCurrentThreadId(); \
  938. Resource->Group->LockTable[_fmpLockIndx].LineNumber = __LINE__; \
  939. Resource->Group->LockIndex = ++_fmpLockIndx; \
  940. }
  941. #define FmpReleaseLocalResourceLock( Resource ) \
  942. { \
  943. DWORD _fmpLockIndx; \
  944. CL_ASSERT(HandleToUlong(Resource->Group->Lock.OwningThread) == GetCurrentThreadId()); \
  945. _fmpLockIndx = Resource->Group->UnlockIndex & (FM_MAX_LOCK_ENTRIES - 1); \
  946. Resource->Group->UnlockTable[_fmpLockIndx].Module = LOG_MODULE; \
  947. Resource->Group->UnlockTable[_fmpLockIndx].ThreadId = GetCurrentThreadId(); \
  948. Resource->Group->UnlockTable[_fmpLockIndx].LineNumber = __LINE__; \
  949. Resource->Group->UnlockIndex = ++_fmpLockIndx; \
  950. LeaveCriticalSection( &Resource->Group->Lock ); \
  951. }
  952. #define FmpTryAcquireLocalResourceLock( Resource, _Status_ ) \
  953. { \
  954. (_Status_) = TryEnterCriticalSection(&Resource->Group->Lock); \
  955. if ( !(_Status_) ) { \
  956. Sleep(100); \
  957. (_Status_) = TryEnterCriticalSection( &Resource->Group->Lock ); \
  958. } \
  959. if (_Status_) { \
  960. DWORD _fmpLockIndx; \
  961. _fmpLockIndx = Resource->Group->LockIndex & (FM_MAX_LOCK_ENTRIES - 1); \
  962. Resource->Group->LockTable[_fmpLockIndx].Module = LOG_MODULE; \
  963. Resource->Group->LockTable[_fmpLockIndx].ThreadId = GetCurrentThreadId(); \
  964. Resource->Group->LockTable[_fmpLockIndx].LineNumber = __LINE__; \
  965. Resource->Group->LockIndex = ++_fmpLockIndx; \
  966. } \
  967. }
  968. #else // DBG
  969. #define FmpAcquireLocalGroupLock( Group ) \
  970. EnterCriticalSection( &Group->Lock )
  971. #define FmpTryAcquireLocalGroupLock( Group, Locked ) \
  972. Locked = TryEnterCriticalSection( &Group->Lock )
  973. #define FmpReleaseLocalGroupLock( Group ) \
  974. LeaveCriticalSection( &Group->Lock )
  975. #define FmpAcquireLocalResourceLock( Resource ) \
  976. { \
  977. PFM_GROUP pGroup; \
  978. while( 1 ) { \
  979. pGroup = Resource->Group; \
  980. EnterCriticalSection( &pGroup->Lock );\
  981. if( pGroup == Resource->Group ) break; \
  982. LeaveCriticalSection( &pGroup->Lock ); \
  983. } \
  984. }
  985. #define FmpReleaseLocalResourceLock( Resource ) \
  986. LeaveCriticalSection( &Resource->Group->Lock )
  987. #define FmpTryAcquireLocalResourceLock( Resource, _result_ ) \
  988. if ( !((_result_) = TryEnterCriticalSection(&Resource->Group->Lock)) ) { \
  989. sleep(100); \
  990. (_result_) = TryEnterCriticalSection( &Resource->Group->Lock ); \
  991. }
  992. #endif // DBG
  993. //
  994. // Global Data
  995. //
  996. extern CRITICAL_SECTION FmpResourceLock;
  997. //
  998. // Resource Management Routines
  999. //
  1000. //
  1001. // Interfaces for managing resource trees.
  1002. //
  1003. DWORD
  1004. FmpRestartResourceTree(
  1005. IN PFM_RESOURCE Resource
  1006. );
  1007. DWORD
  1008. FmpOnlineWaitingTree(
  1009. IN PFM_RESOURCE Resource
  1010. );
  1011. DWORD
  1012. FmpOfflineWaitingTree(
  1013. IN PFM_RESOURCE Resource
  1014. );
  1015. //++
  1016. //
  1017. // Routine Description:
  1018. //
  1019. // Processes the Cluster resource list in the registry. For each
  1020. // resource key found, a cluster resource is created.
  1021. //
  1022. // Arguments:
  1023. //
  1024. // None.
  1025. //
  1026. // Return Value:
  1027. //
  1028. // None.
  1029. //
  1030. //--
  1031. DWORD
  1032. FmpInitResources(
  1033. VOID
  1034. );
  1035. VOID
  1036. FmpCleanupResources(
  1037. VOID
  1038. );
  1039. BOOL
  1040. FmpInPossibleListForResource(
  1041. IN PFM_RESOURCE pResource,
  1042. IN PNM_NODE pNode
  1043. );
  1044. DWORD
  1045. FmpInitResourceTypes(
  1046. VOID
  1047. );
  1048. PFM_RESTYPE
  1049. FmpCreateResType(
  1050. IN LPWSTR ResTypeName
  1051. );
  1052. DWORD
  1053. FmpDeleteResType(
  1054. IN PFM_RESTYPE pResType
  1055. );
  1056. BOOL
  1057. FmpFindResourceType(
  1058. IN PFM_RESTYPE Type,
  1059. IN PBOOL ResourceExists,
  1060. IN PFM_RESOURCE Resource,
  1061. IN LPCWSTR Name
  1062. );
  1063. BOOL
  1064. FmpInPossibleListForResType(
  1065. IN PFM_RESTYPE pResType,
  1066. IN PNM_NODE pNode
  1067. );
  1068. DWORD
  1069. FmpHandleResourceTypeControl(
  1070. IN PFM_RESTYPE Type,
  1071. IN DWORD ControlCode,
  1072. IN PUCHAR InBuffer,
  1073. IN DWORD InBufferSize,
  1074. OUT PUCHAR OutBuffer,
  1075. IN DWORD OutBufferSize,
  1076. OUT LPDWORD BytesReturned,
  1077. OUT LPDWORD Required
  1078. );
  1079. BOOL
  1080. FmpEnumResTypeNodeEvict(
  1081. IN PVOID Context1,
  1082. IN PVOID Context2,
  1083. IN PVOID Object,
  1084. IN LPCWSTR Name
  1085. );
  1086. VOID
  1087. FmpResTypeLastRef(
  1088. IN PFM_RESTYPE Resource
  1089. );
  1090. DWORD FmpAddPossibleNodeToList(
  1091. IN LPCWSTR pmszPossibleNodes,
  1092. IN DWORD dwStringSize,
  1093. IN PLIST_ENTRY pPosNodeList
  1094. );
  1095. BOOL
  1096. FmpFixupPossibleNodesForResTypeCb(
  1097. IN PVOID pContext1,
  1098. IN PVOID pContext2,
  1099. IN PFM_RESTYPE pResType,
  1100. IN LPCWSTR ResTypeName
  1101. );
  1102. BOOL
  1103. FmpFixupResTypePhase2Cb(
  1104. IN PVOID pContext1,
  1105. IN PVOID pContext2,
  1106. IN PFM_RESTYPE pResType,
  1107. IN LPCWSTR pszResTypeName
  1108. );
  1109. DWORD
  1110. FmpFixupResourceTypesPhase1(
  1111. BOOL bJoin,
  1112. BOOL bNmLocalNodeVersionChanged,
  1113. PCLUSTERVERSIONINFO pClusterVersionInfo
  1114. );
  1115. DWORD
  1116. FmpFixupResourceTypesPhase2(
  1117. BOOL bJoin,
  1118. BOOL bNmLocalNodeVersionChanged,
  1119. PCLUSTERVERSIONINFO pClusterVersionInfo
  1120. );
  1121. DWORD FmpDecidePossibleNodeForResType
  1122. (
  1123. IN PGUM_VOTE_DECISION_CONTEXT pDecisionContext,
  1124. IN DWORD dwVoteBufLength,
  1125. IN PVOID pVoteBuf,
  1126. IN DWORD dwNumVotes,
  1127. IN BOOL bDidAllActiveNodesVote,
  1128. OUT LPDWORD pdwOutputBufSize,
  1129. OUT PVOID *ppOutputBuf
  1130. );
  1131. PFM_RESOURCE
  1132. FmpFindResourceByNotifyKey(
  1133. RM_NOTIFY_KEY NotifyKey
  1134. );
  1135. DWORD
  1136. FmpTerminateResource(
  1137. IN PFM_RESOURCE Resource
  1138. );
  1139. DWORD
  1140. WINAPI
  1141. FmpEventHandler(
  1142. IN CLUSTER_EVENT Event,
  1143. IN PVOID Context
  1144. );
  1145. DWORD
  1146. WINAPI
  1147. FmpSyncEventHandler(
  1148. IN CLUSTER_EVENT Event,
  1149. IN PVOID Context
  1150. );
  1151. DWORD
  1152. FmpSyncArbitration(
  1153. IN DWORD NewPhase,
  1154. OUT LPDWORD CurrentPhase
  1155. );
  1156. DWORD
  1157. FmpEnumSortGroups(
  1158. OUT PGROUP_ENUM *ReturnEnum,
  1159. IN PNM_NODE OwnerNode OPTIONAL,
  1160. OUT PBOOL QuorumGroup
  1161. );
  1162. VOID
  1163. FmpPrepareGroupForOnline(
  1164. IN PFM_GROUP Group
  1165. );
  1166. DWORD
  1167. FmpSetGroupEnumOwner(
  1168. IN PGROUP_ENUM pGroupEnum,
  1169. IN PNM_NODE pDefaultOwnerNode,
  1170. IN PNM_NODE pDeadNode,
  1171. IN BOOL bQuorumGroup,
  1172. IN PFM_GROUP_NODE_LIST pGroupNodeList
  1173. );
  1174. DWORD
  1175. FmpOnlineGroupList(
  1176. IN PGROUP_ENUM GroupEnum,
  1177. IN BOOL bPrepareQuoForOnline
  1178. );
  1179. DWORD FmpOnlineGroupFromList(
  1180. IN PGROUP_ENUM GroupEnum,
  1181. IN DWORD Index,
  1182. IN BOOL bPrepareQuoForOnline
  1183. );
  1184. DWORD FmpOnlineResourceFromList(
  1185. IN PRESOURCE_ENUM GroupEnum
  1186. );
  1187. BOOL
  1188. FmpEqualGroupLists(
  1189. IN PGROUP_ENUM Group1,
  1190. IN PGROUP_ENUM Group2
  1191. );
  1192. DWORD
  1193. FmpOnlineGroup(
  1194. IN PFM_GROUP Group,
  1195. IN BOOL ForceOnline
  1196. );
  1197. DWORD
  1198. FmpOfflineGroup(
  1199. IN PFM_GROUP Group,
  1200. IN BOOL OfflineQuorum,
  1201. IN BOOL SetPersistent
  1202. );
  1203. DWORD
  1204. FmpDeleteGroup(
  1205. IN PFM_GROUP pGroup
  1206. );
  1207. DWORD
  1208. FmpMoveGroup(
  1209. IN PFM_GROUP Group,
  1210. IN PNM_NODE DestinationNode,
  1211. IN BOOL ShutdownHandler,
  1212. OUT PNM_NODE *pChosenDestinationNode,
  1213. IN BOOL bChooseMostPreferredNode
  1214. );
  1215. DWORD
  1216. FmpCompleteMoveGroup(
  1217. IN PFM_GROUP Group,
  1218. IN PNM_NODE DestinationNode
  1219. );
  1220. DWORD
  1221. FmpDoMoveGroup(
  1222. IN PFM_GROUP Group,
  1223. IN PNM_NODE DestinationNode,
  1224. IN BOOL bChooseMostPreferredNode
  1225. );
  1226. BOOL
  1227. FmpGroupCanMove(
  1228. IN PFM_GROUP Group
  1229. );
  1230. DWORD
  1231. FmpUpdateChangeGroupName(
  1232. IN BOOL SourceNode,
  1233. IN LPCWSTR ResourceId,
  1234. IN LPCWSTR NewName
  1235. );
  1236. DWORD
  1237. FmpUpdateDeleteGroup(
  1238. IN BOOL SourceNode,
  1239. IN LPCWSTR GroupId
  1240. );
  1241. BOOL
  1242. FmpEnumGroupNodeEvict(
  1243. IN PVOID Context1,
  1244. IN PVOID Context2,
  1245. IN PVOID Object,
  1246. IN LPCWSTR Name
  1247. );
  1248. PNM_NODE
  1249. FmpFindAnotherNode(
  1250. IN PFM_GROUP Group,
  1251. IN BOOL bChooseMostPreferredNode
  1252. );
  1253. PNM_NODE
  1254. FmpGetPreferredNode(
  1255. IN PFM_GROUP Group
  1256. );
  1257. //++
  1258. //
  1259. // Routine Description:
  1260. //
  1261. // Takes appropriate action based on resource state transitions indicated
  1262. // by the Resource Monitor.
  1263. //
  1264. // Arguments:
  1265. //
  1266. // Resource - The resource which has transitioned.
  1267. //
  1268. // NewState - The new state of Resource.
  1269. //
  1270. // Return Value:
  1271. //
  1272. // None.
  1273. //
  1274. //--
  1275. VOID
  1276. FmpHandleResourceTransition(
  1277. IN PFM_RESOURCE Resource,
  1278. IN CLUSTER_RESOURCE_STATE NewState
  1279. );
  1280. DWORD FmpCreateResStateChangeHandler(
  1281. IN PFM_RESOURCE pResource,
  1282. IN CLUSTER_RESOURCE_STATE NewState,
  1283. IN CLUSTER_RESOURCE_STATE OldState
  1284. );
  1285. VOID
  1286. FmpProcessResourceEvents(
  1287. IN PFM_RESOURCE pResource,
  1288. IN CLUSTER_RESOURCE_STATE NewState,
  1289. IN CLUSTER_RESOURCE_STATE OldState
  1290. );
  1291. VOID
  1292. FmpHandleResourceFailure(
  1293. IN PFM_RESOURCE Resource
  1294. );
  1295. //
  1296. // Group Management Routines
  1297. //
  1298. //++
  1299. //
  1300. // Routine Description:
  1301. //
  1302. // Processes the Cluster Group list in the registry. For each
  1303. // Group key found, a cluster Group is created.
  1304. //
  1305. // Arguments:
  1306. //
  1307. // None.
  1308. //
  1309. // Return Value:
  1310. //
  1311. // None.
  1312. //
  1313. //--
  1314. DWORD
  1315. FmpInitGroups(
  1316. IN BOOL Initialize
  1317. );
  1318. DWORD
  1319. FmpCompleteInitGroup(
  1320. IN PFM_GROUP Group
  1321. );
  1322. VOID
  1323. FmpCleanupGroups(
  1324. IN BOOL ClusterShutDownEvent
  1325. );
  1326. DWORD
  1327. FmpCleanupGroupPhase1(
  1328. IN PFM_GROUP Group,
  1329. IN DWORD dwTimeOut
  1330. );
  1331. DWORD
  1332. FmpCleanupGroupsWorker(
  1333. IN PFM_CLEANUP_INFO pFmCleanupInfo
  1334. );
  1335. DWORD
  1336. FmpCleanupGroupPhase2(
  1337. IN PFM_GROUP Group
  1338. );
  1339. DWORD FmpCleanupQuorumResource(
  1340. IN PFM_RESOURCE Resource
  1341. );
  1342. BOOL
  1343. FmpInPreferredList(
  1344. IN PFM_GROUP Group,
  1345. IN PNM_NODE Node,
  1346. IN BOOL bRecalc,
  1347. IN PFM_RESOURCE pRefResource
  1348. );
  1349. BOOL
  1350. FmpHigherInPreferredList(
  1351. IN PFM_GROUP Group,
  1352. IN PNM_NODE Node1,
  1353. IN PNM_NODE Node2
  1354. );
  1355. PFM_GROUP
  1356. FmpCreateGroup(
  1357. IN LPWSTR GroupId,
  1358. IN BOOL Initialize
  1359. );
  1360. DWORD FmpInitializeGroup(
  1361. IN PFM_GROUP Group,
  1362. IN BOOL Initialize
  1363. );
  1364. DWORD
  1365. FmpDestroyGroup(
  1366. IN PFM_GROUP Group,
  1367. IN BOOL bDeleteObjOnly
  1368. );
  1369. VOID
  1370. FmpSetGroupPersistentState(
  1371. IN PFM_GROUP Group,
  1372. IN CLUSTER_GROUP_STATE State
  1373. );
  1374. DWORD
  1375. FmpPropagateGroupState(
  1376. IN PFM_GROUP Group
  1377. );
  1378. DWORD
  1379. FmpPropagateFailureCount(
  1380. IN PFM_GROUP Group,
  1381. IN BOOL NewTime
  1382. );
  1383. DWORD
  1384. FmpGetGroupListState(
  1385. IN PGROUP_ENUM GroupEnum
  1386. );
  1387. DWORD
  1388. FmpOfflineGroupList(
  1389. IN PGROUP_ENUM GroupEnum
  1390. );
  1391. VOID
  1392. FmpGroupLastReference(
  1393. IN PFM_GROUP pGroup
  1394. );
  1395. //
  1396. // Stuff previously in fmclient.h
  1397. //
  1398. typedef
  1399. DWORD
  1400. (WINAPI *PSEND_MSG_ROUTINE) (
  1401. IN PGROUP_ENUM MyGroups,
  1402. IN PGROUP_ENUM OtherGroups,
  1403. OUT PGROUP_ENUM *ResponseOtherGroups,
  1404. OUT PGROUP_ENUM *ResponseMyGroups
  1405. );
  1406. //
  1407. // Global function prototypes
  1408. //
  1409. DWORD
  1410. FmcOnlineGroupRequest(
  1411. IN PFM_GROUP Group
  1412. );
  1413. DWORD
  1414. FmcOfflineGroupRequest(
  1415. IN PFM_GROUP Group
  1416. );
  1417. DWORD
  1418. FmcMoveGroupRequest(
  1419. IN PFM_GROUP Group,
  1420. IN PNM_NODE DestinationNode OPTIONAL
  1421. );
  1422. DWORD
  1423. FmcTakeGroupRequest(
  1424. IN PNM_NODE DestinationNode,
  1425. IN LPCWSTR GroupId,
  1426. IN PRESOURCE_ENUM ResourceList
  1427. );
  1428. DWORD
  1429. FmcDeleteGroupRequest(
  1430. IN PFM_GROUP pGroup
  1431. );
  1432. DWORD
  1433. FmcOnlineResourceRequest(
  1434. IN PFM_RESOURCE Resource
  1435. );
  1436. DWORD
  1437. FmcOfflineResourceRequest(
  1438. IN PFM_RESOURCE Resource
  1439. );
  1440. DWORD
  1441. FmcArbitrateResource(
  1442. IN PFM_RESOURCE Resource
  1443. );
  1444. DWORD
  1445. FmcFailResource(
  1446. IN PFM_RESOURCE Resource
  1447. );
  1448. PFM_RESOURCE
  1449. FmcCreateResource(
  1450. IN PFM_GROUP Group,
  1451. IN LPWSTR ResourceId,
  1452. IN LPCWSTR ResourceName,
  1453. IN LPCWSTR ResourceType,
  1454. IN DWORD dwFlags
  1455. );
  1456. DWORD
  1457. FmcDeleteResource(
  1458. IN PFM_RESOURCE Resource
  1459. );
  1460. CLUSTER_GROUP_STATE
  1461. FmcGetGroupState(
  1462. IN LPCWSTR GroupId,
  1463. OUT LPWSTR *NodeName
  1464. );
  1465. DWORD
  1466. FmcChangeResourceNode(
  1467. IN PFM_RESOURCE Resource,
  1468. IN PNM_NODE Node,
  1469. IN BOOL Add
  1470. );
  1471. DWORD
  1472. FmcResourceControl(
  1473. IN PNM_NODE Node,
  1474. IN PFM_RESOURCE Resource,
  1475. IN DWORD ControlCode,
  1476. IN PUCHAR InBuffer,
  1477. IN DWORD InBufferSize,
  1478. OUT PUCHAR OutBuffer,
  1479. IN DWORD OutBufferSize,
  1480. OUT LPDWORD BytesReturned,
  1481. OUT LPDWORD Required
  1482. );
  1483. DWORD
  1484. FmcResourceTypeControl(
  1485. IN PNM_NODE Node,
  1486. IN LPCWSTR ResourceTypeName,
  1487. IN DWORD ControlCode,
  1488. IN PUCHAR InBuffer,
  1489. IN DWORD InBufferSize,
  1490. OUT PUCHAR OutBuffer,
  1491. IN DWORD OutBufferSize,
  1492. OUT LPDWORD BytesReturned,
  1493. OUT LPDWORD Required
  1494. );
  1495. DWORD
  1496. FmcGroupControl(
  1497. IN PNM_NODE Node,
  1498. IN PFM_GROUP Group,
  1499. IN DWORD ControlCode,
  1500. IN PUCHAR InBuffer,
  1501. IN DWORD InBufferSize,
  1502. OUT PUCHAR OutBuffer,
  1503. IN DWORD OutBufferSize,
  1504. OUT LPDWORD BytesReturned,
  1505. OUT LPDWORD Required
  1506. );
  1507. DWORD
  1508. FmcPrepareQuorumResChange(
  1509. IN PFM_RESOURCE Resource,
  1510. IN LPCWSTR lpszQuoLogPath,
  1511. IN DWORD dwMaxQuoLogSize
  1512. );
  1513. DWORD
  1514. FmcCompleteQuorumResChange(
  1515. IN PFM_RESOURCE pOldQuoRes,
  1516. IN LPCWSTR lpszOldQuoLogPath
  1517. );
  1518. DWORD
  1519. FmcBackupClusterDatabase(
  1520. IN PFM_RESOURCE pQuoResource,
  1521. IN LPCWSTR lpszPathName
  1522. );
  1523. DWORD
  1524. FmcChangeResourceGroup(
  1525. IN PFM_RESOURCE pResource,
  1526. IN PFM_GROUP pNewGroup
  1527. );
  1528. DWORD
  1529. FmcAddResourceDependency(
  1530. IN PFM_RESOURCE pResource,
  1531. IN PFM_RESOURCE pDependentResource
  1532. );
  1533. DWORD
  1534. FmcRemoveResourceDependency(
  1535. IN PFM_RESOURCE pResource,
  1536. IN PFM_RESOURCE pDependentResource
  1537. );
  1538. DWORD
  1539. FmpGroupControl(
  1540. IN PFM_GROUP Group,
  1541. IN DWORD ControlCode,
  1542. IN PUCHAR InBuffer,
  1543. IN DWORD InBufferSize,
  1544. OUT PUCHAR OutBuffer,
  1545. IN DWORD OutBufferSize,
  1546. OUT LPDWORD BytesReturned,
  1547. OUT LPDWORD Required
  1548. );
  1549. DWORD
  1550. FmpHandleGroupControl(
  1551. IN PFM_GROUP Group,
  1552. IN DWORD ControlCode,
  1553. IN PUCHAR InBuffer,
  1554. IN DWORD InBufferSize,
  1555. OUT PUCHAR OutBuffer,
  1556. IN DWORD OutBufferSize,
  1557. OUT LPDWORD BytesReturned,
  1558. OUT LPDWORD Required
  1559. );
  1560. DWORD
  1561. FmpTakeGroupRequest(
  1562. IN PFM_GROUP Group,
  1563. IN PRESOURCE_ENUM ResourceList
  1564. );
  1565. CLUSTER_GROUP_STATE
  1566. FmpGetGroupState(
  1567. IN PFM_GROUP Group,
  1568. IN BOOL IsNormalized
  1569. );
  1570. VOID
  1571. FmpDeleteEnum(
  1572. IN PGROUP_ENUM Enum
  1573. );
  1574. DWORD
  1575. FmpClaimAllGroups(
  1576. PGROUP_ENUM MyGroups
  1577. );
  1578. DWORD
  1579. FmpAssignOwnersToGroups(
  1580. IN PNM_NODE pDeadNode,
  1581. IN PFM_GROUP pGroup,
  1582. IN PFM_GROUP_NODE_LIST pGroupNodeList
  1583. );
  1584. VOID
  1585. FmpPruneGroupOwners(
  1586. IN PFM_GROUP Group
  1587. );
  1588. DWORD
  1589. FmpQueryGroupNodes(
  1590. IN PFM_GROUP Group,
  1591. IN HDMKEY hGroupKey
  1592. );
  1593. DWORD
  1594. FmpUpdateChangeClusterName(
  1595. IN BOOL SourceNode,
  1596. IN LPCWSTR NewName
  1597. );
  1598. DWORD
  1599. FmpUpdateChangeQuorumResource(
  1600. IN BOOL SourceNode,
  1601. IN LPCWSTR NewQuorumResId,
  1602. IN LPCWSTR pszQuorumLogPath,
  1603. IN LPDWORD pdwMaxQuorumLogSize
  1604. );
  1605. DWORD
  1606. FmpUpdateResourceState(
  1607. IN BOOL SourceNode,
  1608. IN LPCWSTR ResourceId,
  1609. IN PGUM_RESOURCE_STATE ResourceState
  1610. );
  1611. DWORD
  1612. FmpUpdateGroupState(
  1613. IN BOOL SourceNode,
  1614. IN LPCWSTR GroupId,
  1615. IN LPCWSTR NodeId,
  1616. IN PGUM_GROUP_STATE ResourceState
  1617. );
  1618. DWORD
  1619. FmpUpdateGroupNode(
  1620. IN BOOL SourceNode,
  1621. IN LPCWSTR GroupId,
  1622. IN LPCWSTR NodeId
  1623. );
  1624. DWORD
  1625. FmpUpdateGroupIntendedOwner(
  1626. IN BOOL SourceNode,
  1627. IN LPCWSTR pszGroupId,
  1628. IN PDWORD pdwNodeId
  1629. );
  1630. //
  1631. // Handle group property requests
  1632. //
  1633. DWORD
  1634. FmpGroupEnumCommonProperties(
  1635. OUT PVOID OutBuffer,
  1636. IN DWORD OutBufferSize,
  1637. OUT LPDWORD BytesReturned,
  1638. OUT LPDWORD Required
  1639. );
  1640. DWORD
  1641. FmpGroupEnumPrivateProperties(
  1642. IN PFM_GROUP Group,
  1643. OUT PVOID OutBuffer,
  1644. IN DWORD OutBufferSize,
  1645. OUT LPDWORD BytesReturned,
  1646. OUT LPDWORD Required
  1647. );
  1648. DWORD
  1649. FmpGroupGetCommonProperties(
  1650. IN PFM_GROUP Group,
  1651. IN BOOL ReadOnly,
  1652. OUT PVOID OutBuffer,
  1653. IN DWORD OutBufferSize,
  1654. OUT LPDWORD BytesReturned,
  1655. OUT LPDWORD Required
  1656. );
  1657. DWORD
  1658. FmpGroupValidateCommonProperties(
  1659. IN PFM_GROUP Group,
  1660. IN PVOID InBuffer,
  1661. IN DWORD InBufferSize
  1662. );
  1663. DWORD
  1664. FmpGroupSetCommonProperties(
  1665. IN PFM_GROUP Group,
  1666. IN PVOID InBuffer,
  1667. IN DWORD InBufferSize
  1668. );
  1669. DWORD
  1670. FmpGroupGetPrivateProperties(
  1671. IN PFM_GROUP Group,
  1672. OUT PVOID OutBuffer,
  1673. IN DWORD OutBufferSize,
  1674. OUT LPDWORD BytesReturned,
  1675. OUT LPDWORD Required
  1676. );
  1677. DWORD
  1678. FmpGroupValidatePrivateProperties(
  1679. IN PFM_GROUP Group,
  1680. IN PVOID InBuffer,
  1681. IN DWORD InBufferSize
  1682. );
  1683. DWORD
  1684. FmpGroupSetPrivateProperties(
  1685. IN PFM_GROUP Group,
  1686. IN PVOID InBuffer,
  1687. IN DWORD InBufferSize
  1688. );
  1689. DWORD
  1690. FmpGroupGetFlags(
  1691. IN PFM_GROUP Group,
  1692. OUT PVOID OutBuffer,
  1693. IN DWORD OutBufferSize,
  1694. OUT LPDWORD BytesReturned,
  1695. OUT LPDWORD Required
  1696. );
  1697. //property parse routines
  1698. DWORD FmpGetDiskInfoParseProperties(
  1699. IN PUCHAR InBuffer,
  1700. IN DWORD InBufferSize,
  1701. IN OUT LPWSTR pszPath
  1702. );
  1703. DWORD
  1704. FmpBroadcastDeleteControl(
  1705. IN PFM_RESOURCE Resource
  1706. );
  1707. DWORD
  1708. FmpBroadcastDependencyChange(
  1709. IN PFM_RESOURCE Resource,
  1710. IN LPCWSTR DependsOnId,
  1711. IN BOOL Remove
  1712. );
  1713. BOOL
  1714. FmpCheckNetworkDependency(
  1715. IN LPCWSTR DependentNetwork
  1716. );
  1717. DWORD FmpVotePossibleNodeForResType(
  1718. IN DWORD dwInputBufLength,
  1719. IN LPCWSTR lpszResType,
  1720. IN DWORD dwVoteLength,
  1721. OUT PVOID pVoteBuf
  1722. );
  1723. DWORD
  1724. FmpUpdatePossibleNodeForResType(
  1725. IN BOOL SourceNode,
  1726. IN LPCWSTR lpszResTypeName,
  1727. IN LPDWORD pdwBufLength,
  1728. IN PVOID pBuf
  1729. );
  1730. DWORD
  1731. FmpUpdateChangeResourceNode(
  1732. IN BOOL SourceNode,
  1733. IN PFM_RESOURCE pResource,
  1734. IN PNM_NODE pNode,
  1735. IN DWORD dwControlCode
  1736. );
  1737. DWORD FmpUpdateChangeResourceGroup(
  1738. IN BOOL bSourceNode,
  1739. IN PFM_RESOURCE pResource,
  1740. IN PFM_GROUP pNewGroup
  1741. );
  1742. DWORD FmpChangeResourceNode(
  1743. IN PFM_RESOURCE Resource,
  1744. IN LPCWSTR NodeId,
  1745. IN BOOL Add
  1746. );
  1747. DWORD
  1748. FmpFixupPossibleNodesForResources(
  1749. BOOL bJoin
  1750. );
  1751. BOOL
  1752. FmpEnumFixupPossibleNodesForResource(
  1753. IN PVOID pContext1,
  1754. IN PVOID pContext2,
  1755. IN PFM_RESOURCE pResource,
  1756. IN LPCWSTR pszResName
  1757. );
  1758. DWORD
  1759. FmpQueueTimerActivity(
  1760. IN DWORD dwInterval,
  1761. IN PFN_TIMER_CALLBACK pfnTimerCb,
  1762. IN PVOID pContext
  1763. );
  1764. DWORD
  1765. FmpDelayedStartRes(
  1766. IN PFM_RESOURCE pResource
  1767. );
  1768. //timer callback functions
  1769. void
  1770. WINAPI
  1771. FmpReslistOnlineRetryCb(
  1772. IN HANDLE hTimer,
  1773. IN PVOID pContext
  1774. );
  1775. VOID
  1776. FmpDelayedRestartCb(
  1777. IN HANDLE hTimer,
  1778. IN PVOID pContext
  1779. );
  1780. DWORD
  1781. FmpDoMoveGroupOnFailure(
  1782. IN LPVOID pContext
  1783. );
  1784. DWORD
  1785. FmpSetOwnerForGroup(
  1786. IN PFM_GROUP pGroup,
  1787. IN PNM_NODE pNode
  1788. );
  1789. DWORD
  1790. FmpSetIntendedOwnerForGroup(
  1791. IN PFM_GROUP pGroup,
  1792. IN DWORD dwNodeId
  1793. );
  1794. VOID
  1795. FmpResetGroupIntendedOwner(
  1796. IN PGROUP_ENUM pGroupEnum
  1797. );
  1798. DWORD
  1799. FmpGetGroupInNodeGroupList(
  1800. OUT PGROUP_ENUM *pReturnEnum,
  1801. IN PFM_GROUP pGroup,
  1802. IN PNM_NODE pDeadNode,
  1803. OUT PBOOL pbQuorumGroup
  1804. );
  1805. VOID
  1806. FmpPrepareGroupEnumForOnline(
  1807. IN PGROUP_ENUM pGroupEnum
  1808. );
  1809. DWORD
  1810. FmpRmExceptionFilter(
  1811. DWORD ExceptionCode
  1812. );
  1813. DWORD
  1814. FmpBringQuorumGroupListOnline(
  1815. IN LPVOID pContext
  1816. );
  1817. DWORD
  1818. FmpHandleNodeDownEvent(
  1819. IN PVOID pContext
  1820. );
  1821. DWORD
  1822. FmpEnumerateGroupResources(
  1823. IN PFM_GROUP pGroup,
  1824. IN FM_ENUM_GROUP_RESOURCE_ROUTINE pfnEnumerationRoutine,
  1825. IN PVOID pContext1,
  1826. IN PVOID pContext2
  1827. );
  1828. PNM_NODE
  1829. FmpGetNonLocalPreferredNode(
  1830. IN PFM_GROUP Group
  1831. );
  1832. DWORD
  1833. FmpGetResourceCharacteristics(
  1834. IN PFM_RESOURCE pQuoResource,
  1835. OUT LPDWORD pdwCharacteristics
  1836. );
  1837. BOOL
  1838. FmpIsAnyResourcePersistentStateOnline(
  1839. IN PFM_GROUP pGroup
  1840. );
  1841. PNM_NODE
  1842. FmpGetNodeNotHostingUndesiredGroups(
  1843. IN PFM_GROUP pGroup,
  1844. IN BOOL fRuleOutLocalNode
  1845. );
  1846. BOOL
  1847. FmpCheckForAntiAffinityProperty(
  1848. IN LPCWSTR lpszLimitOneGroupPerName,
  1849. IN PGROUP_AFFINITY_NODE_INFO pGroupAffinityNodeInfo,
  1850. IN PFM_GROUP pGroup,
  1851. IN LPCWSTR lpszGroupName
  1852. );
  1853. DWORD
  1854. FmpUpgradeResourceDLL(
  1855. IN PFM_RESOURCE pResource,
  1856. IN LPWSTR lpszInstallationPath
  1857. );
  1858. DWORD
  1859. FmpParsePathForFileName(
  1860. IN LPWSTR lpszPath,
  1861. IN BOOL fCheckPathExists,
  1862. OUT LPWSTR *ppszFileName
  1863. );
  1864. DWORD
  1865. FmpValidateResourceDLLReplacement(
  1866. IN PFM_RESOURCE pResource,
  1867. IN LPWSTR lpszNewDllName,
  1868. OUT LPWSTR lpszCurrentDllPath
  1869. );
  1870. DWORD
  1871. FmpReplaceResourceDLL(
  1872. IN LPWSTR lpszNewDllName,
  1873. IN LPWSTR lpszCurrentDllPath,
  1874. IN LPWSTR lpszInstallationPath
  1875. );
  1876. DWORD
  1877. FmpRecycleMonitors(
  1878. IN LPCWSTR lpszDllName
  1879. );
  1880. DWORD
  1881. FmpCreateMonitorList(
  1882. IN LPCWSTR lpszDllName,
  1883. OUT PFM_MONITOR_ENUM_HEADER pMonitorHeader
  1884. );
  1885. BOOL
  1886. FmpFindHostMonitors(
  1887. IN LPCWSTR lpszDllName,
  1888. IN OUT PFM_MONITOR_ENUM_HEADER pMonitorEnumHeader,
  1889. IN PFM_RESOURCE pResource,
  1890. IN LPCWSTR lpszResourceId
  1891. );
  1892. DWORD
  1893. FmpRecoverResourceDLLFiles(
  1894. VOID
  1895. );
  1896. DWORD
  1897. FmpResetMultiSzValue(
  1898. IN HKEY hKey,
  1899. IN LPWSTR lpmszList,
  1900. IN OUT LPDWORD pcchLen,
  1901. IN LPCWSTR lpszValueName,
  1902. IN LPCWSTR lpszString
  1903. );
  1904. DWORD
  1905. FmpCopyBackupFile(
  1906. IN LPCWSTR lpszPath
  1907. );
  1908. VOID
  1909. FmpDeleteBackupFiles(
  1910. IN LPCWSTR lpszPath OPTIONAL
  1911. );
  1912. PNM_NODE
  1913. FmpPickNodeFromPreferredListAtRandom(
  1914. IN PFM_GROUP pGroup,
  1915. IN PNM_NODE pSuggestedPreferredNode OPTIONAL,
  1916. IN BOOL fRuleOutLocalNode,
  1917. IN BOOL fCheckForDisablingRandomization
  1918. );
  1919. BOOL
  1920. FmpIsNodeUserPreferred(
  1921. IN PFM_GROUP pGroup,
  1922. IN PNM_NODE pPreferredNode
  1923. );
  1924. DWORD
  1925. FmpPrepareGroupNodeList(
  1926. OUT PFM_GROUP_NODE_LIST *ppGroupNodeList
  1927. );
  1928. DWORD
  1929. FmpAddGroupNodeToList(
  1930. IN PFM_GROUP_NODE_LIST *ppGroupNodeList,
  1931. IN LPDWORD pcbBuffer,
  1932. IN PFM_GROUP pGroup,
  1933. IN LPCWSTR lpszGroupId
  1934. );
  1935. PNM_NODE
  1936. FmpParseGroupNodeListForPreferredOwner(
  1937. IN PFM_GROUP pGroup,
  1938. IN PFM_GROUP_NODE_LIST pGroupNodeList,
  1939. IN PNM_NODE pSuggestedPreferredNode
  1940. );
  1941. DWORD
  1942. FmpUpdateUseRandomizedNodeListForGroups(
  1943. IN BOOL SourceNode,
  1944. IN LPCWSTR pszNodeId,
  1945. IN PFM_GROUP_NODE_LIST pGroupNodeList
  1946. );
  1947. #endif //ifndef _FMP_H