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.

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