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.

717 lines
18 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. //
  35. // Define the maximum number of resources handled per thread.
  36. // (This value must be smaller than MAXIMUM_WAIT_OBJECTS-1!)
  37. //
  38. #define MAX_RESOURCES_PER_THREAD 27
  39. #define MAX_HANDLES_PER_THREAD (MAX_RESOURCES_PER_THREAD+1)
  40. //
  41. // Define the maximum number of threads.
  42. // (This value can be up to MAXIMUM_WAIT_OBJECTS, however the first two
  43. // entries are taken by events, so in fact we have 2 less threads available).
  44. //
  45. #define MAX_THREADS (MAXIMUM_WAIT_OBJECTS)
  46. //
  47. // Define structure and flags used for each resource entry
  48. //
  49. #define RESOURCE_SIGNATURE 'crsR'
  50. extern RESUTIL_PROPERTY_ITEM RmpResourceCommonProperties[];
  51. extern RESUTIL_PROPERTY_ITEM RmpResourceTypeCommonProperties[];
  52. typedef struct _POLL_EVENT_LIST;
  53. typedef struct _POLL_EVENT_LIST *PPOLL_EVENT_LIST;
  54. //
  55. // Lock Info for debugging lock acquires/releases
  56. //
  57. typedef struct _LOCK_INFO {
  58. DWORD Module: 6;
  59. DWORD ThreadId: 11;
  60. DWORD LineNumber: 15;
  61. } LOCK_INFO, *PLOCK_INFO;
  62. //
  63. // Entry points
  64. //
  65. #define RESDLL_ENTRY_CLOSE 0x00000001
  66. #define RESDLL_ENTRY_TERMINATE 0x00000002
  67. //
  68. // Flags
  69. //
  70. #define RESOURCE_INSERTED 1
  71. typedef struct _RESOURCE {
  72. ULONG Signature; // 'Rsrc'
  73. ULONG Flags;
  74. LIST_ENTRY ListEntry; // for linking onto monitoring list
  75. LPWSTR DllName;
  76. LPWSTR ResourceType;
  77. LPWSTR ResourceId;
  78. LPWSTR ResourceName;
  79. DWORD LooksAlivePollInterval;
  80. DWORD IsAlivePollInterval;
  81. HINSTANCE Dll; // handle to resource's DLL
  82. RESID Id;
  83. HANDLE EventHandle; // async error notification handle
  84. HANDLE OnlineEvent;
  85. #ifdef COMRES
  86. #define RESMON_TYPE_DLL 1
  87. #define RESMON_TYPE_COM 2
  88. // TODO define this as a union
  89. IClusterResource *pClusterResource ;
  90. IClusterResControl *pClusterResControl ;
  91. IClusterQuorumResource *pClusterQuorumResource ;
  92. DWORD dwType ; // Type of resource whether it is DLL or a COMResources
  93. POPEN_ROUTINE pOpen;
  94. PCLOSE_ROUTINE pClose;
  95. PONLINE_ROUTINE pOnline;
  96. POFFLINE_ROUTINE pOffline;
  97. PTERMINATE_ROUTINE pTerminate;
  98. PIS_ALIVE_ROUTINE pIsAlive;
  99. PLOOKS_ALIVE_ROUTINE pLooksAlive;
  100. PARBITRATE_ROUTINE pArbitrate;
  101. PRELEASE_ROUTINE pRelease;
  102. PRESOURCE_CONTROL_ROUTINE pResourceControl;
  103. PRESOURCE_TYPE_CONTROL_ROUTINE pResourceTypeControl;
  104. #else
  105. POPEN_ROUTINE Open;
  106. PCLOSE_ROUTINE Close;
  107. PONLINE_ROUTINE Online;
  108. POFFLINE_ROUTINE Offline;
  109. PTERMINATE_ROUTINE Terminate;
  110. PIS_ALIVE_ROUTINE IsAlive;
  111. PLOOKS_ALIVE_ROUTINE LooksAlive;
  112. PARBITRATE_ROUTINE Arbitrate;
  113. PRELEASE_ROUTINE Release;
  114. PRESOURCE_CONTROL_ROUTINE ResourceControl;
  115. PRESOURCE_TYPE_CONTROL_ROUTINE ResourceTypeControl;
  116. #endif
  117. CLUSTER_RESOURCE_STATE State;
  118. ULONG IsAliveCount;
  119. ULONG IsAliveRollover;
  120. RM_NOTIFY_KEY NotifyKey;
  121. PPOLL_EVENT_LIST EventList;
  122. HANDLE TimerEvent; // Timer event for offline completion.
  123. DWORD PendingTimeout;
  124. DWORD CheckPoint; // Online pending checkpoint
  125. BOOL IsArbitrated;
  126. DWORD dwEntryPoint; // Number indicating which resdll entry point is called.
  127. BOOL fArbLock; // Variable used for synchronizing arbitrate with close and rundown
  128. } RESOURCE, *PRESOURCE;
  129. #ifdef COMRES
  130. extern DWORD tidActiveXWorker ; // ThreadID for the COM worker thread
  131. #define WM_RES_CREATE WM_USER+1
  132. #define WM_RES_OPEN WM_USER+2
  133. #define WM_RES_CLOSE WM_USER+3
  134. #define WM_RES_ONLINE WM_USER+4
  135. #define WM_RES_OFFLINE WM_USER+5
  136. #define WM_RES_TERMINATE WM_USER+6
  137. #define WM_RES_ISALIVE WM_USER+7
  138. #define WM_RES_LOOKSALIVE WM_USER+8
  139. #define WM_RES_ARBITRATE WM_USER+9
  140. #define WM_RES_RELEASE WM_USER+10
  141. #define WM_RES_EXITTHREAD WM_USER+11
  142. #define WM_RES_FREE WM_USER+12
  143. #define WM_RES_RESOURCECONTROL WM_USER+11
  144. #define WM_RES_RESOURCETYPECONTROL WM_USER+12
  145. DWORD WINAPI ActiveXWorkerThread (LPVOID pThreadInfo) ;
  146. //
  147. // Used in RmpAcquireSpinLock
  148. //
  149. #define RESMON_MAX_SLOCK_RETRIES 400
  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. } POLL_EVENT_LIST, *PPOLL_EVENT_LIST;
  262. #define POLL_GRANULARITY (10) // 10ms
  263. #define PENDING_TIMEOUT (3*1000*60) // 3 minutes for pending requests to finish
  264. //
  265. // Private helper macros and functions
  266. //
  267. VOID
  268. RmpSetEventListLockOwner(
  269. IN PRESOURCE pResource,
  270. IN DWORD dwMonitorState
  271. );
  272. #define RmpAlloc(size) LocalAlloc(LMEM_FIXED, (size))
  273. #define RmpFree(size) LocalFree((size))
  274. #define RmpSetMonitorState(state, resource) \
  275. EnterCriticalSection(&RmpMonitorStateLock); \
  276. GetSystemTimeAsFileTime((PFILETIME)&RmpSharedState->LastUpdate); \
  277. RmpSharedState->State = (state); \
  278. RmpSharedState->ActiveResource = (HANDLE)(resource); \
  279. LeaveCriticalSection(&RmpMonitorStateLock); \
  280. RmpSetEventListLockOwner( resource, state )
  281. #define AcquireListLock() \
  282. EnterCriticalSection( &RmpListLock ); \
  283. RmpListPPrevPrevLock = RmpListPrevPrevLock; \
  284. RmpListPrevPrevLock = RmpListPrevLock; \
  285. RmpListPrevLock = RmpListLastLock; \
  286. RmpListLastLock.Module = RESMON_MODULE; \
  287. RmpListLastLock.ThreadId = GetCurrentThreadId(); \
  288. RmpListLastLock.LineNumber = __LINE__
  289. #define ReleaseListLock() \
  290. RmpListPPrevPrevUnlock = RmpListPrevPrevUnlock; \
  291. RmpListPrevPrevUnlock = RmpListPrevUnlock; \
  292. RmpListPrevUnlock = RmpListLastUnlock; \
  293. RmpListLastUnlock.Module = RESMON_MODULE; \
  294. RmpListLastUnlock.ThreadId = GetCurrentThreadId(); \
  295. RmpListLastUnlock.LineNumber = __LINE__; \
  296. LeaveCriticalSection( &RmpListLock )
  297. #define AcquireEventListLock( EventList ) \
  298. EnterCriticalSection( &(EventList)->ListLock ); \
  299. (EventList)->PPrevPrevListLock = (EventList)->PrevPrevListLock; \
  300. (EventList)->PrevPrevListLock = (EventList)->PrevListLock; \
  301. (EventList)->PrevListLock = (EventList)->LastListLock; \
  302. (EventList)->LastListLock.Module = RESMON_MODULE; \
  303. (EventList)->LastListLock.ThreadId = GetCurrentThreadId(); \
  304. (EventList)->LastListLock.LineNumber = __LINE__
  305. #define ReleaseEventListLock( EventList ) \
  306. (EventList)->PPrevPrevListUnlock = (EventList)->PrevPrevListUnlock; \
  307. (EventList)->PrevPrevListUnlock = (EventList)->PrevListUnlock; \
  308. (EventList)->PrevListUnlock = (EventList)->LastListUnlock; \
  309. (EventList)->LastListUnlock.Module = RESMON_MODULE; \
  310. (EventList)->LastListUnlock.ThreadId = GetCurrentThreadId(); \
  311. (EventList)->LastListUnlock.LineNumber = __LINE__; \
  312. (EventList)->LockOwnerResource = NULL; \
  313. (EventList)->MonitorState = RmonIdle; \
  314. LeaveCriticalSection( &(EventList)->ListLock )
  315. //
  316. // Data global to Resource Monitor
  317. //
  318. extern CRITICAL_SECTION RmpListLock;
  319. extern LOCK_INFO RmpListPPrevPrevLock;
  320. extern LOCK_INFO RmpListPrevPrevLock;
  321. extern LOCK_INFO RmpListPrevLock;
  322. extern LOCK_INFO RmpListLastLock;
  323. extern LOCK_INFO RmpListLastUnlock;
  324. extern LOCK_INFO RmpListPrevUnlock;
  325. extern LOCK_INFO RmpListPrevPrevUnlock;
  326. extern LOCK_INFO RmpListPPrevPrevUnlock;
  327. extern CRITICAL_SECTION RmpMonitorStateLock;
  328. extern PMONITOR_STATE RmpSharedState;
  329. extern CL_QUEUE RmpNotifyQueue;
  330. extern HKEY RmpResourcesKey;
  331. extern HKEY RmpResTypesKey;
  332. extern HCLUSTER RmpHCluster;
  333. extern BOOL RmpShutdown;
  334. extern LIST_ENTRY RmpEventListHead;
  335. extern HANDLE RmpWaitArray[];
  336. extern HANDLE RmpRewaitEvent;
  337. extern HANDLE RmpClusterProcess;
  338. extern DWORD RmpNumberOfThreads;
  339. extern BOOL RmpDebugger;
  340. //
  341. // Interfaces for manipulating the resource lists
  342. //
  343. VOID
  344. RmpRundownResources(
  345. VOID
  346. );
  347. DWORD
  348. RmpInsertResourceList(
  349. IN PRESOURCE Resource,
  350. IN OPTIONAL PPOLL_EVENT_LIST pPollEventList
  351. );
  352. VOID
  353. RmpRemoveResourceList(
  354. IN PRESOURCE Resource
  355. );
  356. DWORD
  357. RmpOfflineResource(
  358. IN RESID ResourceId,
  359. IN BOOL Shutdown,
  360. OUT DWORD *pdwState
  361. );
  362. DWORD
  363. RmpSetResourceStatus(
  364. IN RESOURCE_HANDLE ResourceHandle,
  365. IN PRESOURCE_STATUS ResourceStatus
  366. );
  367. VOID
  368. RmpLogEvent(
  369. IN RESOURCE_HANDLE ResourceHandle,
  370. IN LOG_LEVEL LogLevel,
  371. IN LPCWSTR FormatString,
  372. ...
  373. );
  374. VOID
  375. RmpLostQuorumResource(
  376. IN RESOURCE_HANDLE ResourceHandle
  377. );
  378. //
  379. // Interfaces for interfacing with the poller thread
  380. //
  381. DWORD
  382. RmpPollerThread(
  383. IN LPVOID lpParameter
  384. );
  385. VOID
  386. RmpSignalPoller(
  387. IN PPOLL_EVENT_LIST EventList
  388. );
  389. PVOID
  390. RmpCreateEventList(
  391. VOID
  392. );
  393. DWORD
  394. RmpAddPollEvent(
  395. IN PPOLL_EVENT_LIST EventList,
  396. IN HANDLE EventHandle,
  397. IN PRESOURCE Resource
  398. );
  399. DWORD
  400. RmpRemovePollEvent(
  401. IN HANDLE EventHandle
  402. );
  403. DWORD
  404. RmpResourceEventSignaled(
  405. IN PPOLL_EVENT_LIST EventList,
  406. IN DWORD EventIndex
  407. );
  408. //
  409. // Notification interfaces
  410. //
  411. typedef enum _NOTIFY_REASON {
  412. NotifyResourceStateChange,
  413. NotifyResourceResuscitate,
  414. NotifyShutdown
  415. } NOTIFY_REASON;
  416. VOID
  417. RmpPostNotify(
  418. IN PRESOURCE Resource,
  419. IN NOTIFY_REASON Reason
  420. );
  421. DWORD
  422. RmpTimerThread(
  423. IN LPVOID Context
  424. );
  425. DWORD
  426. RmpResourceEnumCommonProperties(
  427. OUT PVOID OutBuffer,
  428. IN DWORD OutBufferSize,
  429. OUT LPDWORD BytesReturned,
  430. OUT LPDWORD Required
  431. );
  432. DWORD
  433. RmpResourceGetCommonProperties(
  434. IN PRESOURCE Resource,
  435. IN BOOL ReadOnly,
  436. OUT PVOID OutBuffer,
  437. IN DWORD OutBufferSize,
  438. OUT LPDWORD BytesReturned,
  439. OUT LPDWORD Required
  440. );
  441. DWORD
  442. RmpResourceValidateCommonProperties(
  443. IN PRESOURCE Resource,
  444. IN PVOID InBuffer,
  445. IN DWORD InBufferSize
  446. );
  447. DWORD
  448. RmpResourceSetCommonProperties(
  449. IN PRESOURCE Resource,
  450. IN PVOID InBuffer,
  451. IN DWORD InBufferSize
  452. );
  453. DWORD
  454. RmpResourceEnumPrivateProperties(
  455. IN PRESOURCE Resource,
  456. OUT PVOID OutBuffer,
  457. IN DWORD OutBufferSize,
  458. OUT LPDWORD BytesReturned,
  459. OUT LPDWORD Required
  460. );
  461. DWORD
  462. RmpResourceGetPrivateProperties(
  463. IN PRESOURCE Resource,
  464. OUT PVOID OutBuffer,
  465. IN DWORD OutBufferSize,
  466. OUT LPDWORD BytesReturned,
  467. OUT LPDWORD Required
  468. );
  469. DWORD
  470. RmpResourceValidatePrivateProperties(
  471. IN PRESOURCE Resource,
  472. IN PVOID InBuffer,
  473. IN DWORD InBufferSize
  474. );
  475. DWORD
  476. RmpResourceSetPrivateProperties(
  477. IN PRESOURCE Resource,
  478. IN PVOID InBuffer,
  479. IN DWORD InBufferSize
  480. );
  481. DWORD
  482. RmpResourceGetFlags(
  483. IN PRESOURCE Resource,
  484. OUT PVOID OutBuffer,
  485. IN DWORD OutBufferSize,
  486. OUT LPDWORD BytesReturned,
  487. OUT LPDWORD Required
  488. );
  489. DWORD
  490. RmpResourceTypeEnumCommonProperties(
  491. IN LPCWSTR ResourceTypeName,
  492. OUT PVOID OutBuffer,
  493. IN DWORD OutBufferSize,
  494. OUT LPDWORD BytesReturned,
  495. OUT LPDWORD Required
  496. );
  497. DWORD
  498. RmpResourceTypeGetCommonProperties(
  499. IN LPCWSTR ResourceTypeName,
  500. IN BOOL ReadOnly,
  501. OUT PVOID OutBuffer,
  502. IN DWORD OutBufferSize,
  503. OUT LPDWORD BytesReturned,
  504. OUT LPDWORD Required
  505. );
  506. DWORD
  507. RmpResourceTypeValidateCommonProperties(
  508. IN LPCWSTR ResourceTypeName,
  509. IN PVOID InBuffer,
  510. IN DWORD InBufferSize
  511. );
  512. DWORD
  513. RmpResourceTypeSetCommonProperties(
  514. IN LPCWSTR ResourceTypeName,
  515. IN PVOID InBuffer,
  516. IN DWORD InBufferSize
  517. );
  518. DWORD
  519. RmpResourceTypeEnumPrivateProperties(
  520. IN LPCWSTR ResourceTypeName,
  521. OUT PVOID OutBuffer,
  522. IN DWORD OutBufferSize,
  523. OUT LPDWORD BytesReturned,
  524. OUT LPDWORD Required
  525. );
  526. DWORD
  527. RmpResourceTypeGetPrivateProperties(
  528. IN LPCWSTR ResourceTypeName,
  529. OUT PVOID OutBuffer,
  530. IN DWORD OutBufferSize,
  531. OUT LPDWORD BytesReturned,
  532. OUT LPDWORD Required
  533. );
  534. DWORD
  535. RmpResourceTypeValidatePrivateProperties(
  536. IN LPCWSTR ResourceTypeName,
  537. IN PVOID InBuffer,
  538. IN DWORD InBufferSize
  539. );
  540. DWORD
  541. RmpResourceTypeSetPrivateProperties(
  542. IN LPCWSTR ResourceTypeName,
  543. IN PVOID InBuffer,
  544. IN DWORD InBufferSize
  545. );
  546. DWORD
  547. RmpResourceTypeGetFlags(
  548. IN LPCWSTR ResourceTypeName,
  549. OUT PVOID OutBuffer,
  550. IN DWORD OutBufferSize,
  551. OUT LPDWORD BytesReturned,
  552. OUT LPDWORD Required
  553. );
  554. #ifdef COMRES
  555. DWORD RmpLoadResType(
  556. IN LPCWSTR lpszResourceTypeName,
  557. IN LPCWSTR lpszDllName,
  558. OUT PRESDLL_FNINFO pResDllFnInfo,
  559. OUT PRESDLL_INTERFACES pResDllInterfaces,
  560. OUT LPDWORD pdwCharacteristics
  561. );
  562. DWORD RmpLoadComResType(
  563. IN LPCWSTR lpszDllName,
  564. OUT PRESDLL_INTERFACES pResDllInterfaces,
  565. OUT LPDWORD pdwCharacteristics
  566. );
  567. #else
  568. DWORD RmpLoadResType(
  569. IN LPCWSTR lpszResourceTypeName,
  570. IN LPCWSTR lpszDllName,
  571. OUT PRESDLL_FNINFO pResDllFnInfo,
  572. OUT LPDWORD pdwCharacteristics
  573. );
  574. #endif
  575. VOID
  576. GenerateExceptionReport(
  577. IN PEXCEPTION_POINTERS pExceptionInfo
  578. );
  579. VOID
  580. DumpCriticalSection(
  581. IN PCRITICAL_SECTION CriticalSection
  582. );
  583. BOOL
  584. RmpAcquireSpinLock(
  585. IN PRESOURCE pResource,
  586. IN BOOL fSpin
  587. );
  588. VOID
  589. RmpReleaseSpinLock(
  590. IN PRESOURCE pResource
  591. );
  592. #endif //_RESMONP_h