Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

837 lines
22 KiB

  1. #ifndef _RESMONP_H
  2. #define _RESMONP_H
  3. /*++
  4. Copyright (c) 1995-1997 Microsoft Corporation
  5. Module Name:
  6. resmonp.h
  7. Abstract:
  8. Private header file for the Resource Monitor component
  9. Author:
  10. John Vert (jvert) 30-Nov-1995
  11. Revision History:
  12. Sivaprasad Padisetty (sivapad) 06-18-1997 Added the COM support
  13. --*/
  14. #include "windows.h"
  15. #include "cluster.h"
  16. #include "rm_rpc.h"
  17. #include "monmsg.h"
  18. #ifdef COMRES
  19. #define COBJMACROS
  20. #include "comres.h"
  21. #endif
  22. #define LOG_CURRENT_MODULE LOG_MODULE_RESMON
  23. //
  24. // internal module identifiers. Not used with ClRtl logging code. Used to
  25. // track lock acquisitions.
  26. //
  27. #define RESMON_MODULE_EVNTLIST 1
  28. #define RESMON_MODULE_NOTIFY 2
  29. #define RESMON_MODULE_POLLER 3
  30. #define RESMON_MODULE_PROPERTY 4
  31. #define RESMON_MODULE_RESLIST 5
  32. #define RESMON_MODULE_RESMON 6
  33. #define RESMON_MODULE_RMAPI 7
  34. #define RESMON_MODULE_DLOCK 8
  35. //
  36. // Define the maximum number of resources handled per thread.
  37. // (This value must be smaller than MAXIMUM_WAIT_OBJECTS-2!)
  38. //
  39. #define MAX_RESOURCES_PER_THREAD 27
  40. //
  41. // 2 additional handles that are watched -- ListNotify and hEventShutdown
  42. //
  43. #define MAX_HANDLES_PER_THREAD (MAX_RESOURCES_PER_THREAD+2)
  44. //
  45. // Define the maximum number of threads.
  46. // (This value can be up to MAXIMUM_WAIT_OBJECTS, however the first two
  47. // entries are taken by events, so in fact we have 2 less threads available).
  48. //
  49. #define MAX_THREADS (MAXIMUM_WAIT_OBJECTS)
  50. //
  51. // Define structure and flags used for each resource entry
  52. //
  53. #define RESOURCE_SIGNATURE 'crsR'
  54. extern RESUTIL_PROPERTY_ITEM RmpResourceCommonProperties[];
  55. extern RESUTIL_PROPERTY_ITEM RmpResourceTypeCommonProperties[];
  56. typedef struct _POLL_EVENT_LIST;
  57. typedef struct _POLL_EVENT_LIST *PPOLL_EVENT_LIST;
  58. //
  59. // Lock Info for debugging lock acquires/releases
  60. //
  61. typedef struct _LOCK_INFO {
  62. DWORD Module: 6;
  63. DWORD ThreadId: 11;
  64. DWORD LineNumber: 15;
  65. } LOCK_INFO, *PLOCK_INFO;
  66. //
  67. // Entry points
  68. //
  69. #define RESDLL_ENTRY_CLOSE 0x00000001
  70. #define RESDLL_ENTRY_TERMINATE 0x00000002
  71. //
  72. // Flags
  73. //
  74. #define RESOURCE_INSERTED 1
  75. typedef struct _RESOURCE {
  76. ULONG Signature; // 'Rsrc'
  77. ULONG Flags;
  78. LIST_ENTRY ListEntry; // for linking onto monitoring list
  79. LPWSTR DllName;
  80. LPWSTR ResourceType;
  81. LPWSTR ResourceId;
  82. LPWSTR ResourceName;
  83. DWORD LooksAlivePollInterval;
  84. DWORD IsAlivePollInterval;
  85. HINSTANCE Dll; // handle to resource's DLL
  86. RESID Id;
  87. HANDLE EventHandle; // async error notification handle
  88. HANDLE OnlineEvent;
  89. #ifdef COMRES
  90. #define RESMON_TYPE_DLL 1
  91. #define RESMON_TYPE_COM 2
  92. // TODO define this as a union
  93. IClusterResource *pClusterResource ;
  94. IClusterResControl *pClusterResControl ;
  95. IClusterQuorumResource *pClusterQuorumResource ;
  96. DWORD dwType ; // Type of resource whether it is DLL or a COMResources
  97. POPEN_ROUTINE pOpen;
  98. PCLOSE_ROUTINE pClose;
  99. PONLINE_ROUTINE pOnline;
  100. POFFLINE_ROUTINE pOffline;
  101. PTERMINATE_ROUTINE pTerminate;
  102. PIS_ALIVE_ROUTINE pIsAlive;
  103. PLOOKS_ALIVE_ROUTINE pLooksAlive;
  104. PARBITRATE_ROUTINE pArbitrate;
  105. PRELEASE_ROUTINE pRelease;
  106. PRESOURCE_CONTROL_ROUTINE pResourceControl;
  107. PRESOURCE_TYPE_CONTROL_ROUTINE pResourceTypeControl;
  108. #else
  109. POPEN_ROUTINE Open;
  110. PCLOSE_ROUTINE Close;
  111. PONLINE_ROUTINE Online;
  112. POFFLINE_ROUTINE Offline;
  113. PTERMINATE_ROUTINE Terminate;
  114. PIS_ALIVE_ROUTINE IsAlive;
  115. PLOOKS_ALIVE_ROUTINE LooksAlive;
  116. PARBITRATE_ROUTINE Arbitrate;
  117. PRELEASE_ROUTINE Release;
  118. PRESOURCE_CONTROL_ROUTINE ResourceControl;
  119. PRESOURCE_TYPE_CONTROL_ROUTINE ResourceTypeControl;
  120. #endif
  121. CLUSTER_RESOURCE_STATE State;
  122. ULONG IsAliveCount;
  123. ULONG IsAliveRollover;
  124. RM_NOTIFY_KEY NotifyKey;
  125. PPOLL_EVENT_LIST EventList;
  126. HANDLE TimerEvent; // Timer event for offline completion.
  127. DWORD PendingTimeout;
  128. DWORD CheckPoint; // Online pending checkpoint
  129. BOOL IsArbitrated;
  130. DWORD dwEntryPoint; // Number indicating which resdll entry point is called.
  131. BOOL fArbLock; // Variable used for synchronizing arbitrate with close and rundown
  132. } RESOURCE, *PRESOURCE;
  133. #ifdef COMRES
  134. extern DWORD tidActiveXWorker ; // ThreadID for the COM worker thread
  135. #define WM_RES_CREATE WM_USER+1
  136. #define WM_RES_OPEN WM_USER+2
  137. #define WM_RES_CLOSE WM_USER+3
  138. #define WM_RES_ONLINE WM_USER+4
  139. #define WM_RES_OFFLINE WM_USER+5
  140. #define WM_RES_TERMINATE WM_USER+6
  141. #define WM_RES_ISALIVE WM_USER+7
  142. #define WM_RES_LOOKSALIVE WM_USER+8
  143. #define WM_RES_ARBITRATE WM_USER+9
  144. #define WM_RES_RELEASE WM_USER+10
  145. #define WM_RES_EXITTHREAD WM_USER+11
  146. #define WM_RES_FREE WM_USER+12
  147. #define WM_RES_RESOURCECONTROL WM_USER+11
  148. #define WM_RES_RESOURCETYPECONTROL WM_USER+12
  149. DWORD WINAPI ActiveXWorkerThread (LPVOID pThreadInfo) ;
  150. typedef struct {
  151. PRESOURCE Resource ;
  152. LPVOID Data1 ; // For ResourceKey in Open & EvenHandle in Online
  153. DWORD status ; // This is the Com Status indicating if the function is actually called.
  154. LONG Ret ; // Actual Return Value of the functions like IsAlive, LooksAlive etc.
  155. } COMWORKERTHREADPARAM, *PCOMWORKERTHREADPARAM ;
  156. DWORD PostWorkerMessage (DWORD tid, UINT msg, PCOMWORKERTHREADPARAM pData) ;
  157. RESID
  158. Resmon_Open (
  159. IN PRESOURCE Resource,
  160. IN HKEY ResourceKey
  161. );
  162. VOID
  163. Resmon_Close (
  164. IN PRESOURCE Resource
  165. );
  166. DWORD
  167. Resmon_Online (
  168. IN PRESOURCE Resource,
  169. IN OUT LPHANDLE EventHandle
  170. );
  171. DWORD
  172. Resmon_Offline (
  173. IN PRESOURCE Resource
  174. );
  175. VOID
  176. Resmon_Terminate (
  177. IN PRESOURCE Resource
  178. );
  179. BOOL
  180. Resmon_LooksAlive (
  181. IN PRESOURCE Resource
  182. );
  183. BOOL
  184. Resmon_IsAlive (
  185. IN PRESOURCE Resource
  186. );
  187. DWORD
  188. Resmon_Arbitrate (
  189. IN PRESOURCE Resource,
  190. IN PQUORUM_RESOURCE_LOST LostQuorumResource
  191. ) ;
  192. DWORD
  193. Resmon_Release (
  194. IN PRESOURCE Resource
  195. ) ;
  196. DWORD
  197. Resmon_ResourceControl (
  198. IN PRESOURCE Resource,
  199. IN DWORD ControlCode,
  200. IN PVOID InBuffer,
  201. IN DWORD InBufferSize,
  202. OUT PVOID OutBuffer,
  203. IN DWORD OutBufferSize,
  204. OUT LPDWORD BytesReturned
  205. ) ;
  206. #define RESMON_OPEN(Resource, ResKey) Resmon_Open(Resource, ResKey)
  207. #define RESMON_CLOSE(Resource) Resmon_Close(Resource)
  208. #define RESMON_ONLINE(Resource, EventHandle) Resmon_Online(Resource, EventHandle)
  209. #define RESMON_OFFLINE(Resource) Resmon_Offline(Resource)
  210. #define RESMON_TERMINATE(Resource) Resmon_Terminate(Resource)
  211. #define RESMON_ISALIVE(Resource) Resmon_IsAlive(Resource)
  212. #define RESMON_LOOKSALIVE(Resource) Resmon_LooksAlive(Resource)
  213. #define RESMON_ARBITRATE(Resource, RmpLostQuorumResource) \
  214. Resmon_Arbitrate (Resource, RmpLostQuorumResource)
  215. #define RESMON_RELEASE(Resource) \
  216. Resmon_Release (Resource)
  217. #define RESMON_RESOURCECONTROL(Resource, ControlCode, InBuffer, InBufferSize, OutBuffer, OutBufferSize, BytesReturned) \
  218. Resmon_ResourceControl (Resource, ControlCode, InBuffer, InBufferSize, OutBuffer, OutBufferSize, BytesReturned)
  219. #endif // COMRES
  220. typedef struct _RESDLL_FNINFO{
  221. HINSTANCE hDll;
  222. PCLRES_FUNCTION_TABLE pResFnTable;
  223. }RESDLL_FNINFO, *PRESDLL_FNINFO;
  224. #ifdef COMRES
  225. typedef struct _RESDLL_INTERFACES{
  226. IClusterResource *pClusterResource ;
  227. IClusterResControl *pClusterResControl ;
  228. IClusterQuorumResource *pClusterQuorumResource ;
  229. }RESDLL_INTERFACES, *PRESDLL_INTERFACES;
  230. #endif
  231. typedef struct _MONITOR_BUCKET {
  232. LIST_ENTRY BucketList; // For chaining buckets together.
  233. LIST_ENTRY ResourceList; // List of resources in this bucket
  234. DWORDLONG DueTime; // Next time that these resources should be polled
  235. DWORDLONG Period; // Periodic interval of this bucket.
  236. } MONITOR_BUCKET, *PMONITOR_BUCKET;
  237. //
  238. // The Poll Event List structure.
  239. //
  240. typedef struct _POLL_EVENT_LIST {
  241. LIST_ENTRY Next; // Next event list
  242. LIST_ENTRY BucketListHead; // Bucket Listhead for this list/thread
  243. DWORD NumberOfBuckets; // Number of entries on this bucket list
  244. DWORD NumberOfResources; // Number of resources on this event list
  245. CRITICAL_SECTION ListLock; // Critical section to add/remove events
  246. LOCK_INFO PPrevPrevListLock;
  247. LOCK_INFO PrevPrevListLock;
  248. LOCK_INFO PrevListLock;
  249. LOCK_INFO LastListLock;
  250. LOCK_INFO LastListUnlock;
  251. LOCK_INFO PrevListUnlock;
  252. LOCK_INFO PrevPrevListUnlock;
  253. LOCK_INFO PPrevPrevListUnlock;
  254. HANDLE ListNotify; // List change notification
  255. HANDLE ThreadHandle; // Handle of thread processing this list
  256. DWORD EventCount; // Number of events/resources in lists
  257. HANDLE Handle[MAX_HANDLES_PER_THREAD]; // Array of handles to wait for
  258. PRESOURCE Resource[MAX_HANDLES_PER_THREAD]; // Resources that match handles
  259. PRESOURCE LockOwnerResource; // Resource that owns the eventlist lock
  260. DWORD MonitorState; // Resdll entry point called.
  261. HANDLE hEventShutdown; // Shutdown notification
  262. } POLL_EVENT_LIST, *PPOLL_EVENT_LIST;
  263. #define POLL_GRANULARITY (10) // 10ms
  264. #define PENDING_TIMEOUT (3*1000*60) // 3 minutes for pending requests to finish
  265. #define RM_DMP_FILE_NAME L"\\resrcmon.dmp"
  266. //
  267. // Used in RmpAcquireSpinLock
  268. //
  269. #define RESMON_MAX_SLOCK_RETRIES 400
  270. //
  271. // Used in deadlock monitoring
  272. //
  273. #define RESMON_MAX_NAME_LEN 80
  274. //
  275. // There could at most MAX_THREADS blocked inside resource dll entry points making resource
  276. // calls. Let us add a few more for resource type controls.
  277. //
  278. #define RESMON_MAX_DEADLOCK_MONITOR_ENTRIES MAX_THREADS * 2
  279. //
  280. // Interval at which the deadlock timer thread kicks in
  281. //
  282. #define RESMON_DEADLOCK_TIMER_INTERVAL 5 * 1000 // 5 secs
  283. #define RM_DUE_TIME_MONITORED_ENTRY_SIGNATURE 'mLDD'
  284. #define RM_DUE_TIME_FREE_ENTRY_SIGNATURE 'fLDD'
  285. #define RM_DUE_TIME_FREE_LIST_HEAD_SIGNATURE 'hLDD'
  286. #define RM_DUE_TIME_MONITORED_LIST_HEAD_SIGNATURE 'tLDD'
  287. //
  288. // Structures used for deadlock monitoring
  289. //
  290. typedef struct _RM_DUE_TIME_MONITORED_LIST_HEAD
  291. {
  292. DWORD dwSignature; // Signature of this list head
  293. ULONGLONG ullDeadLockTimeoutSecs; // Deadlock timeout in seconds
  294. LIST_ENTRY leDueTimeEntry; // Link to the first (& last) entry
  295. } RM_DUE_TIME_MONITORED_LIST_HEAD, *PRM_DUE_TIME_MONITORED_LIST_HEAD;
  296. typedef struct _RM_DUE_TIME_FREE_LIST_HEAD
  297. {
  298. DWORD dwSignature; // Signature of this list head
  299. LIST_ENTRY leDueTimeEntry; // Link to the first (& last) entry
  300. } RM_DUE_TIME_FREE_LIST_HEAD, *PRM_DUE_TIME_FREE_LIST_HEAD;
  301. typedef struct _RM_DUE_TIME_ENTRY
  302. {
  303. DWORD dwSignature; // Signature of this entry
  304. LIST_ENTRY leDueTimeEntry; // Link to the next (& previous) entry
  305. RESOURCE_MONITOR_STATE EntryPointCalled; // Resource DLL entry point name
  306. ULARGE_INTEGER uliDueTime; // Time at which a deadlock will be flagged
  307. DWORD dwThreadId; // Thread ID tha insert this entry
  308. WCHAR szResourceDllName[ RESMON_MAX_NAME_LEN ];
  309. // Name of the resource dll whose entry point
  310. // has been called
  311. WCHAR szResourceTypeName [ RESMON_MAX_NAME_LEN ];
  312. // Name of the resource type
  313. WCHAR szResourceName [ RESMON_MAX_NAME_LEN ];
  314. // Name of the resource if this is a
  315. // resource entry point
  316. WCHAR szEntryPointName [ 30 ];
  317. // Name of the entry point called
  318. } RM_DUE_TIME_ENTRY, *PRM_DUE_TIME_ENTRY;
  319. //
  320. // Private helper macros and functions
  321. //
  322. VOID
  323. RmpSetEventListLockOwner(
  324. IN PRESOURCE pResource,
  325. IN DWORD dwMonitorState
  326. );
  327. #define RmpAlloc(size) LocalAlloc(LMEM_FIXED, (size))
  328. #define RmpFree(size) LocalFree((size))
  329. #define RmpSetMonitorState(state, resource) \
  330. EnterCriticalSection(&RmpMonitorStateLock); \
  331. GetSystemTimeAsFileTime((PFILETIME)&RmpSharedState->LastUpdate); \
  332. RmpSharedState->State = (state); \
  333. RmpSharedState->ActiveResource = (HANDLE)(resource); \
  334. LeaveCriticalSection(&RmpMonitorStateLock); \
  335. RmpSetEventListLockOwner( resource, state )
  336. #define AcquireListLock() \
  337. EnterCriticalSection( &RmpListLock ); \
  338. RmpListPPrevPrevLock = RmpListPrevPrevLock; \
  339. RmpListPrevPrevLock = RmpListPrevLock; \
  340. RmpListPrevLock = RmpListLastLock; \
  341. RmpListLastLock.Module = RESMON_MODULE; \
  342. RmpListLastLock.ThreadId = GetCurrentThreadId(); \
  343. RmpListLastLock.LineNumber = __LINE__
  344. #define ReleaseListLock() \
  345. RmpListPPrevPrevUnlock = RmpListPrevPrevUnlock; \
  346. RmpListPrevPrevUnlock = RmpListPrevUnlock; \
  347. RmpListPrevUnlock = RmpListLastUnlock; \
  348. RmpListLastUnlock.Module = RESMON_MODULE; \
  349. RmpListLastUnlock.ThreadId = GetCurrentThreadId(); \
  350. RmpListLastUnlock.LineNumber = __LINE__; \
  351. LeaveCriticalSection( &RmpListLock )
  352. #define AcquireEventListLock( EventList ) \
  353. EnterCriticalSection( &(EventList)->ListLock ); \
  354. (EventList)->PPrevPrevListLock = (EventList)->PrevPrevListLock; \
  355. (EventList)->PrevPrevListLock = (EventList)->PrevListLock; \
  356. (EventList)->PrevListLock = (EventList)->LastListLock; \
  357. (EventList)->LastListLock.Module = RESMON_MODULE; \
  358. (EventList)->LastListLock.ThreadId = GetCurrentThreadId(); \
  359. (EventList)->LastListLock.LineNumber = __LINE__
  360. #define ReleaseEventListLock( EventList ) \
  361. (EventList)->PPrevPrevListUnlock = (EventList)->PrevPrevListUnlock; \
  362. (EventList)->PrevPrevListUnlock = (EventList)->PrevListUnlock; \
  363. (EventList)->PrevListUnlock = (EventList)->LastListUnlock; \
  364. (EventList)->LastListUnlock.Module = RESMON_MODULE; \
  365. (EventList)->LastListUnlock.ThreadId = GetCurrentThreadId(); \
  366. (EventList)->LastListUnlock.LineNumber = __LINE__; \
  367. (EventList)->LockOwnerResource = NULL; \
  368. (EventList)->MonitorState = RmonIdle; \
  369. LeaveCriticalSection( &(EventList)->ListLock )
  370. //
  371. // Data global to Resource Monitor
  372. //
  373. extern CRITICAL_SECTION RmpListLock;
  374. extern LOCK_INFO RmpListPPrevPrevLock;
  375. extern LOCK_INFO RmpListPrevPrevLock;
  376. extern LOCK_INFO RmpListPrevLock;
  377. extern LOCK_INFO RmpListLastLock;
  378. extern LOCK_INFO RmpListLastUnlock;
  379. extern LOCK_INFO RmpListPrevUnlock;
  380. extern LOCK_INFO RmpListPrevPrevUnlock;
  381. extern LOCK_INFO RmpListPPrevPrevUnlock;
  382. extern CRITICAL_SECTION RmpMonitorStateLock;
  383. extern PMONITOR_STATE RmpSharedState;
  384. extern CL_QUEUE RmpNotifyQueue;
  385. extern HKEY RmpResourcesKey;
  386. extern HKEY RmpResTypesKey;
  387. extern HCLUSTER RmpHCluster;
  388. extern BOOL RmpShutdown;
  389. extern LIST_ENTRY RmpEventListHead;
  390. extern HANDLE RmpWaitArray[];
  391. extern HANDLE RmpRewaitEvent;
  392. extern HANDLE RmpClusterProcess;
  393. extern DWORD RmpNumberOfThreads;
  394. extern BOOL RmpDebugger;
  395. extern BOOL g_fRmpClusterProcessCrashed;
  396. //
  397. // Interfaces for manipulating the resource lists
  398. //
  399. VOID
  400. RmpRundownResources(
  401. VOID
  402. );
  403. DWORD
  404. RmpInsertResourceList(
  405. IN PRESOURCE Resource,
  406. IN OPTIONAL PPOLL_EVENT_LIST pPollEventList
  407. );
  408. VOID
  409. RmpRemoveResourceList(
  410. IN PRESOURCE Resource
  411. );
  412. DWORD
  413. RmpOfflineResource(
  414. IN RESID ResourceId,
  415. IN BOOL Shutdown,
  416. OUT DWORD *pdwState
  417. );
  418. DWORD
  419. RmpSetResourceStatus(
  420. IN RESOURCE_HANDLE ResourceHandle,
  421. IN PRESOURCE_STATUS ResourceStatus
  422. );
  423. VOID
  424. RmpLogEvent(
  425. IN RESOURCE_HANDLE ResourceHandle,
  426. IN LOG_LEVEL LogLevel,
  427. IN LPCWSTR FormatString,
  428. ...
  429. );
  430. VOID
  431. RmpLostQuorumResource(
  432. IN RESOURCE_HANDLE ResourceHandle
  433. );
  434. //
  435. // Interfaces for interfacing with the poller thread
  436. //
  437. DWORD
  438. RmpPollerThread(
  439. IN LPVOID lpParameter
  440. );
  441. VOID
  442. RmpSignalPoller(
  443. IN PPOLL_EVENT_LIST EventList
  444. );
  445. PVOID
  446. RmpCreateEventList(
  447. VOID
  448. );
  449. DWORD
  450. RmpAddPollEvent(
  451. IN PPOLL_EVENT_LIST EventList,
  452. IN HANDLE EventHandle,
  453. IN PRESOURCE Resource
  454. );
  455. DWORD
  456. RmpRemovePollEvent(
  457. PPOLL_EVENT_LIST pEventList,
  458. IN HANDLE EventHandle
  459. );
  460. DWORD
  461. RmpResourceEventSignaled(
  462. IN PPOLL_EVENT_LIST EventList,
  463. IN DWORD EventIndex
  464. );
  465. //
  466. // Notification interfaces
  467. //
  468. typedef enum _NOTIFY_REASON {
  469. NotifyResourceStateChange,
  470. NotifyResourceResuscitate,
  471. NotifyShutdown
  472. } NOTIFY_REASON;
  473. VOID
  474. RmpPostNotify(
  475. IN PRESOURCE Resource,
  476. IN NOTIFY_REASON Reason
  477. );
  478. DWORD
  479. RmpTimerThread(
  480. IN LPVOID Context
  481. );
  482. DWORD
  483. RmpResourceEnumCommonProperties(
  484. OUT PVOID OutBuffer,
  485. IN DWORD OutBufferSize,
  486. OUT LPDWORD BytesReturned,
  487. OUT LPDWORD Required
  488. );
  489. DWORD
  490. RmpResourceGetCommonProperties(
  491. IN PRESOURCE Resource,
  492. IN BOOL ReadOnly,
  493. OUT PVOID OutBuffer,
  494. IN DWORD OutBufferSize,
  495. OUT LPDWORD BytesReturned,
  496. OUT LPDWORD Required
  497. );
  498. DWORD
  499. RmpResourceValidateCommonProperties(
  500. IN PRESOURCE Resource,
  501. IN PVOID InBuffer,
  502. IN DWORD InBufferSize
  503. );
  504. DWORD
  505. RmpResourceSetCommonProperties(
  506. IN PRESOURCE Resource,
  507. IN PVOID InBuffer,
  508. IN DWORD InBufferSize
  509. );
  510. DWORD
  511. RmpResourceEnumPrivateProperties(
  512. IN PRESOURCE Resource,
  513. OUT PVOID OutBuffer,
  514. IN DWORD OutBufferSize,
  515. OUT LPDWORD BytesReturned,
  516. OUT LPDWORD Required
  517. );
  518. DWORD
  519. RmpResourceGetPrivateProperties(
  520. IN PRESOURCE Resource,
  521. OUT PVOID OutBuffer,
  522. IN DWORD OutBufferSize,
  523. OUT LPDWORD BytesReturned,
  524. OUT LPDWORD Required
  525. );
  526. DWORD
  527. RmpResourceValidatePrivateProperties(
  528. IN PRESOURCE Resource,
  529. IN PVOID InBuffer,
  530. IN DWORD InBufferSize
  531. );
  532. DWORD
  533. RmpResourceSetPrivateProperties(
  534. IN PRESOURCE Resource,
  535. IN PVOID InBuffer,
  536. IN DWORD InBufferSize
  537. );
  538. DWORD
  539. RmpResourceGetFlags(
  540. IN PRESOURCE Resource,
  541. OUT PVOID OutBuffer,
  542. IN DWORD OutBufferSize,
  543. OUT LPDWORD BytesReturned,
  544. OUT LPDWORD Required
  545. );
  546. DWORD
  547. RmpResourceTypeEnumCommonProperties(
  548. IN LPCWSTR ResourceTypeName,
  549. OUT PVOID OutBuffer,
  550. IN DWORD OutBufferSize,
  551. OUT LPDWORD BytesReturned,
  552. OUT LPDWORD Required
  553. );
  554. DWORD
  555. RmpResourceTypeGetCommonProperties(
  556. IN LPCWSTR ResourceTypeName,
  557. IN BOOL ReadOnly,
  558. OUT PVOID OutBuffer,
  559. IN DWORD OutBufferSize,
  560. OUT LPDWORD BytesReturned,
  561. OUT LPDWORD Required
  562. );
  563. DWORD
  564. RmpResourceTypeValidateCommonProperties(
  565. IN LPCWSTR ResourceTypeName,
  566. IN PVOID InBuffer,
  567. IN DWORD InBufferSize
  568. );
  569. DWORD
  570. RmpResourceTypeSetCommonProperties(
  571. IN LPCWSTR ResourceTypeName,
  572. IN PVOID InBuffer,
  573. IN DWORD InBufferSize
  574. );
  575. DWORD
  576. RmpResourceTypeEnumPrivateProperties(
  577. IN LPCWSTR ResourceTypeName,
  578. OUT PVOID OutBuffer,
  579. IN DWORD OutBufferSize,
  580. OUT LPDWORD BytesReturned,
  581. OUT LPDWORD Required
  582. );
  583. DWORD
  584. RmpResourceTypeGetPrivateProperties(
  585. IN LPCWSTR ResourceTypeName,
  586. OUT PVOID OutBuffer,
  587. IN DWORD OutBufferSize,
  588. OUT LPDWORD BytesReturned,
  589. OUT LPDWORD Required
  590. );
  591. DWORD
  592. RmpResourceTypeValidatePrivateProperties(
  593. IN LPCWSTR ResourceTypeName,
  594. IN PVOID InBuffer,
  595. IN DWORD InBufferSize
  596. );
  597. DWORD
  598. RmpResourceTypeSetPrivateProperties(
  599. IN LPCWSTR ResourceTypeName,
  600. IN PVOID InBuffer,
  601. IN DWORD InBufferSize
  602. );
  603. DWORD
  604. RmpResourceTypeGetFlags(
  605. IN LPCWSTR ResourceTypeName,
  606. OUT PVOID OutBuffer,
  607. IN DWORD OutBufferSize,
  608. OUT LPDWORD BytesReturned,
  609. OUT LPDWORD Required
  610. );
  611. #ifdef COMRES
  612. DWORD RmpLoadResType(
  613. IN LPCWSTR lpszResourceTypeName,
  614. IN LPCWSTR lpszDllName,
  615. OUT PRESDLL_FNINFO pResDllFnInfo,
  616. OUT PRESDLL_INTERFACES pResDllInterfaces,
  617. OUT LPDWORD pdwCharacteristics
  618. );
  619. DWORD RmpLoadComResType(
  620. IN LPCWSTR lpszDllName,
  621. OUT PRESDLL_INTERFACES pResDllInterfaces,
  622. OUT LPDWORD pdwCharacteristics
  623. );
  624. #else
  625. DWORD RmpLoadResType(
  626. IN LPCWSTR lpszResourceTypeName,
  627. IN LPCWSTR lpszDllName,
  628. OUT PRESDLL_FNINFO pResDllFnInfo,
  629. OUT LPDWORD pdwCharacteristics
  630. );
  631. #endif
  632. VOID
  633. GenerateExceptionReport(
  634. IN PEXCEPTION_POINTERS pExceptionInfo
  635. );
  636. VOID
  637. DumpCriticalSection(
  638. IN PCRITICAL_SECTION CriticalSection
  639. );
  640. BOOL
  641. RmpAcquireSpinLock(
  642. IN PRESOURCE pResource,
  643. IN BOOL fSpin
  644. );
  645. VOID
  646. RmpReleaseSpinLock(
  647. IN PRESOURCE pResource
  648. );
  649. VOID
  650. RmpNotifyResourceStateChangeReason(
  651. IN PRESOURCE pResource,
  652. IN CLUSTER_RESOURCE_STATE_CHANGE_REASON eReason
  653. );
  654. RPC_STATUS
  655. RmpGetDynamicEndpointName(
  656. OUT LPWSTR *ppResmonRpcDynamicEndpointName
  657. );
  658. DWORD
  659. RmpSaveDynamicEndpointName(
  660. IN LPWSTR pResmonRpcDynamicEndpointName
  661. );
  662. PRM_DUE_TIME_ENTRY
  663. RmpInsertDeadlockMonitorList(
  664. IN LPCWSTR lpszResourceDllName,
  665. IN LPCWSTR lpszResourceTypeName,
  666. IN LPCWSTR lpszResourceName, OPTIONAL
  667. IN LPCWSTR lpszEntryPointName
  668. );
  669. VOID
  670. RmpRemoveDeadlockMonitorList(
  671. IN PRM_DUE_TIME_ENTRY pDueTimeEntry
  672. );
  673. DWORD
  674. RmpDeadlockMonitorInitialize(
  675. IN DWORD dwDeadlockDetectionTimeout
  676. );
  677. DWORD
  678. RmpDeadlockTimerThread(
  679. IN LPVOID pContext
  680. );
  681. VOID
  682. RmpDeclareDeadlock(
  683. IN PRM_DUE_TIME_ENTRY pDueTimeEntry,
  684. IN ULARGE_INTEGER uliCurrentTime
  685. );
  686. DWORD
  687. RmpUpdateDeadlockDetectionParams(
  688. IN DWORD dwDeadlockDetectionTimeout
  689. );
  690. VOID
  691. RmpNotifyResourcesRundown(
  692. VOID
  693. );
  694. #endif //_RESMONP_h