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.

390 lines
10 KiB

  1. /*++
  2. Copyright (c) 1997 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. extern PLOG_EVENT_ROUTINE ClusResLogEvent;
  23. extern PSET_RESOURCE_STATUS_ROUTINE ClusResSetResourceStatus;
  24. //
  25. // Cluster Resource Specific routines
  26. //
  27. DWORD
  28. ClusResOpenDriver(
  29. HANDLE *Handle,
  30. LPWSTR DriverName
  31. );
  32. NTSTATUS
  33. ClusResDoIoctl(
  34. HANDLE Handle,
  35. DWORD IoctlCode,
  36. PVOID Request,
  37. DWORD RequestSize,
  38. PVOID Response,
  39. PDWORD ResponseSize
  40. );
  41. //
  42. // Helpful macros for logging cluster service events
  43. //
  44. VOID
  45. ClusResLogEventWithName0(
  46. IN HKEY hResourceKey,
  47. IN DWORD LogLevel,
  48. IN DWORD LogModule,
  49. IN LPSTR FileName,
  50. IN DWORD LineNumber,
  51. IN DWORD MessageId,
  52. IN DWORD dwByteCount,
  53. IN PVOID lpBytes
  54. );
  55. VOID
  56. ClusResLogEventWithName1(
  57. IN HKEY hResourceKey,
  58. IN DWORD LogLevel,
  59. IN DWORD LogModule,
  60. IN LPSTR FileName,
  61. IN DWORD LineNumber,
  62. IN DWORD MessageId,
  63. IN DWORD dwByteCount,
  64. IN PVOID lpBytes,
  65. IN LPCWSTR Arg1
  66. );
  67. #define ClusResLogEventByKey(_hKey_, _level_, _msgid_) \
  68. ClusResLogEventWithName0(_hKey_, \
  69. _level_, \
  70. LOG_CURRENT_MODULE, \
  71. __FILE__, \
  72. __LINE__, \
  73. _msgid_, \
  74. 0, \
  75. NULL)
  76. #define ClusResLogEventByKey1(_hKey_, _level_, _msgid_, _arg1_) \
  77. ClusResLogEventWithName1(_hKey_, \
  78. _level_, \
  79. LOG_CURRENT_MODULE, \
  80. __FILE__, \
  81. __LINE__, \
  82. _msgid_, \
  83. 0, \
  84. NULL, \
  85. _arg1_)
  86. #define ClusResLogEventByKeyData(_hKey_, _level_, _msgid_, dwBytes, pData) \
  87. ClusResLogEventWithName0(_hKey_, \
  88. _level_, \
  89. LOG_CURRENT_MODULE, \
  90. __FILE__, \
  91. __LINE__, \
  92. _msgid_, \
  93. 0, \
  94. NULL)
  95. #define ClusResLogEvent(_level_, _msgid_) \
  96. ClusterLogEvent0(_level_, \
  97. LOG_CURRENT_MODULE, \
  98. __FILE__, \
  99. __LINE__, \
  100. (_msgid_), \
  101. 0, \
  102. NULL)
  103. #define ClusResLogEvent1(_level_, _msgid_, _arg1_) \
  104. ClusterLogEvent1(_level_, \
  105. LOG_CURRENT_MODULE, \
  106. __FILE__, \
  107. __LINE__, \
  108. (_msgid_), \
  109. 0, \
  110. NULL, \
  111. (_arg1_))
  112. #define ClusResLogEvent2(_level_, _msgid_, _arg1_, _arg2_) \
  113. ClusterLogEvent2(_level_, \
  114. LOG_CURRENT_MODULE, \
  115. __FILE__, \
  116. __LINE__, \
  117. (_msgid_), \
  118. 0, \
  119. NULL, \
  120. (_arg1_), \
  121. (_arg2_))
  122. #define ClusResLogEvent3(_level_, _msgid_, _arg1_, _arg2_, _arg3_) \
  123. ClusterLogEvent3(_level_, \
  124. LOG_CURRENT_MODULE, \
  125. __FILE__, \
  126. __LINE__, \
  127. (_msgid_), \
  128. 0, \
  129. NULL, \
  130. (_arg1_), \
  131. (_arg2_), \
  132. (_arg3_))
  133. #define ClusResLogEventData(_level_, _msgid_, _dwBytes_, _pData_) \
  134. ClusterLogEvent0(_level_, \
  135. LOG_CURRENT_MODULE, \
  136. __FILE__, \
  137. __LINE__, \
  138. (_msgid_), \
  139. (_dwBytes_), \
  140. (_pData_))
  141. #define ClusResLogEventData1(_level_, _msgid_, _dwBytes_, _pData_, _arg1_) \
  142. ClusterLogEvent1(_level_, \
  143. LOG_CURRENT_MODULE, \
  144. __FILE__, \
  145. __LINE__, \
  146. (_msgid_), \
  147. (_dwBytes_), \
  148. (_pData_), \
  149. (_arg1_))
  150. #define ClusResLogEventData2(_level_, _msgid_, _dwBytes_, _pData_, _arg1_, _arg2_) \
  151. ClusterLogEvent2(_level_, \
  152. LOG_CURRENT_MODULE, \
  153. __FILE__, \
  154. __LINE__, \
  155. (_msgid_), \
  156. (_dwBytes_), \
  157. (_pData_), \
  158. (_arg1_), \
  159. (_arg2_))
  160. #define ClusResLogEventData3(_level_, _msgid_, _dwBytes_, _pData_, _arg1_, _arg2_, _arg3_) \
  161. ClusterLogEvent3(_level_, \
  162. LOG_CURRENT_MODULE, \
  163. __FILE__, \
  164. __LINE__, \
  165. (_msgid_), \
  166. (_dwBytes_), \
  167. (_pData_), \
  168. (_arg1_), \
  169. (_arg2_), \
  170. (_arg3_))
  171. //
  172. // Define interfaces exposed by each specified resource DLL and
  173. // referenced by the common CLUSRES wrapper.
  174. //
  175. #define LOG_MODULE_GENAPP 0x801
  176. #define LOG_MODULE_GENSVC 0x802
  177. #define LOG_MODULE_FTSET 0x803
  178. #define LOG_MODULE_DISK 0x804
  179. #define LOG_MODULE_NETNAME 0x805
  180. #define LOG_MODULE_IPADDR 0x806
  181. #define LOG_MODULE_SMB 0x807
  182. #define LOG_MODULE_TIME 0x808
  183. #define LOG_MODULE_SPOOL 0x809
  184. #define LOG_MODULE_LKQRM 0x80A
  185. #define LOG_MODULE_DHCP 0x80B
  186. #define LOG_MODULE_MSMQ 0x80C
  187. #define LOG_MODULE_MSDTC 0x80D
  188. //
  189. // interfaces for GENAPP
  190. //
  191. extern CLRES_FUNCTION_TABLE GenAppFunctionTable;
  192. BOOLEAN
  193. WINAPI
  194. GenAppDllEntryPoint(
  195. IN HINSTANCE DllHandle,
  196. IN DWORD Reason,
  197. IN LPVOID Reserved
  198. );
  199. //
  200. // interfaces for GENSVC
  201. //
  202. extern CLRES_FUNCTION_TABLE GenSvcFunctionTable;
  203. BOOLEAN
  204. WINAPI
  205. GenSvcDllEntryPoint(
  206. IN HINSTANCE DllHandle,
  207. IN DWORD Reason,
  208. IN LPVOID Reserved
  209. );
  210. //
  211. // interfaces for DISKS and FTSET
  212. //
  213. extern CLRES_FUNCTION_TABLE DisksFunctionTable;
  214. extern CLRES_FUNCTION_TABLE FtSetFunctionTable;
  215. BOOLEAN
  216. WINAPI
  217. DisksDllEntryPoint(
  218. IN HINSTANCE DllHandle,
  219. IN DWORD Reason,
  220. IN LPVOID Reserved
  221. );
  222. BOOLEAN
  223. WINAPI
  224. FtSetDllEntryPoint(
  225. IN HINSTANCE DllHandle,
  226. IN DWORD Reason,
  227. IN LPVOID Reserved
  228. );
  229. //
  230. // interfaces for NETNAME
  231. //
  232. extern CLRES_FUNCTION_TABLE NetNameFunctionTable;
  233. BOOLEAN
  234. WINAPI
  235. NetNameDllEntryPoint(
  236. IN HINSTANCE DllHandle,
  237. IN DWORD Reason,
  238. IN LPVOID Reserved
  239. );
  240. //
  241. // interfaces for IPADDR
  242. //
  243. extern CLRES_FUNCTION_TABLE IpAddrFunctionTable;
  244. BOOLEAN
  245. WINAPI
  246. IpAddrDllEntryPoint(
  247. IN HINSTANCE DllHandle,
  248. IN DWORD Reason,
  249. IN LPVOID Reserved
  250. );
  251. //
  252. // interfaces for File Shares
  253. //
  254. extern CLRES_FUNCTION_TABLE SmbShareFunctionTable;
  255. BOOLEAN
  256. WINAPI
  257. SmbShareDllEntryPoint(
  258. IN HINSTANCE DllHandle,
  259. IN DWORD Reason,
  260. IN LPVOID Reserved
  261. );
  262. //
  263. // interfaces for Spool Service
  264. //
  265. extern CLRES_FUNCTION_TABLE SplSvcFunctionTable;
  266. BOOLEAN
  267. WINAPI
  268. SplSvcDllEntryPoint(
  269. IN HINSTANCE DllHandle,
  270. IN DWORD Reason,
  271. IN LPVOID Reserved
  272. );
  273. //
  274. // interfaces for Local Quorum
  275. //
  276. extern CLRES_FUNCTION_TABLE LkQuorumFunctionTable;
  277. BOOLEAN
  278. WINAPI
  279. LkQuorumDllEntryPoint(
  280. IN HINSTANCE DllHandle,
  281. IN DWORD Reason,
  282. IN LPVOID Reserved
  283. );
  284. //
  285. // interfaces for DHCP Server
  286. //
  287. extern CLRES_FUNCTION_TABLE DhcpFunctionTable;
  288. BOOLEAN
  289. WINAPI
  290. DhcpDllEntryPoint(
  291. IN HINSTANCE DllHandle,
  292. IN DWORD Reason,
  293. IN LPVOID Reserved
  294. );
  295. //
  296. // interfaces for DHCP Server
  297. //
  298. extern CLRES_FUNCTION_TABLE MsMQFunctionTable;
  299. BOOLEAN
  300. WINAPI
  301. MsMQDllEntryPoint(
  302. IN HINSTANCE DllHandle,
  303. IN DWORD Reason,
  304. IN LPVOID Reserved
  305. );
  306. //
  307. // interfaces for DHCP Server
  308. //
  309. extern CLRES_FUNCTION_TABLE MsDTCFunctionTable;
  310. BOOLEAN
  311. WINAPI
  312. MsDTCDllEntryPoint(
  313. IN HINSTANCE DllHandle,
  314. IN DWORD Reason,
  315. IN LPVOID Reserved
  316. );
  317. //
  318. // interfaces for DHCP Server
  319. //
  320. extern CLRES_FUNCTION_TABLE TimeSvcFunctionTable;
  321. BOOLEAN
  322. WINAPI
  323. TimeSvcDllEntryPoint(
  324. IN HINSTANCE DllHandle,
  325. IN DWORD Reason,
  326. IN LPVOID Reserved
  327. );