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.

506 lines
15 KiB

  1. /*++
  2. Copyright (c) 1997-2000 Microsoft Corporation
  3. Module Name:
  4. clusres.h
  5. Abstract:
  6. Common Resource DLL Header
  7. Author:
  8. John Vert (jvert) 12/15/1996
  9. Revision History:
  10. --*/
  11. #include "nt.h"
  12. #include "ntrtl.h"
  13. #include "nturtl.h"
  14. #include "windows.h"
  15. #include "stdio.h"
  16. #include "stdlib.h"
  17. #include "clusudef.h"
  18. #include "clusapi.h"
  19. #include "resapi.h"
  20. #include "clusvmsg.h"
  21. #define LOCAL_SERVICES L"System\\CurrentControlSet\\Services"
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. extern PLOG_EVENT_ROUTINE ClusResLogEvent;
  26. extern PSET_RESOURCE_STATUS_ROUTINE ClusResSetResourceStatus;
  27. //
  28. // Cluster Resource Specific routines
  29. //
  30. DWORD
  31. ClusResOpenDriver(
  32. HANDLE *Handle,
  33. LPWSTR DriverName
  34. );
  35. NTSTATUS
  36. ClusResDoIoctl(
  37. HANDLE Handle,
  38. DWORD IoctlCode,
  39. PVOID Request,
  40. DWORD RequestSize,
  41. PVOID Response,
  42. PDWORD ResponseSize
  43. );
  44. //
  45. // Helpful macros for logging cluster service events
  46. //
  47. VOID
  48. ClusResLogEventWithName0(
  49. IN HKEY hResourceKey,
  50. IN DWORD LogLevel,
  51. IN DWORD LogModule,
  52. IN LPSTR FileName,
  53. IN DWORD LineNumber,
  54. IN DWORD MessageId,
  55. IN DWORD dwByteCount,
  56. IN PVOID lpBytes
  57. );
  58. VOID
  59. ClusResLogEventWithName1(
  60. IN HKEY hResourceKey,
  61. IN DWORD LogLevel,
  62. IN DWORD LogModule,
  63. IN LPSTR FileName,
  64. IN DWORD LineNumber,
  65. IN DWORD MessageId,
  66. IN DWORD dwByteCount,
  67. IN PVOID lpBytes,
  68. IN LPCWSTR Arg1
  69. );
  70. VOID
  71. ClusResLogEventWithName2(
  72. IN HKEY hResourceKey,
  73. IN DWORD LogLevel,
  74. IN DWORD LogModule,
  75. IN LPSTR FileName,
  76. IN DWORD LineNumber,
  77. IN DWORD MessageId,
  78. IN DWORD dwByteCount,
  79. IN PVOID lpBytes,
  80. IN LPCWSTR Arg1,
  81. IN LPCWSTR Arg2
  82. );
  83. VOID
  84. ClusResLogEventWithName3(
  85. IN HKEY hResourceKey,
  86. IN DWORD LogLevel,
  87. IN DWORD LogModule,
  88. IN LPSTR FileName,
  89. IN DWORD LineNumber,
  90. IN DWORD MessageId,
  91. IN DWORD dwByteCount,
  92. IN PVOID lpBytes,
  93. IN LPCWSTR Arg1,
  94. IN LPCWSTR Arg2,
  95. IN LPCWSTR Arg3
  96. );
  97. #define ClusResLogSystemEventByKey(_hKey_, _level_, _msgid_) \
  98. ClusResLogEventWithName0(_hKey_, \
  99. _level_, \
  100. LOG_CURRENT_MODULE, \
  101. __FILE__, \
  102. __LINE__, \
  103. _msgid_, \
  104. 0, \
  105. NULL)
  106. #define ClusResLogSystemEventByKey1(_hKey_, _level_, _msgid_, _arg1_) \
  107. ClusResLogEventWithName1(_hKey_, \
  108. _level_, \
  109. LOG_CURRENT_MODULE, \
  110. __FILE__, \
  111. __LINE__, \
  112. _msgid_, \
  113. 0, \
  114. NULL, \
  115. _arg1_)
  116. #define ClusResLogSystemEventByKey2(_hKey_, _level_, _msgid_, _arg1_, _arg2_) \
  117. ClusResLogEventWithName2(_hKey_, \
  118. _level_, \
  119. LOG_CURRENT_MODULE, \
  120. __FILE__, \
  121. __LINE__, \
  122. _msgid_, \
  123. 0, \
  124. NULL, \
  125. _arg1_, \
  126. _arg2_)
  127. #define ClusResLogSystemEventByKey3(_hKey_, _level_, _msgid_, _arg1_, _arg2_, _arg3_) \
  128. ClusResLogEventWithName3(_hKey_, \
  129. _level_, \
  130. LOG_CURRENT_MODULE, \
  131. __FILE__, \
  132. __LINE__, \
  133. _msgid_, \
  134. 0, \
  135. NULL, \
  136. _arg1_, \
  137. _arg2_, \
  138. _arg3_)
  139. #define ClusResLogSystemEventByKeyData(_hKey_, _level_, _msgid_, dwBytes, pData) \
  140. ClusResLogEventWithName0(_hKey_, \
  141. _level_, \
  142. LOG_CURRENT_MODULE, \
  143. __FILE__, \
  144. __LINE__, \
  145. _msgid_, \
  146. dwBytes, \
  147. pData)
  148. #define ClusResLogSystemEventByKeyData1(_hKey_, _level_, _msgid_, dwBytes, pData, _arg1_) \
  149. ClusResLogEventWithName1(_hKey_, \
  150. _level_, \
  151. LOG_CURRENT_MODULE, \
  152. __FILE__, \
  153. __LINE__, \
  154. _msgid_, \
  155. dwBytes, \
  156. pData, \
  157. _arg1_)
  158. #define ClusResLogSystemEventByKeyData2(_hKey_, _level_, _msgid_, dwBytes, pData, _arg1_, _arg2_) \
  159. ClusResLogEventWithName2(_hKey_, \
  160. _level_, \
  161. LOG_CURRENT_MODULE, \
  162. __FILE__, \
  163. __LINE__, \
  164. _msgid_, \
  165. dwBytes, \
  166. pData, \
  167. _arg1_, \
  168. _arg2_)
  169. #define ClusResLogSystemEventByKeyData3(_hKey_, _level_, _msgid_, dwBytes, pData, _arg1_, _arg2_, _arg3_) \
  170. ClusResLogEventWithName3(_hKey_, \
  171. _level_, \
  172. LOG_CURRENT_MODULE, \
  173. __FILE__, \
  174. __LINE__, \
  175. _msgid_, \
  176. dwBytes, \
  177. pData, \
  178. _arg1_, \
  179. _arg2_, \
  180. _arg3_)
  181. #define ClusResLogSystemEvent0(_level_, _msgid_) \
  182. ClusterLogEvent0(_level_, \
  183. LOG_CURRENT_MODULE, \
  184. __FILE__, \
  185. __LINE__, \
  186. (_msgid_), \
  187. 0, \
  188. NULL)
  189. #define ClusResLogSystemEvent1(_level_, _msgid_, _arg1_) \
  190. ClusterLogEvent1(_level_, \
  191. LOG_CURRENT_MODULE, \
  192. __FILE__, \
  193. __LINE__, \
  194. (_msgid_), \
  195. 0, \
  196. NULL, \
  197. (_arg1_))
  198. #define ClusResLogSystemEvent2(_level_, _msgid_, _arg1_, _arg2_) \
  199. ClusterLogEvent2(_level_, \
  200. LOG_CURRENT_MODULE, \
  201. __FILE__, \
  202. __LINE__, \
  203. (_msgid_), \
  204. 0, \
  205. NULL, \
  206. (_arg1_), \
  207. (_arg2_))
  208. #define ClusResLogSystemEvent3(_level_, _msgid_, _arg1_, _arg2_, _arg3_) \
  209. ClusterLogEvent3(_level_, \
  210. LOG_CURRENT_MODULE, \
  211. __FILE__, \
  212. __LINE__, \
  213. (_msgid_), \
  214. 0, \
  215. NULL, \
  216. (_arg1_), \
  217. (_arg2_), \
  218. (_arg3_))
  219. #define ClusResLogSystemEventData(_level_, _msgid_, _dwBytes_, _pData_) \
  220. ClusterLogEvent0(_level_, \
  221. LOG_CURRENT_MODULE, \
  222. __FILE__, \
  223. __LINE__, \
  224. (_msgid_), \
  225. (_dwBytes_), \
  226. (_pData_))
  227. #define ClusResLogSystemEventData1(_level_, _msgid_, _dwBytes_, _pData_, _arg1_) \
  228. ClusterLogEvent1(_level_, \
  229. LOG_CURRENT_MODULE, \
  230. __FILE__, \
  231. __LINE__, \
  232. (_msgid_), \
  233. (_dwBytes_), \
  234. (_pData_), \
  235. (_arg1_))
  236. #define ClusResLogSystemEventData2(_level_, _msgid_, _dwBytes_, _pData_, _arg1_, _arg2_) \
  237. ClusterLogEvent2(_level_, \
  238. LOG_CURRENT_MODULE, \
  239. __FILE__, \
  240. __LINE__, \
  241. (_msgid_), \
  242. (_dwBytes_), \
  243. (_pData_), \
  244. (_arg1_), \
  245. (_arg2_))
  246. #define ClusResLogSystemEventData3(_level_, _msgid_, _dwBytes_, _pData_, _arg1_, _arg2_, _arg3_) \
  247. ClusterLogEvent3(_level_, \
  248. LOG_CURRENT_MODULE, \
  249. __FILE__, \
  250. __LINE__, \
  251. (_msgid_), \
  252. (_dwBytes_), \
  253. (_pData_), \
  254. (_arg1_), \
  255. (_arg2_), \
  256. (_arg3_))
  257. //
  258. // interfaces for GENAPP
  259. //
  260. extern CLRES_FUNCTION_TABLE GenAppFunctionTable;
  261. BOOLEAN
  262. WINAPI
  263. GenAppDllEntryPoint(
  264. IN HINSTANCE DllHandle,
  265. IN DWORD Reason,
  266. IN LPVOID Reserved
  267. );
  268. //
  269. // interfaces for GENSVC
  270. //
  271. extern CLRES_FUNCTION_TABLE GenSvcFunctionTable;
  272. BOOLEAN
  273. WINAPI
  274. GenSvcDllEntryPoint(
  275. IN HINSTANCE DllHandle,
  276. IN DWORD Reason,
  277. IN LPVOID Reserved
  278. );
  279. //
  280. // interfaces for DISKS and FTSET
  281. //
  282. extern CLRES_FUNCTION_TABLE DisksFunctionTable;
  283. extern CLRES_FUNCTION_TABLE FtSetFunctionTable;
  284. BOOLEAN
  285. WINAPI
  286. DisksDllEntryPoint(
  287. IN HINSTANCE DllHandle,
  288. IN DWORD Reason,
  289. IN LPVOID Reserved
  290. );
  291. BOOLEAN
  292. WINAPI
  293. FtSetDllEntryPoint(
  294. IN HINSTANCE DllHandle,
  295. IN DWORD Reason,
  296. IN LPVOID Reserved
  297. );
  298. //
  299. // interfaces for NETNAME
  300. //
  301. extern CLRES_FUNCTION_TABLE NetNameFunctionTable;
  302. BOOLEAN
  303. WINAPI
  304. NetNameDllEntryPoint(
  305. IN HINSTANCE DllHandle,
  306. IN DWORD Reason,
  307. IN LPVOID Reserved
  308. );
  309. //
  310. // interfaces for IPADDR
  311. //
  312. extern CLRES_FUNCTION_TABLE IpAddrFunctionTable;
  313. BOOLEAN
  314. WINAPI
  315. IpAddrDllEntryPoint(
  316. IN HINSTANCE DllHandle,
  317. IN DWORD Reason,
  318. IN LPVOID Reserved
  319. );
  320. //
  321. // interfaces for File Shares
  322. //
  323. extern CLRES_FUNCTION_TABLE SmbShareFunctionTable;
  324. BOOLEAN
  325. WINAPI
  326. SmbShareDllEntryPoint(
  327. IN HINSTANCE DllHandle,
  328. IN DWORD Reason,
  329. IN LPVOID Reserved
  330. );
  331. //
  332. // interfaces for Spool Service
  333. //
  334. extern CLRES_FUNCTION_TABLE SplSvcFunctionTable;
  335. BOOLEAN
  336. WINAPI
  337. SplSvcDllEntryPoint(
  338. IN HINSTANCE DllHandle,
  339. IN DWORD Reason,
  340. IN LPVOID Reserved
  341. );
  342. //
  343. // interfaces for Local Quorum
  344. //
  345. extern CLRES_FUNCTION_TABLE LkQuorumFunctionTable;
  346. BOOLEAN
  347. WINAPI
  348. LkQuorumDllEntryPoint(
  349. IN HINSTANCE DllHandle,
  350. IN DWORD Reason,
  351. IN LPVOID Reserved
  352. );
  353. //
  354. // interfaces for DHCP Server
  355. //
  356. extern CLRES_FUNCTION_TABLE DhcpFunctionTable;
  357. BOOLEAN
  358. WINAPI
  359. DhcpDllEntryPoint(
  360. IN HINSTANCE DllHandle,
  361. IN DWORD Reason,
  362. IN LPVOID Reserved
  363. );
  364. //
  365. // interfaces for MSMQ Server
  366. //
  367. extern CLRES_FUNCTION_TABLE MsMQFunctionTable;
  368. BOOLEAN
  369. WINAPI
  370. MsMQDllEntryPoint(
  371. IN HINSTANCE DllHandle,
  372. IN DWORD Reason,
  373. IN LPVOID Reserved
  374. );
  375. //
  376. // interfaces for DTC Server
  377. //
  378. extern CLRES_FUNCTION_TABLE MsDTCFunctionTable;
  379. BOOLEAN
  380. WINAPI
  381. MsDTCDllEntryPoint(
  382. IN HINSTANCE DllHandle,
  383. IN DWORD Reason,
  384. IN LPVOID Reserved
  385. );
  386. //
  387. // interfaces for Time Service
  388. //
  389. extern CLRES_FUNCTION_TABLE TimeSvcFunctionTable;
  390. BOOLEAN
  391. WINAPI
  392. TimeSvcDllEntryPoint(
  393. IN HINSTANCE DllHandle,
  394. IN DWORD Reason,
  395. IN LPVOID Reserved
  396. );
  397. //
  398. // interfaces for WINS Server
  399. //
  400. extern CLRES_FUNCTION_TABLE WinsFunctionTable;
  401. BOOLEAN
  402. WINAPI
  403. WinsDllEntryPoint(
  404. IN HINSTANCE DllHandle,
  405. IN DWORD Reason,
  406. IN LPVOID Reserved
  407. );
  408. //
  409. // interfaces for Generic Script
  410. //
  411. extern CLRES_FUNCTION_TABLE GenScriptFunctionTable;
  412. BOOLEAN
  413. WINAPI
  414. GenScriptDllEntryPoint(
  415. IN HINSTANCE DllHandle,
  416. IN DWORD Reason,
  417. IN LPVOID Reserved
  418. );
  419. //
  420. // interfaces for Majority Node Set
  421. //
  422. extern CLRES_FUNCTION_TABLE MajorityNodeSetFunctionTable;
  423. BOOLEAN
  424. WINAPI
  425. MajorityNodeSetDllEntryPoint(
  426. IN HINSTANCE DllHandle,
  427. IN DWORD Reason,
  428. IN LPVOID Reserved
  429. );
  430. #ifdef __cplusplus
  431. } // extern "C"
  432. #endif