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.

812 lines
22 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. mrx.h
  5. Abstract:
  6. This module defines the interface between the MINI Redirectors and the RDBSS.
  7. The inteface is a dispatch table for the normal file system operations. In
  8. addition routines are provided for registrations/deregistration of mini
  9. redirectors.
  10. Author:
  11. Joe Linn (JoeLinn) 8-17-94
  12. Revision History:
  13. Notes:
  14. The interface definition between the mini redirectors and the wrapper
  15. consists of two parts, the data structures used and the dispatch vector.
  16. The data structures are defined in mrxfcb.h while the signatures of the
  17. various entries in the dispatch vector and the dispatch vector itself is
  18. defined in this file.
  19. --*/
  20. #ifndef _RXMINIRDR_
  21. #define _RXMINIRDR_
  22. //
  23. // RDBSS data structures shared with the mini redirectors
  24. //
  25. #include <mrxfcb.h>
  26. //
  27. // The following macros encapsulate commonly used operations in the mini redirector.
  28. // These include setting the status/information associated with the completion of
  29. // a request etc.
  30. //
  31. //
  32. // The following three macros are used for passing back operation status from the
  33. // minirdr to the NT wrapper. information passed back is either the open_action
  34. // for a create or the actual byte count or an operation. these should be passed
  35. // back directly in the rxcontext.
  36. //
  37. #define RxSetIoStatusStatus(RXCONTEXT, STATUS) \
  38. (RXCONTEXT)->CurrentIrp->IoStatus.Status = (STATUS)
  39. #define RxSetIoStatusInfo(RXCONTEXT, INFORMATION) \
  40. ((RXCONTEXT))->CurrentIrp->IoStatus.Information = (INFORMATION)
  41. #define RxGetIoStatusInfo(RXCONTEXT) \
  42. ((RXCONTEXT)->CurrentIrp->IoStatus.Information)
  43. #define RxShouldPostCompletion() ((KeGetCurrentIrql() >= DISPATCH_LEVEL))
  44. //
  45. // The mini rdr's register/unregister with the RDBSS whenever they are loaded/unloaded.
  46. // The registartion process is a two way hand shake in which the mini rdr informs the RDBSS
  47. // by invoking the registartion routine. The RDBSS completes the initialization by invoking
  48. // the Start routine in the dispatch vector.
  49. //
  50. #define RX_REGISTERMINI_FLAG_DONT_PROVIDE_UNCS 0x00000001
  51. #define RX_REGISTERMINI_FLAG_DONT_PROVIDE_MAILSLOTS 0x00000002
  52. #define RX_REGISTERMINI_FLAG_DONT_INIT_DRIVER_DISPATCH 0x00000004
  53. #define RX_REGISTERMINI_FLAG_DONT_INIT_PREFIX_N_SCAVENGER 0x00000008
  54. NTSTATUS
  55. NTAPI
  56. RxRegisterMinirdr (
  57. OUT PRDBSS_DEVICE_OBJECT *DeviceObject, // the deviceobject that was created
  58. IN OUT PDRIVER_OBJECT DriverObject, // the minirdr driver object
  59. IN PMINIRDR_DISPATCH MrdrDispatch, // the mini rdr dispatch vector
  60. IN ULONG Controls,
  61. IN PUNICODE_STRING DeviceName,
  62. IN ULONG DeviceExtensionSize,
  63. IN DEVICE_TYPE DeviceType,
  64. IN ULONG DeviceCharacteristics
  65. );
  66. VOID
  67. NTAPI
  68. RxMakeLateDeviceAvailable (
  69. IN PRDBSS_DEVICE_OBJECT RxDeviceObject
  70. );
  71. VOID
  72. NTAPI
  73. __RxFillAndInstallFastIoDispatch (
  74. IN PRDBSS_DEVICE_OBJECT RxDeviceObject,
  75. IN OUT PFAST_IO_DISPATCH FastIoDispatch,
  76. IN ULONG FastIoDispatchSize
  77. );
  78. #define RxFillAndInstallFastIoDispatch(__devobj,__fastiodisp) {\
  79. __RxFillAndInstallFastIoDispatch(&__devobj->RxDeviceObject,\
  80. &__fastiodisp, \
  81. sizeof(__fastiodisp)); \
  82. }
  83. VOID
  84. NTAPI
  85. RxpUnregisterMinirdr (
  86. IN PRDBSS_DEVICE_OBJECT RxDeviceObject
  87. );
  88. NTSTATUS
  89. RxStartMinirdr (
  90. IN PRX_CONTEXT RxContext,
  91. OUT PBOOLEAN PostToFsp
  92. );
  93. NTSTATUS
  94. RxStopMinirdr (
  95. IN PRX_CONTEXT RxContext,
  96. OUT PBOOLEAN PostToFsp
  97. );
  98. NTSTATUS
  99. RxSetDomainForMailslotBroadcast (
  100. IN PUNICODE_STRING DomainName
  101. );
  102. NTSTATUS
  103. RxFsdDispatch (
  104. IN PRDBSS_DEVICE_OBJECT RxDeviceObject,
  105. IN PIRP Irp
  106. );
  107. typedef
  108. NTSTATUS
  109. (NTAPI *PMRX_CALLDOWN) (
  110. IN OUT PRX_CONTEXT RxContext
  111. );
  112. typedef
  113. NTSTATUS
  114. (NTAPI *PMRX_CALLDOWN_CTX) (
  115. IN OUT PRX_CONTEXT RxContext,
  116. IN OUT PRDBSS_DEVICE_OBJECT RxDeviceObject
  117. );
  118. typedef
  119. NTSTATUS
  120. (NTAPI *PMRX_CHKDIR_CALLDOWN) (
  121. IN OUT PRX_CONTEXT RxContext,
  122. IN PUNICODE_STRING DirectoryName
  123. );
  124. typedef
  125. NTSTATUS
  126. (NTAPI *PMRX_CHKFCB_CALLDOWN) (
  127. IN PFCB Fcb1,
  128. IN PFCB Fcb2
  129. );
  130. //
  131. // The two important abstractions used in the interface between the mini rdr and RDBSS are
  132. // Server Calls and Net Roots. The former corresponds to the context associated with a
  133. // server with which a connection has been established and the later corresponds to a
  134. // share on a server ( This could also be viewed as a portion of the name space which has
  135. // been claimed by a mini rdr).
  136. //
  137. // The creation of Server calls and net roots typically involve atleast one network round trip.
  138. // In order to provide for asynchronous operations to continue these operations are modelled
  139. // as a two phase activity. Each calldown to a mini rdr for creating a server call and net root is
  140. // accompanied by a callup from the mini rdr to the RDBSS notifying with the completion status
  141. // of the request. Currently these are synchronous!
  142. //
  143. // The creation of Srv calls is further complicated by the fact that the RDBSS has to choose
  144. // from a number of mini rdr's to establish a connection with a server. In order to provide
  145. // the RDBSS with maximum flexibility in choosing the mini rdr's that it wishes to deploy the
  146. // creation of server calls involves a third phase in which the RDBSS notifies the mini rdr of
  147. // a winner. All the losing mini rdrs destroy the associated context.
  148. //
  149. typedef enum _RX_BLOCK_CONDITION {
  150. Condition_Uninitialized = 0,
  151. Condition_InTransition,
  152. Condition_Closing,
  153. Condition_Good,
  154. Condition_Bad,
  155. Condition_Closed
  156. } RX_BLOCK_CONDITION, *PRX_BLOCK_CONDITION;
  157. #define StableCondition(X) ((X) >= Condition_Good)
  158. //
  159. // The routine for notifying the RDBSS about the completion status of the NetRoot creation
  160. // request.
  161. //
  162. typedef
  163. VOID
  164. (NTAPI *PMRX_NETROOT_CALLBACK) (
  165. IN OUT PMRX_CREATENETROOT_CONTEXT CreateContext
  166. );
  167. //
  168. // this routine allows the minirdr to specify the netrootname. NetRootName and RestOfName are set
  169. // to point to the appropriate places within FilePathName. SrvCall is used to find the lengthof the srvcallname.
  170. //
  171. typedef
  172. VOID
  173. (NTAPI *PMRX_EXTRACT_NETROOT_NAME) (
  174. IN PUNICODE_STRING FilePathName,
  175. IN PMRX_SRV_CALL SrvCall,
  176. OUT PUNICODE_STRING NetRootName,
  177. OUT PUNICODE_STRING RestOfName OPTIONAL
  178. );
  179. //
  180. // The resumption context for the RDBSS.
  181. //
  182. typedef struct _MRX_CREATENETROOT_CONTEXT {
  183. PRX_CONTEXT RxContext;
  184. PV_NET_ROOT pVNetRoot;
  185. KEVENT FinishEvent;
  186. NTSTATUS VirtualNetRootStatus;
  187. NTSTATUS NetRootStatus;
  188. RX_WORK_QUEUE_ITEM WorkQueueItem;
  189. PMRX_NETROOT_CALLBACK Callback;
  190. } MRX_CREATENETROOT_CONTEXT, *PMRX_CREATENETROOT_CONTEXT;
  191. //
  192. // the calldown from RDBSS to the mini rdr for creating a netroot.
  193. //
  194. typedef
  195. NTSTATUS
  196. (NTAPI *PMRX_CREATE_V_NET_ROOT) (
  197. IN OUT PMRX_CREATENETROOT_CONTEXT Context
  198. );
  199. //
  200. // the calldown for querying a net root state.
  201. //
  202. typedef
  203. NTSTATUS
  204. (NTAPI *PMRX_UPDATE_NETROOT_STATE) (
  205. IN OUT PMRX_NET_ROOT NetRoot
  206. );
  207. //
  208. // The resumption context for the RDBSS.
  209. //
  210. typedef struct _MRX_SRVCALL_CALLBACK_CONTEXT {
  211. struct _MRX_SRVCALLDOWN_STRUCTURE *SrvCalldownStructure; // could be computed
  212. ULONG CallbackContextOrdinal;
  213. PRDBSS_DEVICE_OBJECT RxDeviceObject;
  214. NTSTATUS Status;
  215. PVOID RecommunicateContext;
  216. } MRX_SRVCALL_CALLBACK_CONTEXT, *PMRX_SRVCALL_CALLBACK_CONTEXT;
  217. //
  218. // The routine for notifying the RDBSS about the completion status of the SrvCall creation
  219. // request.
  220. //
  221. typedef
  222. VOID
  223. (NTAPI *PMRX_SRVCALL_CALLBACK) (
  224. IN OUT PMRX_SRVCALL_CALLBACK_CONTEXT Context
  225. );
  226. //
  227. // The context passed from the RDBSS to the mini rdr for creating a server call.
  228. //
  229. typedef struct _MRX_SRVCALLDOWN_STRUCTURE {
  230. KEVENT FinishEvent;
  231. LIST_ENTRY SrvCalldownList;
  232. PRX_CONTEXT RxContext;
  233. PMRX_SRV_CALL SrvCall;
  234. PMRX_SRVCALL_CALLBACK CallBack;
  235. BOOLEAN CalldownCancelled;
  236. ULONG NumberRemaining;
  237. ULONG NumberToWait;
  238. ULONG BestFinisherOrdinal;
  239. PRDBSS_DEVICE_OBJECT BestFinisher;
  240. MRX_SRVCALL_CALLBACK_CONTEXT CallbackContexts[1];
  241. } MRX_SRVCALLDOWN_STRUCTURE;
  242. //
  243. // the calldown from the RDBSS to the mini rdr for creating a server call
  244. //
  245. typedef
  246. NTSTATUS
  247. (NTAPI *PMRX_CREATE_SRVCALL) (
  248. IN OUT PMRX_SRV_CALL SrvCall,
  249. IN OUT PMRX_SRVCALL_CALLBACK_CONTEXT SrvCallCallBackContext
  250. );
  251. //
  252. // the calldown from the RDBSS to the mini rdr for notifying the mini rdr's of the winner.
  253. //
  254. typedef
  255. NTSTATUS
  256. (NTAPI *PMRX_SRVCALL_WINNER_NOTIFY)(
  257. IN OUT PMRX_SRV_CALL SrvCall,
  258. IN BOOLEAN ThisMinirdrIsTheWinner,
  259. IN OUT PVOID RecommunicateContext
  260. );
  261. //
  262. // The prototypes for calldown routines relating to various file system operations
  263. //
  264. typedef
  265. VOID
  266. (NTAPI *PMRX_NEWSTATE_CALLDOWN) (
  267. IN OUT PVOID Context
  268. );
  269. typedef
  270. NTSTATUS
  271. (NTAPI *PMRX_DEALLOCATE_FOR_FCB) (
  272. IN OUT PMRX_FCB Fcb
  273. );
  274. typedef
  275. NTSTATUS
  276. (NTAPI *PMRX_DEALLOCATE_FOR_FOBX) (
  277. IN OUT PMRX_FOBX Fobx
  278. );
  279. typedef
  280. NTSTATUS
  281. (NTAPI *PMRX_IS_LOCK_REALIZABLE) (
  282. IN OUT PMRX_FCB Fcb,
  283. IN PLARGE_INTEGER ByteOffset,
  284. IN PLARGE_INTEGER Length,
  285. IN ULONG LowIoLockFlags
  286. );
  287. typedef
  288. NTSTATUS
  289. (NTAPI *PMRX_FORCECLOSED_CALLDOWN) (
  290. IN OUT PMRX_SRV_OPEN SrvOpen
  291. );
  292. typedef
  293. NTSTATUS
  294. (NTAPI *PMRX_FINALIZE_SRVCALL_CALLDOWN) (
  295. IN OUT PMRX_SRV_CALL SrvCall,
  296. IN BOOLEAN Force
  297. );
  298. typedef
  299. NTSTATUS
  300. (NTAPI *PMRX_FINALIZE_V_NET_ROOT_CALLDOWN) (
  301. IN OUT PMRX_V_NET_ROOT VirtualNetRoot,
  302. IN PBOOLEAN Force
  303. );
  304. typedef
  305. NTSTATUS
  306. (NTAPI *PMRX_FINALIZE_NET_ROOT_CALLDOWN) (
  307. IN OUT PMRX_NET_ROOT NetRoot,
  308. IN PBOOLEAN Force
  309. );
  310. typedef
  311. ULONG
  312. (NTAPI *PMRX_EXTENDFILE_CALLDOWN) (
  313. IN OUT PRX_CONTEXT RxContext,
  314. IN OUT PLARGE_INTEGER NewFileSize,
  315. OUT PLARGE_INTEGER NewAllocationSize
  316. );
  317. typedef
  318. BOOLEAN
  319. (*PRX_LOCK_ENUMERATOR) (
  320. IN OUT PMRX_SRV_OPEN SrvOpen,
  321. IN OUT PVOID *ContinuationHandle,
  322. OUT PLARGE_INTEGER FileOffset,
  323. OUT PLARGE_INTEGER LockRange,
  324. OUT PBOOLEAN IsLockExclusive
  325. );
  326. typedef
  327. NTSTATUS
  328. (NTAPI *PMRX_CHANGE_BUFFERING_STATE_CALLDOWN) (
  329. IN OUT PRX_CONTEXT RxContext,
  330. IN OUT PMRX_SRV_OPEN SrvOpen,
  331. IN PVOID MRxContext
  332. );
  333. typedef
  334. NTSTATUS
  335. (NTAPI *PMRX_PREPARSE_NAME) (
  336. IN OUT PRX_CONTEXT RxContext,
  337. IN PUNICODE_STRING Name
  338. );
  339. typedef
  340. NTSTATUS
  341. (NTAPI *PMRX_GET_CONNECTION_ID) (
  342. IN OUT PRX_CONTEXT RxContext,
  343. IN OUT PRX_CONNECTION_ID UniqueId
  344. );
  345. //
  346. // Buffering state/Policy management TBD
  347. //
  348. typedef enum _MINIRDR_BUFSTATE_COMMANDS {
  349. MRDRBUFSTCMD__COMMAND_FORCEPURGE0,
  350. MRDRBUFSTCMD__1,
  351. MRDRBUFSTCMD__2,
  352. MRDRBUFSTCMD__3,
  353. MRDRBUFSTCMD__4,
  354. MRDRBUFSTCMD__5,
  355. MRDRBUFSTCMD__6,
  356. MRDRBUFSTCMD__7,
  357. MRDRBUFSTCMD__8,
  358. MRDRBUFSTCMD__9,
  359. MRDRBUFSTCMD__10,
  360. MRDRBUFSTCMD__11,
  361. MRDRBUFSTCMD__12,
  362. MRDRBUFSTCMD__13,
  363. MRDRBUFSTCMD__14,
  364. MRDRBUFSTCMD__15,
  365. MRDRBUFSTCMD__16,
  366. MRDRBUFSTCMD__17,
  367. MRDRBUFSTCMD__18,
  368. MRDRBUFSTCMD__19,
  369. MRDRBUFSTCMD__20,
  370. MRDRBUFSTCMD__21,
  371. MRDRBUFSTCMD__22,
  372. MRDRBUFSTCMD__23,
  373. MRDRBUFSTCMD__24,
  374. MRDRBUFSTCMD__25,
  375. MRDRBUFSTCMD__26,
  376. MRDRBUFSTCMD__27,
  377. MRDRBUFSTCMD__28,
  378. MRDRBUFSTCMD__29,
  379. MRDRBUFSTCMD__30,
  380. MRDRBUFSTCMD__31,
  381. MRDRBUFSTCMD_MAXXX
  382. } MINIRDR_BUFSTATE_COMMANDS;
  383. #define MINIRDR_BUFSTATE_COMMAND_FORCEPURGE 0x00000001
  384. #define MINIRDR_BUFSTATE_COMMAND_MASK ((MINIRDR_BUFSTATE_COMMAND_FORCEPURGE))
  385. typedef
  386. NTSTATUS
  387. (NTAPI *PMRX_COMPUTE_NEW_BUFFERING_STATE) (
  388. IN OUT PMRX_SRV_OPEN SrvOpen,
  389. IN PVOID MRxContext,
  390. OUT PULONG NewBufferingState
  391. );
  392. typedef enum _LOWIO_OPS {
  393. LOWIO_OP_READ=0,
  394. LOWIO_OP_WRITE,
  395. LOWIO_OP_SHAREDLOCK,
  396. LOWIO_OP_EXCLUSIVELOCK,
  397. LOWIO_OP_UNLOCK,
  398. LOWIO_OP_UNLOCK_MULTIPLE,
  399. //LOWIO_OP_UNLOCKALLBYKEY,
  400. LOWIO_OP_FSCTL,
  401. LOWIO_OP_IOCTL,
  402. LOWIO_OP_NOTIFY_CHANGE_DIRECTORY,
  403. LOWIO_OP_CLEAROUT,
  404. LOWIO_OP_MAXIMUM
  405. } LOWIO_OPS;
  406. typedef
  407. NTSTATUS
  408. (NTAPI *PLOWIO_COMPLETION_ROUTINE) (
  409. IN PRX_CONTEXT RxContext
  410. );
  411. typedef LONGLONG RXVBO;
  412. //
  413. // we may, at some point, want a smarter implementation of this. we don't statically allocate the first
  414. // element because that would make unlock behind much harder.
  415. //
  416. typedef struct _LOWIO_LOCK_LIST {
  417. struct _LOWIO_LOCK_LIST * Next;
  418. ULONG LockNumber;
  419. RXVBO ByteOffset;
  420. LONGLONG Length;
  421. BOOLEAN ExclusiveLock;
  422. } LOWIO_LOCK_LIST, *PLOWIO_LOCK_LIST;
  423. VOID
  424. NTAPI
  425. RxFinalizeLockList(
  426. struct _RX_CONTEXT *RxContext
  427. );
  428. typedef struct _XXCTL_LOWIO_COMPONENT {
  429. ULONG Flags;
  430. union {
  431. ULONG FsControlCode;
  432. ULONG IoControlCode;
  433. };
  434. ULONG InputBufferLength;
  435. PVOID pInputBuffer;
  436. ULONG OutputBufferLength;
  437. PVOID pOutputBuffer;
  438. UCHAR MinorFunction;
  439. } XXCTL_LOWIO_COMPONENT;
  440. typedef struct _LOWIO_CONTEXT {
  441. USHORT Operation; // padding!
  442. USHORT Flags;
  443. PLOWIO_COMPLETION_ROUTINE CompletionRoutine;
  444. PERESOURCE Resource;
  445. ERESOURCE_THREAD ResourceThreadId;
  446. union {
  447. struct {
  448. ULONG Flags;
  449. PMDL Buffer;
  450. RXVBO ByteOffset;
  451. ULONG ByteCount;
  452. ULONG Key;
  453. PNON_PAGED_FCB NonPagedFcb;
  454. } ReadWrite;
  455. struct {
  456. union {
  457. PLOWIO_LOCK_LIST LockList;
  458. LONGLONG Length;
  459. };
  460. //
  461. // these fields are not used if locklist is used
  462. //
  463. ULONG Flags;
  464. RXVBO ByteOffset;
  465. ULONG Key;
  466. } Locks;
  467. XXCTL_LOWIO_COMPONENT FsCtl;
  468. XXCTL_LOWIO_COMPONENT IoCtl; // these must be the same
  469. struct {
  470. BOOLEAN WatchTree;
  471. ULONG CompletionFilter;
  472. ULONG NotificationBufferLength;
  473. PVOID pNotificationBuffer;
  474. } NotifyChangeDirectory;
  475. } ParamsFor;
  476. } LOWIO_CONTEXT;
  477. #define LOWIO_CONTEXT_FLAG_SYNCCALL 0x0001 // this is set if lowiocompletion is called from lowiosubmit
  478. #define LOWIO_CONTEXT_FLAG_SAVEUNLOCKS 0x0002 // WRAPPER INTERNAL: on NT, it means the unlock routine add unlocks to the list
  479. #define LOWIO_CONTEXT_FLAG_LOUDOPS 0x0004 // WRAPPER INTERNAL: on NT, it means read and write routines generate dbg output
  480. #define LOWIO_CONTEXT_FLAG_CAN_COMPLETE_AT_DPC_LEVEL 0x0008 // WRAPPER INTERNAL: on NT, it means the completion routine maybe can
  481. // complete when called at DPC. otherwise it cannnot. currently
  482. // none can.
  483. #define LOWIO_READWRITEFLAG_PAGING_IO 0x01
  484. #define LOWIO_READWRITEFLAG_EXTENDING_FILESIZE 0x02
  485. #define LOWIO_READWRITEFLAG_EXTENDING_VDL 0x04
  486. //
  487. // these must match the SL_ values in io.h (ntifs.h) since the flags field is just copied
  488. //
  489. #define LOWIO_LOCKSFLAG_FAIL_IMMEDIATELY 0x01
  490. #define LOWIO_LOCKSFLAG_EXCLUSIVELOCK 0x02
  491. #if (LOWIO_LOCKSFLAG_FAIL_IMMEDIATELY!=SL_FAIL_IMMEDIATELY)
  492. #error LOWIO_LOCKSFLAG_FAIL_IMMEDIATELY!=SL_FAIL_IMMEDIATELY
  493. #endif
  494. #if (LOWIO_LOCKSFLAG_EXCLUSIVELOCK!=SL_EXCLUSIVE_LOCK)
  495. #error LOWIO_LOCKSFLAG_EXCLUSIVELOCK!=SL_EXCLUSIVE_LOCK
  496. #endif
  497. //
  498. // The six important data structures (SRV_CALL,NET_ROOT,V_NET_ROOT,FCB,SRV_OPEN and
  499. // FOBX) that are an integral part of the mini rdr architecture have a corresponding
  500. // counterpart in every mini rdr implementation. In order to provide maximal flexibility
  501. // and at the same time enhance performance the sizes and the desired allocation
  502. // behaviour are communicated at the registration time of a mini rdr.
  503. //
  504. // There is no single way in which these extensions can be managed which will
  505. // address the concerns of flexibility as well as performance. The solution adopted
  506. // in the current architecture that meets the dual goals in most cases. The solution
  507. // and the rationale is as follows ...
  508. //
  509. // Each mini rdr implementor specifies the size of the data structure extensions
  510. // alongwith a flag specfying if the allocation/free of the extensions are to be
  511. // managed by the wrapper.
  512. //
  513. // In all those cases where a one to one relationship exists between the wrapper
  514. // data structure and the corresponding mini rdr counterpart specifying the flag
  515. // results in maximal performance gains. There are a certain data structures for
  516. // which many instances of a wrapper data structure map onto the same extension in
  517. // the mini redirector. In such cases the mini rdr implementor will be better off
  518. // managing the allocation/deallocation of the data structure extension without the
  519. // intervention of the wrapper.
  520. //
  521. // Irrespective of the mechanism choosen the convention is to always associate the
  522. // extension with the Context field in the corresponding RDBSS data structure.
  523. // !!!NO EXCEPTIONS!!!
  524. //
  525. // The remaining field in all the RDBSS data structures, i.e., Context2 is left to
  526. // the discretion og the mini rdr implementor.
  527. //
  528. //
  529. // The SRV_CALL extension is not handled currently. This is because of further fixes
  530. // required in RDBSS w.r.t the mecahsnism used to select the mini rdr and to allow several
  531. // minis to share the srvcall.
  532. //
  533. // Please do not use it till further notice; rather, the mini should manage its own srcall
  534. // storage. There is a finalization calldown that assists in this endeavor.
  535. //
  536. #define RDBSS_MANAGE_SRV_CALL_EXTENSION (0x1)
  537. #define RDBSS_MANAGE_NET_ROOT_EXTENSION (0x2)
  538. #define RDBSS_MANAGE_V_NET_ROOT_EXTENSION (0x4)
  539. #define RDBSS_MANAGE_FCB_EXTENSION (0x8)
  540. #define RDBSS_MANAGE_SRV_OPEN_EXTENSION (0x10)
  541. #define RDBSS_MANAGE_FOBX_EXTENSION (0x20)
  542. #define RDBSS_NO_DEFERRED_CACHE_READAHEAD (0x1000)
  543. typedef struct _MINIRDR_DISPATCH {
  544. //
  545. // Normal Header
  546. //
  547. NODE_TYPE_CODE NodeTypeCode;
  548. NODE_BYTE_SIZE NodeByteSize;
  549. //
  550. // Flags to control the allocation of extensions.
  551. // and various other per-minirdr policies
  552. //
  553. ULONG MRxFlags;
  554. //
  555. // size of the SRV_CALL extensions
  556. //
  557. ULONG MRxSrvCallSize;
  558. //
  559. // size of the NET_ROOT extensions
  560. //
  561. ULONG MRxNetRootSize;
  562. //
  563. // size of the V_NET_ROOT extensions
  564. //
  565. ULONG MRxVNetRootSize;
  566. //
  567. // size of FCB extensions
  568. //
  569. ULONG MRxFcbSize;
  570. //
  571. // size of SRV_OPEN extensions
  572. //
  573. ULONG MRxSrvOpenSize;
  574. //
  575. // size of FOBX extensions
  576. //
  577. ULONG MRxFobxSize;
  578. //
  579. // Call downs for starting/stopping the mini rdr
  580. //
  581. PMRX_CALLDOWN_CTX MRxStart;
  582. PMRX_CALLDOWN_CTX MRxStop;
  583. //
  584. // Call down for cancelling outstanding requests
  585. //
  586. PMRX_CALLDOWN MRxCancel;
  587. //
  588. // Call downs related to creating/opening/closing file system objects
  589. //
  590. PMRX_CALLDOWN MRxCreate;
  591. PMRX_CALLDOWN MRxCollapseOpen;
  592. PMRX_CALLDOWN MRxShouldTryToCollapseThisOpen;
  593. PMRX_CALLDOWN MRxFlush;
  594. PMRX_CALLDOWN MRxZeroExtend;
  595. PMRX_CALLDOWN MRxTruncate;
  596. PMRX_CALLDOWN MRxCleanupFobx;
  597. PMRX_CALLDOWN MRxCloseSrvOpen;
  598. PMRX_DEALLOCATE_FOR_FCB MRxDeallocateForFcb;
  599. PMRX_DEALLOCATE_FOR_FOBX MRxDeallocateForFobx;
  600. PMRX_IS_LOCK_REALIZABLE MRxIsLockRealizable;
  601. PMRX_FORCECLOSED_CALLDOWN MRxForceClosed;
  602. PMRX_CHKFCB_CALLDOWN MRxAreFilesAliased;
  603. //
  604. // call downs related to nonNT style printing.....note that the connect goes thru
  605. // the normal srvcall/netroot interface
  606. //
  607. PMRX_CALLDOWN MRxOpenPrintFile;
  608. PMRX_CALLDOWN MRxClosePrintFile;
  609. PMRX_CALLDOWN MRxWritePrintFile;
  610. PMRX_CALLDOWN MRxEnumeratePrintQueue;
  611. //
  612. // call downs related to unsatisfied requests, i.e., time outs
  613. //
  614. PMRX_CALLDOWN MRxClosedSrvOpenTimeOut;
  615. PMRX_CALLDOWN MRxClosedFcbTimeOut;
  616. //
  617. // call downs related to query/set information on file system objects
  618. //
  619. PMRX_CALLDOWN MRxQueryDirectory;
  620. PMRX_CALLDOWN MRxQueryFileInfo;
  621. PMRX_CALLDOWN MRxSetFileInfo;
  622. PMRX_CALLDOWN MRxSetFileInfoAtCleanup;
  623. PMRX_CALLDOWN MRxQueryEaInfo;
  624. PMRX_CALLDOWN MRxSetEaInfo;
  625. PMRX_CALLDOWN MRxQuerySdInfo;
  626. PMRX_CALLDOWN MRxSetSdInfo;
  627. PMRX_CALLDOWN MRxQueryQuotaInfo;
  628. PMRX_CALLDOWN MRxSetQuotaInfo;
  629. PMRX_CALLDOWN MRxQueryVolumeInfo;
  630. PMRX_CALLDOWN MRxSetVolumeInfo;
  631. PMRX_CHKDIR_CALLDOWN MRxIsValidDirectory;
  632. //
  633. // call downs related to buffer management
  634. //
  635. PMRX_COMPUTE_NEW_BUFFERING_STATE MRxComputeNewBufferingState;
  636. //
  637. // call downs related to Low I/O management (reads/writes on file system objects)
  638. //
  639. PMRX_CALLDOWN MRxLowIOSubmit[LOWIO_OP_MAXIMUM+1];
  640. PMRX_EXTENDFILE_CALLDOWN MRxExtendForCache;
  641. PMRX_EXTENDFILE_CALLDOWN MRxExtendForNonCache;
  642. PMRX_CHANGE_BUFFERING_STATE_CALLDOWN MRxCompleteBufferingStateChangeRequest;
  643. //
  644. // call downs related to name space management
  645. //
  646. PMRX_CREATE_V_NET_ROOT MRxCreateVNetRoot;
  647. PMRX_FINALIZE_V_NET_ROOT_CALLDOWN MRxFinalizeVNetRoot;
  648. PMRX_FINALIZE_NET_ROOT_CALLDOWN MRxFinalizeNetRoot;
  649. PMRX_UPDATE_NETROOT_STATE MRxUpdateNetRootState;
  650. PMRX_EXTRACT_NETROOT_NAME MRxExtractNetRootName;
  651. //
  652. // call downs related to establishing connections with servers
  653. //
  654. PMRX_CREATE_SRVCALL MRxCreateSrvCall;
  655. PMRX_CREATE_SRVCALL MRxCancelCreateSrvCall;
  656. PMRX_SRVCALL_WINNER_NOTIFY MRxSrvCallWinnerNotify;
  657. PMRX_FINALIZE_SRVCALL_CALLDOWN MRxFinalizeSrvCall;
  658. PMRX_CALLDOWN MRxDevFcbXXXControlFile;
  659. //
  660. // New calldowns
  661. //
  662. //
  663. // Allow a client to preparse the name
  664. //
  665. PMRX_PREPARSE_NAME MRxPreparseName;
  666. //
  667. // call down for controlling multi-plexing
  668. //
  669. PMRX_GET_CONNECTION_ID MRxGetConnectionId;
  670. } MINIRDR_DISPATCH, *PMINIRDR_DISPATCH;
  671. #endif // _RXMINIRDR_