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.

426 lines
8.9 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. fsd.c
  5. Abstract:
  6. This module implements the File System pageable data. It is here because of
  7. the restrictions on pageable code and data in a single module.
  8. Author:
  9. Jameel Hyder (microsoft!jameelh)
  10. Revision History:
  11. 10 Nov 1993 Initial Version
  12. --*/
  13. #define FILENUM FILE_FSDDATA
  14. #define SERVER_LOCALS
  15. #include <afp.h>
  16. #define AFPADMIN_LOCALS
  17. #include <afpadmin.h>
  18. #include <scavengr.h>
  19. #include <access.h>
  20. #include <secutil.h>
  21. #ifdef ALLOC_DATA_PRAGMA
  22. #pragma data_seg("PAGE")
  23. #endif
  24. INIT_SYSTEMS AfpInitSubSystems[NUM_INIT_SYSTEMS] =
  25. {
  26. { AfpMacAnsiInit, AfpMacAnsiDeInit,
  27. #if DBG
  28. False, False
  29. ,"AfpMacAnsiInit", "AfpMacAnsiDeInit"
  30. #endif
  31. },
  32. { AfpFileIoInit, NULL,
  33. #if DBG
  34. False, False
  35. ,"AfpFileIoInit", NULL
  36. #endif
  37. },
  38. { AfpSdaInit, NULL,
  39. #if DBG
  40. False, False
  41. ,"AfpSdaInit", NULL
  42. #endif
  43. },
  44. { AfpVolumeInit, NULL,
  45. #if DBG
  46. False, False
  47. ,"AfpVolumeInit", NULL,
  48. #endif
  49. },
  50. { AfpForksInit, NULL,
  51. #if DBG
  52. False, False
  53. ,"AfpForksInit", NULL,
  54. #endif
  55. },
  56. { AfpDesktopInit, NULL,
  57. #if DBG
  58. False, False
  59. ,"AfpDesktopInit", NULL,
  60. #endif
  61. },
  62. { AfpScavengerInit, AfpScavengerDeInit,
  63. #if DBG
  64. False, False
  65. ,"AfpScavengerInit","AfpScavengerDeInit"
  66. #endif
  67. },
  68. { AfpSecUtilInit, AfpSecUtilDeInit,
  69. #if DBG
  70. False, False
  71. ,"AfpInitSecUtil", "AfpSecUtilDeInit"
  72. #endif
  73. },
  74. // The following should happen after the scavenger is initialized
  75. { AfpMemoryInit, AfpMemoryDeInit,
  76. #if DBG
  77. False, False
  78. ,"AfpMemoryDeInit", "AfpMemoryDeInit"
  79. #endif
  80. },
  81. { NULL, AfpAdminDeInit,
  82. #if DBG
  83. False, False
  84. ,NULL, "AfpAdminDeInit"
  85. #endif
  86. },
  87. { AfpDfeInit, AfpDfeDeInit,
  88. #if DBG
  89. False, False
  90. ,"AfpDfeInit", "AfpDfeDeInit"
  91. #endif
  92. }
  93. };
  94. // This table is tightly linked to the opcode definitions in H\ADMIN.H
  95. ADMIN_DISPATCH_TABLE AfpAdminDispatchTable[CC_BASE_MAX] =
  96. {
  97. {
  98. 0, 0,
  99. True, OP_SERVICE_START,
  100. NULL, AfpAdmServiceStart,
  101. {
  102. { DESC_NONE, 0 },
  103. { DESC_NONE, 0 },
  104. { DESC_NONE, 0 }
  105. }
  106. },
  107. {
  108. 0, 0,
  109. True, OP_SERVICE_STOP,
  110. NULL, AfpAdmServiceStop,
  111. {
  112. { DESC_NONE, 0 },
  113. { DESC_NONE, 0 },
  114. { DESC_NONE, 0 }
  115. }
  116. },
  117. {
  118. 0, 0,
  119. True, OP_SERVICE_PAUSE,
  120. NULL, AfpAdmServicePause,
  121. {
  122. { DESC_NONE, 0 },
  123. { DESC_NONE, 0 },
  124. { DESC_NONE, 0 }
  125. }
  126. },
  127. {
  128. 0, 0,
  129. True, OP_SERVICE_CONTINUE,
  130. NULL, AfpAdmServiceContinue,
  131. {
  132. { DESC_NONE, 0 },
  133. { DESC_NONE, 0 },
  134. { DESC_NONE, 0 }
  135. }
  136. },
  137. {
  138. sizeof(AFP_STATISTICS_INFO), 0,
  139. False, OP_GET_STATISTICS,
  140. AfpAdmGetStatistics, NULL,
  141. {
  142. { DESC_NONE, 0 },
  143. { DESC_NONE, 0 },
  144. { DESC_NONE, 0 }
  145. }
  146. },
  147. {
  148. sizeof(AFP_STATISTICS_INFO_EX), 0,
  149. False, OP_GET_STATISTICS_EX,
  150. AfpAdmGetStatisticsEx, NULL,
  151. {
  152. { DESC_NONE, 0 },
  153. { DESC_NONE, 0 },
  154. { DESC_NONE, 0 }
  155. }
  156. },
  157. {
  158. 0, 0,
  159. False, OP_CLEAR_STATISTICS,
  160. AfpAdmClearStatistics, NULL,
  161. {
  162. { DESC_NONE, 0 },
  163. { DESC_NONE, 0 },
  164. { DESC_NONE, 0 }
  165. }
  166. },
  167. {
  168. sizeof(AFP_PROFILE_INFO), 0,
  169. False, OP_GET_PROF_COUNTERS,
  170. AfpAdmGetProfCounters, NULL,
  171. {
  172. { DESC_NONE, 0 },
  173. { DESC_NONE, 0 },
  174. { DESC_NONE, 0 }
  175. }
  176. },
  177. {
  178. 0, 0,
  179. False, OP_CLEAR_PROF_COUNTERS,
  180. AfpAdmClearProfCounters, NULL,
  181. {
  182. { DESC_NONE, 0 },
  183. { DESC_NONE, 0 },
  184. { DESC_NONE, 0 }
  185. }
  186. },
  187. {
  188. sizeof(AFP_SID_OFFSET_DESC), 0,
  189. True, OP_SERVER_ADD_SID_OFFSETS,
  190. AfpAdmServerSetParms, NULL,
  191. {
  192. { DESC_SPECIAL, 0 },
  193. { DESC_NONE, 0 },
  194. { DESC_NONE, 0 }
  195. }
  196. },
  197. {
  198. 0, 0,
  199. False, OP_SERVER_GET_INFO,
  200. AfpAdmServerGetInfo, NULL,
  201. {
  202. { DESC_NONE, 0 },
  203. { DESC_NONE, 0 },
  204. { DESC_NONE, 0 }
  205. }
  206. },
  207. {
  208. sizeof(AFP_SERVER_INFO), sizeof(SETINFOREQPKT),
  209. True, OP_SERVER_SET_INFO,
  210. NULL, AfpAdmWServerSetInfo,
  211. {
  212. { DESC_STRING, sizeof(SETINFOREQPKT) + FIELD_OFFSET(AFP_SERVER_INFO, afpsrv_name) },
  213. { DESC_STRING, sizeof(SETINFOREQPKT) + FIELD_OFFSET(AFP_SERVER_INFO, afpsrv_login_msg) },
  214. { DESC_STRING, sizeof(SETINFOREQPKT) + FIELD_OFFSET(AFP_SERVER_INFO, afpsrv_codepage) },
  215. }
  216. },
  217. {
  218. sizeof(SRVETCPKT), 0,
  219. True, OP_SERVER_ADD_ETC,
  220. AfpAdmServerAddEtc, NULL,
  221. {
  222. { DESC_ETC, FIELD_OFFSET(SRVETCPKT, retc_NumEtcMaps) },
  223. { DESC_NONE, 0 },
  224. { DESC_NONE, 0 }
  225. }
  226. },
  227. {
  228. sizeof(ETCMAPINFO), sizeof(SETINFOREQPKT),
  229. True, OP_SERVER_SET_ETC,
  230. AfpAdmServerSetEtc, NULL,
  231. {
  232. { DESC_NONE, 0 },
  233. { DESC_NONE, 0 },
  234. { DESC_NONE, 0 }
  235. }
  236. },
  237. {
  238. sizeof(ETCMAPINFO), 0,
  239. True, OP_SERVER_DELETE_ETC,
  240. AfpAdmServerDeleteEtc, NULL,
  241. {
  242. { DESC_NONE, 0 },
  243. { DESC_NONE, 0 },
  244. { DESC_NONE, 0 }
  245. }
  246. },
  247. {
  248. sizeof(SRVICONINFO), 0,
  249. True, OP_SERVER_ADD_ICON,
  250. AfpAdmServerAddIcon, NULL,
  251. {
  252. { DESC_ICON, FIELD_OFFSET(SRVICONINFO, icon_length) },
  253. { DESC_NONE, 0 },
  254. { DESC_NONE, 0 }
  255. }
  256. },
  257. {
  258. sizeof(AFP_VOLUME_INFO), 0,
  259. True, OP_VOLUME_ADD,
  260. AfpAdmVolumeAdd, AfpAdmWVolumeAdd,
  261. {
  262. { DESC_STRING, FIELD_OFFSET(AFP_VOLUME_INFO, afpvol_name) },
  263. { DESC_STRING, FIELD_OFFSET(AFP_VOLUME_INFO, afpvol_password) },
  264. { DESC_STRING, FIELD_OFFSET(AFP_VOLUME_INFO, afpvol_path) }
  265. }
  266. },
  267. {
  268. sizeof(AFP_VOLUME_INFO), 0,
  269. True, OP_VOLUME_DELETE,
  270. NULL, AfpAdmWVolumeDelete,
  271. {
  272. { DESC_STRING, FIELD_OFFSET(AFP_VOLUME_INFO, afpvol_name) },
  273. { DESC_STRING, FIELD_OFFSET(AFP_VOLUME_INFO, afpvol_password) },
  274. { DESC_STRING, FIELD_OFFSET(AFP_VOLUME_INFO, afpvol_path) }
  275. }
  276. },
  277. {
  278. sizeof(AFP_VOLUME_INFO), 0,
  279. False, OP_VOLUME_GET_INFO,
  280. AfpAdmVolumeGetInfo, NULL,
  281. {
  282. { DESC_STRING, FIELD_OFFSET(AFP_VOLUME_INFO, afpvol_name) },
  283. { DESC_NONE, 0 },
  284. { DESC_NONE, 0 }
  285. }
  286. },
  287. {
  288. sizeof(SETINFOREQPKT) + sizeof(AFP_VOLUME_INFO), sizeof(SETINFOREQPKT),
  289. True, OP_VOLUME_SET_INFO,
  290. AfpAdmVolumeSetInfo, NULL,
  291. {
  292. { DESC_STRING, sizeof(SETINFOREQPKT) + FIELD_OFFSET(AFP_VOLUME_INFO, afpvol_name) },
  293. { DESC_STRING, sizeof(SETINFOREQPKT) + FIELD_OFFSET(AFP_VOLUME_INFO, afpvol_password) },
  294. { DESC_STRING, sizeof(SETINFOREQPKT) + FIELD_OFFSET(AFP_VOLUME_INFO, afpvol_path) }
  295. }
  296. },
  297. {
  298. sizeof(ENUMREQPKT), 0,
  299. False, OP_VOLUME_ENUM,
  300. AfpAdmVolumeEnum, NULL,
  301. {
  302. { DESC_NONE, 0 },
  303. { DESC_NONE, 0 },
  304. { DESC_NONE, 0 }
  305. }
  306. },
  307. {
  308. sizeof(ENUMREQPKT), 0,
  309. False, OP_SESSION_ENUM,
  310. AfpAdmSessionEnum, NULL,
  311. {
  312. { DESC_NONE, 0 },
  313. { DESC_NONE, 0 },
  314. { DESC_NONE, 0 }
  315. }
  316. },
  317. {
  318. sizeof(AFP_SESSION_INFO), 0,
  319. True, OP_SESSION_CLOSE,
  320. NULL, AfpAdmWSessionClose,
  321. {
  322. { DESC_NONE, 0 },
  323. { DESC_NONE, 0 },
  324. { DESC_NONE, 0 }
  325. }
  326. },
  327. {
  328. sizeof(ENUMREQPKT), 0,
  329. False, OP_CONNECTION_ENUM,
  330. AfpAdmConnectionEnum, NULL,
  331. {
  332. { DESC_NONE, 0 },
  333. { DESC_NONE, 0 },
  334. { DESC_NONE, 0 }
  335. }
  336. },
  337. {
  338. sizeof(ENUMREQPKT), 0,
  339. True, OP_CONNECTION_CLOSE,
  340. NULL, AfpAdmWConnectionClose,
  341. {
  342. { DESC_NONE, 0 },
  343. { DESC_NONE, 0 },
  344. { DESC_NONE, 0 }
  345. }
  346. },
  347. {
  348. sizeof(AFP_DIRECTORY_INFO), 0,
  349. False, OP_DIRECTORY_GET_INFO,
  350. NULL, AfpAdmWDirectoryGetInfo,
  351. {
  352. { DESC_STRING, FIELD_OFFSET(AFP_DIRECTORY_INFO, afpdir_path) },
  353. { DESC_NONE, 0 },
  354. { DESC_NONE, 0 }
  355. }
  356. },
  357. {
  358. sizeof(SETINFOREQPKT) + sizeof(AFP_DIRECTORY_INFO), sizeof(SETINFOREQPKT),
  359. True, OP_DIRECTORY_SET_INFO,
  360. NULL, AfpAdmWDirectorySetInfo,
  361. { { DESC_STRING, sizeof(SETINFOREQPKT) + FIELD_OFFSET(AFP_DIRECTORY_INFO, afpdir_path) },
  362. { DESC_SID, sizeof(SETINFOREQPKT) + FIELD_OFFSET(AFP_DIRECTORY_INFO, afpdir_owner) },
  363. { DESC_SID, sizeof(SETINFOREQPKT) + FIELD_OFFSET(AFP_DIRECTORY_INFO, afpdir_group) } }
  364. },
  365. {
  366. sizeof(ENUMREQPKT), 0,
  367. False, OP_FORK_ENUM,
  368. AfpAdmForkEnum, NULL,
  369. {
  370. { DESC_NONE, 0 },
  371. { DESC_NONE, 0 },
  372. { DESC_NONE, 0 }
  373. }
  374. },
  375. {
  376. sizeof(AFP_FILE_INFO), 0,
  377. True, OP_FORK_CLOSE,
  378. NULL, AfpAdmWForkClose,
  379. {
  380. { DESC_NONE, 0 },
  381. { DESC_NONE, 0 },
  382. { DESC_NONE, 0 }
  383. }
  384. },
  385. {
  386. sizeof(AFP_MESSAGE_INFO), 0,
  387. True, OP_MESSAGE_SEND,
  388. AfpAdmMessageSend, NULL,
  389. {
  390. { DESC_STRING, FIELD_OFFSET(AFP_MESSAGE_INFO, afpmsg_text) },
  391. { DESC_NONE, 0 },
  392. { DESC_NONE, 0 }
  393. }
  394. },
  395. {
  396. sizeof(SETINFOREQPKT) + sizeof(AFP_FINDER_INFO), sizeof(SETINFOREQPKT),
  397. True, OP_FINDER_SET,
  398. NULL, AfpAdmWFinderSetInfo,
  399. {
  400. { DESC_STRING, sizeof(SETINFOREQPKT) + FIELD_OFFSET(AFP_FINDER_INFO, afpfd_path) },
  401. { DESC_NONE, 0 },
  402. { DESC_NONE, 0 }
  403. }
  404. }
  405. };
  406. #ifdef ALLOC_DATA_PRAGMA
  407. #pragma data_seg()
  408. #endif
  409.