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.

309 lines
8.7 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. NTSTATUS
  24. RxCommonDevFCBCleanup ( RXCOMMON_SIGNATURE ); // implemented in DevFCB.c
  25. NTSTATUS
  26. RxCommonDevFCBClose ( RXCOMMON_SIGNATURE ); // implemented in DevFCB.c
  27. NTSTATUS
  28. RxCommonDevFCBIoCtl ( RXCOMMON_SIGNATURE ); // implemented in DevFCB.c
  29. NTSTATUS
  30. RxCommonDevFCBFsCtl ( RXCOMMON_SIGNATURE ); // implemented in DevFCB.c
  31. NTSTATUS
  32. RxCommonDevFCBQueryVolInfo ( RXCOMMON_SIGNATURE ); // implemented in DevFCB.c
  33. //
  34. //
  35. // contained here are the fastio dispatch routines and the fsrtl callback routines
  36. //
  37. // The following macro is used to determine if an FSD thread can block
  38. // for I/O or wait for a resource. It returns TRUE if the thread can
  39. // block and FALSE otherwise. This attribute can then be used to call
  40. // the FSD & FSP common work routine with the proper wait value.
  41. //
  42. #define CanFsdWait(IRP) IoIsOperationSynchronous(Irp)
  43. //
  44. // The FSP level dispatch/main routine. This is the routine that takes
  45. // IRP's off of the work queue and calls the appropriate FSP level
  46. // work routine.
  47. //
  48. VOID
  49. RxFspDispatch ( // implemented in FspDisp.c
  50. IN PVOID Context
  51. );
  52. //
  53. // The following routines are the FSP work routines that are called
  54. // by the preceding RxFspDispath routine. Each takes as input a pointer
  55. // to the IRP, perform the function, and return a pointer to the volume
  56. // device object that they just finished servicing (if any). The return
  57. // pointer is then used by the main Fsp dispatch routine to check for
  58. // additional IRPs in the volume's overflow queue.
  59. //
  60. // Each of the following routines is also responsible for completing the IRP.
  61. // We moved this responsibility from the main loop to the individual routines
  62. // to allow them the ability to complete the IRP and continue post processing
  63. // actions.
  64. //
  65. NTSTATUS
  66. RxCommonCleanup ( RXCOMMON_SIGNATURE ); // implemented in Cleanup.c
  67. NTSTATUS
  68. RxCommonClose ( RXCOMMON_SIGNATURE ); // implemented in Close.c
  69. VOID
  70. RxFspClose (
  71. IN PVCB Vcb OPTIONAL
  72. );
  73. NTSTATUS
  74. RxCommonCreate ( RXCOMMON_SIGNATURE ); // implemented in Create.c
  75. NTSTATUS
  76. RxCommonDirectoryControl ( RXCOMMON_SIGNATURE ); // implemented in DirCtrl.c
  77. NTSTATUS
  78. RxCommonDeviceControl ( RXCOMMON_SIGNATURE ); // implemented in DevCtrl.c
  79. NTSTATUS
  80. RxCommonQueryEa ( RXCOMMON_SIGNATURE ); // implemented in Ea.c
  81. NTSTATUS
  82. RxCommonSetEa ( RXCOMMON_SIGNATURE ); // implemented in Ea.c
  83. NTSTATUS
  84. RxCommonQuerySecurity ( RXCOMMON_SIGNATURE ); // implemented in Ea.c
  85. NTSTATUS
  86. RxCommonSetSecurity ( RXCOMMON_SIGNATURE ); // implemented in Ea.c
  87. NTSTATUS
  88. RxCommonQueryInformation ( RXCOMMON_SIGNATURE ); // implemented in FileInfo.c
  89. NTSTATUS
  90. RxCommonSetInformation ( RXCOMMON_SIGNATURE ); // implemented in FileInfo.c
  91. NTSTATUS
  92. RxCommonFlushBuffers ( RXCOMMON_SIGNATURE ); // implemented in Flush.c
  93. NTSTATUS
  94. RxCommonFileSystemControl ( RXCOMMON_SIGNATURE ); // implemented in FsCtrl.c
  95. NTSTATUS
  96. RxCommonLockControl ( RXCOMMON_SIGNATURE ); // implemented in LockCtrl.c
  97. NTSTATUS
  98. RxCommonShutdown ( RXCOMMON_SIGNATURE ); // implemented in Shutdown.c
  99. NTSTATUS
  100. RxCommonRead ( RXCOMMON_SIGNATURE ); // implemented in Read.c
  101. NTSTATUS
  102. RxCommonQueryVolumeInformation ( RXCOMMON_SIGNATURE ); // implemented in VolInfo.c
  103. NTSTATUS
  104. RxCommonSetVolumeInformation ( RXCOMMON_SIGNATURE ); // implemented in VolInfo.c
  105. NTSTATUS
  106. RxCommonWrite ( RXCOMMON_SIGNATURE ); // implemented in Write.c
  107. // Here are the callbacks used by the I/O system for checking for fast I/O or
  108. // doing a fast query info call, or doing fast lock calls.
  109. //
  110. BOOLEAN
  111. RxFastIoRead (
  112. IN PFILE_OBJECT FileObject,
  113. IN PLARGE_INTEGER FileOffset,
  114. IN ULONG Length,
  115. IN BOOLEAN Wait,
  116. IN ULONG LockKey,
  117. OUT PVOID Buffer,
  118. OUT PIO_STATUS_BLOCK IoStatus,
  119. IN PDEVICE_OBJECT DeviceObject
  120. );
  121. BOOLEAN
  122. RxFastIoWrite (
  123. IN PFILE_OBJECT FileObject,
  124. IN PLARGE_INTEGER FileOffset,
  125. IN ULONG Length,
  126. IN BOOLEAN Wait,
  127. IN ULONG LockKey,
  128. IN PVOID Buffer,
  129. OUT PIO_STATUS_BLOCK IoStatus,
  130. IN PDEVICE_OBJECT DeviceObject
  131. );
  132. BOOLEAN
  133. RxFastIoCheckIfPossible (
  134. IN PFILE_OBJECT FileObject,
  135. IN PLARGE_INTEGER FileOffset,
  136. IN ULONG Length,
  137. IN BOOLEAN Wait,
  138. IN ULONG LockKey,
  139. IN BOOLEAN CheckForReadOperation,
  140. OUT PIO_STATUS_BLOCK IoStatus,
  141. IN PDEVICE_OBJECT DeviceObject
  142. );
  143. BOOLEAN
  144. RxFastQueryBasicInfo (
  145. IN PFILE_OBJECT FileObject,
  146. IN BOOLEAN Wait,
  147. IN OUT PFILE_BASIC_INFORMATION Buffer,
  148. OUT PIO_STATUS_BLOCK IoStatus,
  149. IN PDEVICE_OBJECT DeviceObject
  150. );
  151. BOOLEAN
  152. RxFastQueryStdInfo (
  153. IN PFILE_OBJECT FileObject,
  154. IN BOOLEAN Wait,
  155. IN OUT PFILE_STANDARD_INFORMATION Buffer,
  156. OUT PIO_STATUS_BLOCK IoStatus,
  157. IN PDEVICE_OBJECT DeviceObject
  158. );
  159. BOOLEAN
  160. RxFastLock (
  161. IN PFILE_OBJECT FileObject,
  162. IN PLARGE_INTEGER FileOffset,
  163. IN PLARGE_INTEGER Length,
  164. PEPROCESS ProcessId,
  165. ULONG Key,
  166. BOOLEAN FailImmediately,
  167. BOOLEAN ExclusiveLock,
  168. OUT PIO_STATUS_BLOCK IoStatus,
  169. IN PDEVICE_OBJECT DeviceObject
  170. );
  171. BOOLEAN
  172. RxFastUnlockSingle (
  173. IN PFILE_OBJECT FileObject,
  174. IN PLARGE_INTEGER FileOffset,
  175. IN PLARGE_INTEGER Length,
  176. PEPROCESS ProcessId,
  177. ULONG Key,
  178. OUT PIO_STATUS_BLOCK IoStatus,
  179. IN PDEVICE_OBJECT DeviceObject
  180. );
  181. BOOLEAN
  182. RxFastUnlockAll (
  183. IN PFILE_OBJECT FileObject,
  184. PEPROCESS ProcessId,
  185. OUT PIO_STATUS_BLOCK IoStatus,
  186. IN PDEVICE_OBJECT DeviceObject
  187. );
  188. BOOLEAN
  189. RxFastUnlockAllByKey (
  190. IN PFILE_OBJECT FileObject,
  191. PVOID ProcessId,
  192. ULONG Key,
  193. OUT PIO_STATUS_BLOCK IoStatus,
  194. IN PDEVICE_OBJECT DeviceObject
  195. );
  196. BOOLEAN
  197. RxFastIoDeviceControl (
  198. IN struct _FILE_OBJECT *FileObject,
  199. IN BOOLEAN Wait,
  200. IN PVOID InputBuffer OPTIONAL,
  201. IN ULONG InputBufferLength,
  202. OUT PVOID OutputBuffer OPTIONAL,
  203. IN ULONG OutputBufferLength,
  204. IN ULONG IoControlCode,
  205. OUT PIO_STATUS_BLOCK IoStatus,
  206. IN struct _DEVICE_OBJECT *DeviceObject
  207. );
  208. //
  209. // The following macro is used to set the is fast i/o possible field in
  210. // the common part of the nonpaged fcb
  211. //
  212. //
  213. // BOOLEAN
  214. // RxIsFastIoPossible (
  215. // IN PFCB Fcb
  216. // );
  217. //
  218. #if 0
  219. instead of this...we set the state to questionable.....this will cause us to be consulted on every call via out
  220. CheckIfFastIoIsPossibleCallOut. in this way, we don't have to be continually setting and resetting this
  221. #define RxIsFastIoPossible(FCB) \
  222. ((BOOLEAN) \
  223. ( \
  224. ((FCB)->FcbCondition != FcbGood || !FsRtlOplockIsFastIoPossible( &(FCB)->Specific.Fcb.Oplock )) \
  225. ? FastIoIsNotPossible \
  226. :( (!FsRtlAreThereCurrentFileLocks( &(FCB)->Specific.Fcb.FileLock ) \
  227. && ((FCB)->NonPaged->OutstandingAsyncWrites == 0) ) \
  228. ? FastIoIsPossible \
  229. : FastIoIsQuestionable \
  230. ) \
  231. ) \
  232. )
  233. #endif
  234. VOID
  235. RxAcquireFileForNtCreateSection (
  236. IN PFILE_OBJECT FileObject
  237. );
  238. VOID
  239. RxReleaseFileForNtCreateSection (
  240. IN PFILE_OBJECT FileObject
  241. );
  242. //
  243. #endif // _DISPATCH_STUFF_DEFINED_
  244.