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.

324 lines
8.4 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. Ntdisp.h
  5. Abstract:
  6. This module prototypes the upper level routines used in dispatching to the implementations
  7. Author:
  8. Joe Linn [JoeLinn] 24-aug-1994
  9. Revision History:
  10. --*/
  11. #ifndef _DISPATCH_STUFF_DEFINED_
  12. #define _DISPATCH_STUFF_DEFINED_
  13. VOID
  14. RxInitializeDispatchVectors (
  15. OUT PDRIVER_OBJECT DriverObject
  16. );
  17. //
  18. // The global structure used to contain our fast I/O callbacks; this is
  19. // exposed because it's needed in read/write; we could use a wrapper....probably should. but since
  20. // ccinitializecachemap will be macro'd differently for win9x; we'll just doit there.
  21. //
  22. extern FAST_IO_DISPATCH RxFastIoDispatch;
  23. //
  24. // The following funcs are implemented in DevFCB.c
  25. //
  26. NTSTATUS
  27. RxCommonDevFCBCleanup (
  28. IN PRX_CONTEXT RxContext,
  29. IN PIRP Irp
  30. );
  31. NTSTATUS
  32. RxCommonDevFCBClose (
  33. IN PRX_CONTEXT RxContext,
  34. IN PIRP Irp
  35. );
  36. NTSTATUS
  37. RxCommonDevFCBIoCtl (
  38. IN PRX_CONTEXT RxContext,
  39. IN PIRP Irp
  40. );
  41. NTSTATUS
  42. RxCommonDevFCBFsCtl (
  43. IN PRX_CONTEXT RxContext,
  44. IN PIRP Irp
  45. );
  46. NTSTATUS
  47. RxCommonDevFCBQueryVolInfo (
  48. IN PRX_CONTEXT RxContext,
  49. IN PIRP Irp
  50. );
  51. //
  52. // contained here are the fastio dispatch routines and the fsrtl callback routines
  53. //
  54. //
  55. // The following macro is used to determine if an FSD thread can block
  56. // for I/O or wait for a resource. It returns TRUE if the thread can
  57. // block and FALSE otherwise. This attribute can then be used to call
  58. // the FSD & FSP common work routine with the proper wait value.
  59. //
  60. #define CanFsdWait(IRP) IoIsOperationSynchronous(IRP)
  61. //
  62. // The FSP level dispatch/main routine. This is the routine that takes
  63. // IRP's off of the work queue and calls the appropriate FSP level
  64. // work routine.
  65. //
  66. VOID
  67. RxFspDispatch ( // implemented in FspDisp.c
  68. IN PVOID Context
  69. );
  70. //
  71. // The following routines are the FSP work routines that are called
  72. // by the preceding RxFspDispath routine. Each takes as input a pointer
  73. // to the IRP, perform the function, and return a pointer to the volume
  74. // device object that they just finished servicing (if any). The return
  75. // pointer is then used by the main Fsp dispatch routine to check for
  76. // additional IRPs in the volume's overflow queue.
  77. //
  78. // Each of the following routines is also responsible for completing the IRP.
  79. // We moved this responsibility from the main loop to the individual routines
  80. // to allow them the ability to complete the IRP and continue post processing
  81. // actions.
  82. //
  83. NTSTATUS
  84. RxCommonCleanup ( // implemented in Cleanup.c
  85. IN PRX_CONTEXT RxContext,
  86. IN PIRP Irp
  87. );
  88. NTSTATUS
  89. RxCommonClose ( // implemented in Close.c
  90. IN PRX_CONTEXT RxContext,
  91. IN PIRP Irp
  92. );
  93. VOID
  94. RxFspClose (
  95. IN PVCB Vcb OPTIONAL
  96. );
  97. NTSTATUS
  98. RxCommonCreate ( // implemented in Create.c
  99. IN PRX_CONTEXT RxContext,
  100. IN PIRP Irp
  101. );
  102. NTSTATUS
  103. RxCommonDirectoryControl ( // implemented in DirCtrl.c
  104. IN PRX_CONTEXT RxContext,
  105. IN PIRP Irp
  106. );
  107. NTSTATUS
  108. RxCommonDeviceControl ( // implemented in DevCtrl.c
  109. IN PRX_CONTEXT RxContext,
  110. IN PIRP Irp
  111. );
  112. NTSTATUS
  113. RxCommonQueryEa ( // implemented in Ea.c
  114. IN PRX_CONTEXT RxContext,
  115. IN PIRP Irp
  116. );
  117. NTSTATUS
  118. RxCommonSetEa ( // implemented in Ea.c
  119. IN PRX_CONTEXT RxContext,
  120. IN PIRP Irp
  121. );
  122. NTSTATUS
  123. RxCommonQuerySecurity ( // implemented in Ea.c
  124. IN PRX_CONTEXT RxContext,
  125. IN PIRP Irp
  126. );
  127. NTSTATUS
  128. RxCommonSetSecurity ( // implemented in Ea.c
  129. IN PRX_CONTEXT RxContext,
  130. IN PIRP Irp
  131. );
  132. NTSTATUS
  133. RxCommonQueryInformation ( // implemented in FileInfo.c
  134. IN PRX_CONTEXT RxContext,
  135. IN PIRP Irp
  136. );
  137. NTSTATUS
  138. RxCommonSetInformation ( // implemented in FileInfo.c
  139. IN PRX_CONTEXT RxContext,
  140. IN PIRP Irp
  141. );
  142. NTSTATUS
  143. RxCommonFlushBuffers ( // implemented in Flush.c
  144. IN PRX_CONTEXT RxContext,
  145. IN PIRP Irp
  146. );
  147. NTSTATUS
  148. RxCommonFileSystemControl ( // implemented in FsCtrl.c
  149. IN PRX_CONTEXT RxContext,
  150. IN PIRP Irp
  151. );
  152. NTSTATUS
  153. RxCommonLockControl ( // implemented in LockCtrl.c
  154. IN PRX_CONTEXT RxContext,
  155. IN PIRP Irp
  156. );
  157. NTSTATUS
  158. RxCommonShutdown ( // implemented in Shutdown.c
  159. IN PRX_CONTEXT RxContext,
  160. IN PIRP Irp
  161. );
  162. NTSTATUS
  163. RxCommonRead ( // implemented in Read.c
  164. IN PRX_CONTEXT RxContext,
  165. IN PIRP Irp
  166. );
  167. NTSTATUS
  168. RxCommonQueryVolumeInformation ( // implemented in VolInfo.c
  169. IN PRX_CONTEXT RxContext,
  170. IN PIRP Irp
  171. );
  172. NTSTATUS
  173. RxCommonSetVolumeInformation ( // implemented in VolInfo.c
  174. IN PRX_CONTEXT RxContext,
  175. IN PIRP Irp
  176. );
  177. NTSTATUS
  178. RxCommonWrite ( // implemented in Write.c
  179. IN PRX_CONTEXT RxContext,
  180. IN PIRP Irp
  181. );
  182. NTSTATUS
  183. RxCommonQueryQuotaInformation ( // implemented in Ea.c
  184. IN PRX_CONTEXT RxContext,
  185. IN PIRP Irp
  186. );
  187. NTSTATUS
  188. RxCommonSetQuotaInformation ( // implemented in Ea.c
  189. IN PRX_CONTEXT RxContext,
  190. IN PIRP Irp
  191. );
  192. // Here are the callbacks used by the I/O system for checking for fast I/O or
  193. // doing a fast query info call, or doing fast lock calls.
  194. //
  195. BOOLEAN
  196. RxFastIoRead (
  197. IN PFILE_OBJECT FileObject,
  198. IN PLARGE_INTEGER FileOffset,
  199. IN ULONG Length,
  200. IN BOOLEAN Wait,
  201. IN ULONG LockKey,
  202. OUT PVOID Buffer,
  203. OUT PIO_STATUS_BLOCK IoStatus,
  204. IN PDEVICE_OBJECT DeviceObject
  205. );
  206. BOOLEAN
  207. RxFastIoWrite (
  208. IN PFILE_OBJECT FileObject,
  209. IN PLARGE_INTEGER FileOffset,
  210. IN ULONG Length,
  211. IN BOOLEAN Wait,
  212. IN ULONG LockKey,
  213. IN PVOID Buffer,
  214. OUT PIO_STATUS_BLOCK IoStatus,
  215. IN PDEVICE_OBJECT DeviceObject
  216. );
  217. BOOLEAN
  218. RxFastIoCheckIfPossible (
  219. IN PFILE_OBJECT FileObject,
  220. IN PLARGE_INTEGER FileOffset,
  221. IN ULONG Length,
  222. IN BOOLEAN Wait,
  223. IN ULONG LockKey,
  224. IN BOOLEAN CheckForReadOperation,
  225. OUT PIO_STATUS_BLOCK IoStatus,
  226. IN PDEVICE_OBJECT DeviceObject
  227. );
  228. BOOLEAN
  229. RxFastIoDeviceControl (
  230. IN PFILE_OBJECT FileObject,
  231. IN BOOLEAN Wait,
  232. IN PVOID InputBuffer OPTIONAL,
  233. IN ULONG InputBufferLength,
  234. OUT PVOID OutputBuffer OPTIONAL,
  235. IN ULONG OutputBufferLength,
  236. IN ULONG IoControlCode,
  237. OUT PIO_STATUS_BLOCK IoStatus,
  238. IN PDEVICE_OBJECT DeviceObject
  239. );
  240. //
  241. // The following macro is used to set the is fast i/o possible field in
  242. // the common part of the nonpaged fcb
  243. //
  244. //
  245. // BOOLEAN
  246. // RxIsFastIoPossible (
  247. // IN PFCB Fcb
  248. // );
  249. //
  250. //
  251. // Instead of RxIsFastIoPossible...we set the state to questionable.....this will cause us to be consulted on every call via out
  252. // CheckIfFastIoIsPossibleCallOut. in this way, we don't have to be continually setting and resetting this
  253. //
  254. VOID
  255. RxAcquireFileForNtCreateSection (
  256. IN PFILE_OBJECT FileObject
  257. );
  258. VOID
  259. RxReleaseFileForNtCreateSection (
  260. IN PFILE_OBJECT FileObject
  261. );
  262. //
  263. #endif // _DISPATCH_STUFF_DEFINED_
  264.