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.

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