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.

813 lines
24 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. mrxfFcb.h
  5. Abstract:
  6. This module defines the macros/inline functions and function prototypes used by
  7. the mini redirectors to access the RDBSS wrapper data structures.
  8. IMPORTANT: All mini redirector writers cannot and should not make any assumptions
  9. about the layout of the RDBSS wrapper data structures. They are not guaranteed to
  10. be the same across platforms and even on a single platform are liable to change
  11. across versions.
  12. The following six data structure abstractions are available to the mini
  13. redirector writer.
  14. 1) Server Call Context (SRV_CALL)
  15. The context associated with each known file system server.
  16. 2) Net Roots (NET_ROOT)
  17. The root of a file system volume( local/remote) opened by the user.
  18. 3) Virtual Net Roots (V_NET_ROOT)
  19. The view of a file system volume on a server. The view can be
  20. constrained along multiple dimensions. As an example the view can be
  21. associated with a logon id. which will constrain the operations that
  22. can be performed on the file system volume.
  23. 4) File Control Blocks (FCB)
  24. The RDBSS data structure associated with each unique file opened.
  25. 5) File Object Extensions (FOXB)
  26. 6) ServerSide Open Context (SRV_OPEN)
  27. A common convention that is adopted for defining Flags in all of these data structures
  28. is to define a ULONG ( 32 ) flags and split them into two groups -- those that are visible
  29. to the mini redirector and those that are invisible. These flags are not meant for use
  30. by the mini redirector writers and are reserved for the wrapper.
  31. Author:
  32. Balan Sethu Raman [SethuR] 23-Oct-1995
  33. Revision History:
  34. --*/
  35. #ifndef __MRXFCB_H__
  36. #define __MRXFCB_H__
  37. //
  38. // The SRVCALL flags are split into two groups, i.e., visible to mini rdrs and invisible to mini rdrs.
  39. // The visible ones are defined above and the definitions for the invisible ones can be found
  40. // in fcb.h. The convention that has been adopted is that the lower 16 flags will be visible
  41. // to the mini rdr and the upper 16 flags will be reserved for the wrapper. This needs to be
  42. // enforced in defining new flags.
  43. //
  44. #define SRVCALL_FLAG_MAILSLOT_SERVER (0x1)
  45. #define SRVCALL_FLAG_FILE_SERVER (0x2)
  46. #define SRVCALL_FLAG_CASE_INSENSITIVE_NETROOTS (0x4)
  47. #define SRVCALL_FLAG_CASE_INSENSITIVE_FILENAMES (0x8)
  48. #define SRVCALL_FLAG_DFS_AWARE_SERVER (0x10)
  49. #define SRVCALL_FLAG_FORCE_FINALIZED (0x20)
  50. #define SRVCALL_FLAG_LWIO_AWARE_SERVER (0x40)
  51. #define SRVCALL_FLAG_LOOPBACK_SERVER (0x80)
  52. typedef struct _MRX_NORMAL_NODE_HEADER {
  53. NODE_TYPE_CODE NodeTypeCode;
  54. NODE_BYTE_SIZE NodeByteSize;
  55. ULONG NodeReferenceCount;
  56. } MRX_NORMAL_NODE_HEADER;
  57. #ifdef __cplusplus
  58. typedef struct _MRX_SRV_CALL_ : public MRX_NORMAL_NODE_HEADER {
  59. #else // !__cplusplus
  60. typedef struct _MRX_SRV_CALL_ {
  61. MRX_NORMAL_NODE_HEADER;
  62. #endif // __cplusplus
  63. //
  64. // !!!! changes above this require realignment with fcb.h
  65. //
  66. //
  67. // the context fields for extensions required by the mini redirectors
  68. //
  69. PVOID Context;
  70. PVOID Context2;
  71. //
  72. // Associated DeviceObject which also contains the dispatch vector
  73. //
  74. PRDBSS_DEVICE_OBJECT RxDeviceObject;
  75. //
  76. // the srv call name, the server principal name and the server domain name.
  77. //
  78. PUNICODE_STRING pSrvCallName;
  79. PUNICODE_STRING pPrincipalName;
  80. PUNICODE_STRING pDomainName;
  81. //
  82. // Flags used to denote the state of the SRV_CALL.
  83. //
  84. ULONG Flags;
  85. //
  86. // Server parameters updated by the mini redirectors.
  87. //
  88. LONG MaximumNumberOfCloseDelayedFiles;
  89. //
  90. // Status return from the transport in case of failure
  91. //
  92. NTSTATUS Status;
  93. } MRX_SRV_CALL, *PMRX_SRV_CALL;
  94. //
  95. // The various types of NET_ROOT's currently supported by the wrapper.
  96. //
  97. #define NET_ROOT_DISK ((UCHAR)0)
  98. #define NET_ROOT_PIPE ((UCHAR)1)
  99. #define NET_ROOT_COMM ((UCHAR)2)
  100. #define NET_ROOT_PRINT ((UCHAR)3)
  101. #define NET_ROOT_WILD ((UCHAR)4)
  102. #define NET_ROOT_MAILSLOT ((UCHAR)5)
  103. typedef UCHAR NET_ROOT_TYPE, *PNET_ROOT_TYPE;
  104. //
  105. // The pipe buffer size for transferring cannot be larger than 0xffff
  106. //
  107. #define MAX_PIPE_BUFFER_SIZE 0xFFFF
  108. //
  109. // The possible states associated with a NET_ROOT. These have been defined to be
  110. // line with the definitions foe the LanManager service to avoid redundant mappings.
  111. // These MUST agree with sdkinc\lmuse.h use_ok, etc.....
  112. //
  113. #define MRX_NET_ROOT_STATE_GOOD ((UCHAR)0)
  114. #define MRX_NET_ROOT_STATE_PAUSED ((UCHAR)1)
  115. #define MRX_NET_ROOT_STATE_DISCONNECTED ((UCHAR)2)
  116. #define MRX_NET_ROOT_STATE_ERROR ((UCHAR)3)
  117. #define MRX_NET_ROOT_STATE_CONNECTED ((UCHAR)4)
  118. #define MRX_NET_ROOT_STATE_RECONN ((UCHAR)5)
  119. typedef UCHAR MRX_NET_ROOT_STATE, *PMRX_NET_ROOT_STATE;
  120. //
  121. // The file systems on the remote servers provide varying levels of functionality to
  122. // detect aliasing between file names. As an example consider two shares on the same
  123. // file system volume. In the absence of any support from the file system on the server
  124. // the correct and conservative approach is to flush all the files to the server as
  125. // opposed to all the files on the same NET_ROOT to preserve coherency and handle
  126. // delayed close operations.
  127. //
  128. #define MRX_PURGE_SAME_NETROOT ((UCHAR)0)
  129. #define MRX_PURGE_SAME_SRVCALL ((UCHAR)1)
  130. //
  131. // these are not implemented yet....
  132. // #define MRX_PURGE_SAME_FCB ((UCHAR)2)
  133. // #define MRX_PURGE_SAME_VOLUME ((UCHAR)3)
  134. // #define MRX_PURGE_ALL ((UCHAR)4)
  135. //
  136. typedef UCHAR MRX_PURGE_RELATIONSHIP, *PMRX_PURGE_RELATIONSHIP;
  137. #define MRX_PURGE_SYNC_AT_NETROOT ((UCHAR)0)
  138. #define MRX_PURGE_SYNC_AT_SRVCALL ((UCHAR)1)
  139. typedef UCHAR MRX_PURGE_SYNCLOCATION, *PMRX_PURGE_SYNCLOCATION;
  140. //
  141. // The NET_ROOT flags are split into two groups, i.e., visible to mini rdrs and
  142. // invisible to mini rdrs. The visible ones are defined above and the definitions
  143. // for the invisible ones can be found in fcb.h. The convention that has been
  144. // adopted is that the lower 16 flags will be visible to the mini rdr and the
  145. // upper 16 flags will be reserved for the wrapper. This needs to be enforced
  146. // in defining new flags.
  147. //
  148. #define NETROOT_FLAG_SUPPORTS_SYMBOLIC_LINKS ( 0x0001 )
  149. #define NETROOT_FLAG_DFS_AWARE_NETROOT ( 0x0002 )
  150. #define NETROOT_FLAG_DEFER_READAHEAD ( 0x0004 )
  151. #define NETROOT_FLAG_VOLUMEID_INITIALIZED ( 0x0008 )
  152. #define NETROOT_FLAG_FINALIZE_INVOKED ( 0x0010 )
  153. #define NETROOT_FLAG_UNIQUE_FILE_NAME ( 0x0020 )
  154. //
  155. // Read ahead amount used for normal data files (32k)
  156. //
  157. #define DEFAULT_READ_AHEAD_GRANULARITY (0x08000)
  158. //
  159. // the wrapper implements throttling for certain kinds of operations:
  160. // PeekNamedPipe/ReadNamedPipe
  161. // LockFile
  162. //
  163. // a minirdr can set the timing parameters for this in the netroot. leaving them
  164. // as zero will disable throttling.
  165. //
  166. typedef struct _NETROOT_THROTTLING_PARAMETERS {
  167. //
  168. // Supplies the increase in delay in milliseconds, each time a request
  169. // to the network fails.
  170. //
  171. ULONG Increment;
  172. //
  173. // Supplies the longest delay the backoff package can introduce
  174. // in milliseconds.
  175. ULONG MaximumDelay;
  176. } NETROOT_THROTTLING_PARAMETERS, *PNETROOT_THROTTLING_PARAMETERS;
  177. #define RxInitializeNetRootThrottlingParameters(__tp,__incr,__maxdelay) { \
  178. PNETROOT_THROTTLING_PARAMETERS tp = (__tp); \
  179. tp->Increment = (__incr); \
  180. tp->MaximumDelay = (__maxdelay); \
  181. }
  182. #ifdef __cplusplus
  183. typedef struct _MRX_NET_ROOT_ : public MRX_NORMAL_NODE_HEADER {
  184. #else // !__cplusplus
  185. typedef struct _MRX_NET_ROOT_ {
  186. MRX_NORMAL_NODE_HEADER;
  187. #endif // __cplusplus
  188. //
  189. // the MRX_SRV_CALL instance with which this MRX_NET_ROOT instance is associated
  190. //
  191. PMRX_SRV_CALL pSrvCall;
  192. //
  193. // !!!! changes above this require realignment with fcb.h
  194. //
  195. //
  196. // the context fields used by the mini redirectors for recording
  197. // additional state.
  198. //
  199. PVOID Context;
  200. PVOID Context2;
  201. //
  202. // The flags used to denote the state of the NET_ROOT instance.
  203. //
  204. ULONG Flags;
  205. //
  206. // We count the number of fcbs, srvopens on the netroot
  207. //
  208. ULONG NumberOfFcbs;
  209. ULONG NumberOfSrvOpens;
  210. //
  211. // The current state and the purge relationships based on the support
  212. // provided by the file system on the server.
  213. //
  214. MRX_NET_ROOT_STATE MRxNetRootState;
  215. NET_ROOT_TYPE Type;
  216. MRX_PURGE_RELATIONSHIP PurgeRelationship;
  217. MRX_PURGE_SYNCLOCATION PurgeSyncLocation;
  218. //
  219. // the type of device, i.e., file system volume, printer, com port etc.
  220. //
  221. DEVICE_TYPE DeviceType;
  222. //
  223. // Name of the NET_ROOT instance
  224. //
  225. PUNICODE_STRING pNetRootName;
  226. //
  227. // the name to be prepended to all FCBS associated with this NET_ROOT
  228. //
  229. UNICODE_STRING InnerNamePrefix;
  230. //
  231. // Parameters based upon the type of the NET_ROOT.
  232. //
  233. ULONG ParameterValidationStamp;
  234. union {
  235. struct {
  236. ULONG DataCollectionSize;
  237. NETROOT_THROTTLING_PARAMETERS PipeReadThrottlingParameters;
  238. } NamedPipeParameters;
  239. struct {
  240. ULONG ClusterSize;
  241. ULONG ReadAheadGranularity;
  242. NETROOT_THROTTLING_PARAMETERS LockThrottlingParameters;
  243. ULONG RenameInfoOverallocationSize; //could be a USHORT
  244. GUID VolumeId;
  245. } DiskParameters;
  246. };
  247. } MRX_NET_ROOT, *PMRX_NET_ROOT;
  248. //
  249. // The VNET_ROOT flags are split into two groups, i.e., visible to mini rdrs and
  250. // invisible to mini rdrs. The visible ones are defined below and the definitions
  251. // for the invisible ones can be found in fcb.h. The convention that has been
  252. // adopted is that the lower 16 flags will be visible to the mini rdr and the
  253. // upper 16 flags will be reserved for the wrapper. This needs to be enforced
  254. // in defining new flags.
  255. //
  256. #define VNETROOT_FLAG_CSCAGENT_INSTANCE 0x00000001
  257. #define VNETROOT_FLAG_FINALIZE_INVOKED 0x00000002
  258. #define VNETROOT_FLAG_FORCED_FINALIZE 0x00000004
  259. #define VNETROOT_FLAG_NOT_FINALIZED 0x00000008
  260. #ifdef __cplusplus
  261. typedef struct _MRX_V_NET_ROOT_ : public MRX_NORMAL_NODE_HEADER {
  262. #else // !__cplusplus
  263. typedef struct _MRX_V_NET_ROOT_ {
  264. MRX_NORMAL_NODE_HEADER;
  265. #endif // __cplusplus
  266. //
  267. // the MRX_NET_ROOT instance with which the MRX_V_NET_ROOT instance is associated
  268. //
  269. PMRX_NET_ROOT pNetRoot;
  270. //
  271. // !!!! changes above this require realignment with fcb.h
  272. //
  273. //
  274. // the context fields provided for storing additional information as deemed
  275. // necessary by the mini redirectors
  276. //
  277. PVOID Context;
  278. PVOID Context2;
  279. ULONG Flags;
  280. //
  281. // This field should not be updated by the mini redirectors. Its usage is intended
  282. // to provide an easy mechanism for accessing certain state information
  283. //
  284. ULONG NumberOfOpens;
  285. //
  286. // We count the number of Fobxss on the virtual netroot
  287. //
  288. ULONG NumberOfFobxs;
  289. //
  290. // the security parameters associated with the V_NET_ROOT instance.
  291. //
  292. LUID LogonId;
  293. //
  294. // These are the parameters supplied by the used in a NtCreateFile call in
  295. // which the FILE_CREATE_TREE_CONNECTION flag is specified as part of the
  296. // CreateOptions.
  297. //
  298. PUNICODE_STRING pUserDomainName;
  299. PUNICODE_STRING pUserName;
  300. PUNICODE_STRING pPassword;
  301. ULONG SessionId;
  302. NTSTATUS ConstructionStatus;
  303. BOOLEAN IsExplicitConnection;
  304. } MRX_V_NET_ROOT, *PMRX_V_NET_ROOT;
  305. //
  306. // ALL FIELDS IN AN FCB ARE READONLY EXCEPT Context and Context2....
  307. // Also, Context is read only the the mini has specified RDBSS_MANAGE_FCB_EXTENSION
  308. //
  309. typedef struct _MRX_FCB_ {
  310. FSRTL_ADVANCED_FCB_HEADER Header;
  311. //
  312. // The MRX_NET_ROOT instance with which this is associated
  313. //
  314. PMRX_NET_ROOT pNetRoot;
  315. //
  316. // !!!! changes above this require realignment with fcb.h
  317. //
  318. //
  319. // the context fields to store additional information as deemed necessary by the
  320. // mini redirectors.
  321. //
  322. PVOID Context;
  323. PVOID Context2;
  324. //
  325. // The reference count: in a different place because we must prefix with
  326. // the FSRTL_COMMON_FCB_HEADER structure.
  327. //
  328. ULONG NodeReferenceCount;
  329. //
  330. // The internal state of the Fcb. THIS FIELD IS READONLY FOR MINIRDRS
  331. //
  332. ULONG FcbState;
  333. //
  334. // A count of the number of file objects that have been opened for
  335. // this file/directory, but not yet been cleaned up yet. This count
  336. // is only used for data file objects, not for the Acl or Ea stream
  337. // file objects. This count gets decremented in RxCommonCleanup,
  338. // while the OpenCount below gets decremented in RxCommonClose.
  339. //
  340. CLONG UncleanCount;
  341. //
  342. // A count of the number of file objects that have been opened for
  343. // this file/directory, but not yet been cleaned up yet and for which
  344. // cacheing is not supported. This is used in cleanup.c to tell if extra
  345. // purges are required to maintain coherence.
  346. //
  347. CLONG UncachedUncleanCount;
  348. //
  349. // A count of the number of file objects that have opened
  350. // this file/directory. For files & directories the FsContext of the
  351. // file object points to this record.
  352. //
  353. CLONG OpenCount;
  354. //
  355. // The outstanding locks count: if this count is nonzero, the we silently
  356. // ignore adding LOCK_BUFFERING in a ChangeBufferingState request. This field
  357. // is manipulated by interlocked operations so you only have to have the fcb
  358. // shared to manipulate it but you have to have it exclusive to use it.
  359. //
  360. ULONG OutstandingLockOperationsCount;
  361. //
  362. // The actual allocation length as opposed to the valid data length
  363. //
  364. ULONGLONG ActualAllocationLength;
  365. //
  366. // Attributes of the MRX_FCB,
  367. //
  368. ULONG Attributes;
  369. //
  370. // Intended for future use, currently used to round off allocation to
  371. // DWORD boundaries.
  372. //
  373. BOOLEAN Spare1;
  374. BOOLEAN fShouldBeOrphaned;
  375. BOOLEAN fMiniInited;
  376. //
  377. // Type of the associated MRX_NET_ROOT, intended to avoid pointer chasing.
  378. //
  379. UCHAR CachedNetRootType;
  380. //
  381. // Header for the list of srv_opens for this FCB....
  382. // THIS FIELD IS READONLY FOR MINIS
  383. //
  384. LIST_ENTRY SrvOpenList;
  385. //
  386. // changes whenever the list changes..prevents extra lookups
  387. // THIS FIELD IS READONLY FOR MINIS
  388. //
  389. ULONG SrvOpenListVersion;
  390. } MRX_FCB, *PMRX_FCB;
  391. //
  392. // The following flags define the various types of buffering that can be selectively
  393. // enabled or disabled for each SRV_OPEN.
  394. //
  395. #define SRVOPEN_FLAG_DONTUSE_READ_CACHING (0x1)
  396. #define SRVOPEN_FLAG_DONTUSE_WRITE_CACHING (0x2)
  397. #define SRVOPEN_FLAG_CLOSED (0x4)
  398. #define SRVOPEN_FLAG_CLOSE_DELAYED (0x8)
  399. #define SRVOPEN_FLAG_FILE_RENAMED (0x10)
  400. #define SRVOPEN_FLAG_FILE_DELETED (0x20)
  401. #define SRVOPEN_FLAG_BUFFERING_STATE_CHANGE_PENDING (0x40)
  402. #define SRVOPEN_FLAG_COLLAPSING_DISABLED (0x80)
  403. #define SRVOPEN_FLAG_BUFFERING_STATE_CHANGE_REQUESTS_PURGED (0x100)
  404. #define SRVOPEN_FLAG_NO_BUFFERING_STATE_CHANGE (0x200)
  405. #define SRVOPEN_FLAG_ORPHANED (0x400)
  406. typedef
  407. NTSTATUS
  408. (NTAPI *PMRX_SHADOW_CALLDOWN) (
  409. IN OUT struct _RX_CONTEXT * RxContext
  410. );
  411. //
  412. // Minirdrs allocate, initialize and free this structure
  413. //
  414. typedef struct {
  415. //
  416. // Pointer to the file object associated with the handle. This is set
  417. // after the handle is successfully created in the usermode.
  418. //
  419. PFILE_OBJECT UnderlyingFileObject;
  420. //
  421. // Pointer to the device object represented by the file object mentioned
  422. // above.
  423. //
  424. PDEVICE_OBJECT UnderlyingDeviceObject;
  425. ULONG LockKey;
  426. PFAST_IO_READ FastIoRead;
  427. PFAST_IO_WRITE FastIoWrite;
  428. PMRX_SHADOW_CALLDOWN DispatchRoutine;
  429. } MRXSHADOW_SRV_OPEN, *PMRXSHADOW_SRV_OPEN;
  430. #ifdef __cplusplus
  431. typedef struct _MRX_SRV_OPEN_ : public MRX_NORMAL_NODE_HEADER {
  432. #else // !__cplusplus
  433. typedef struct _MRX_SRV_OPEN_ {
  434. MRX_NORMAL_NODE_HEADER;
  435. #endif // __cplusplus
  436. //
  437. // the MRX_FCB instance with which the SRV_OPEN is associated.
  438. //
  439. PMRX_FCB pFcb;
  440. //
  441. // the V_NET_ROOT instance with which the SRV_OPEN is associated
  442. //
  443. PMRX_V_NET_ROOT pVNetRoot;
  444. //
  445. // !!!! changes above this require realignment with fcb.h
  446. //
  447. //
  448. // the context fields to store additional state information as deemed necessary
  449. // by the mini redirectors
  450. //
  451. PVOID Context;
  452. PVOID Context2;
  453. //
  454. // shadow context, mini-rdr allocates and deallocates this structure
  455. //
  456. PMRXSHADOW_SRV_OPEN ShadowContext;
  457. //
  458. // The flags are split into two groups, i.e., visible to mini rdrs and invisible
  459. // to mini rdrs. The visible ones are defined above and the definitions for the
  460. // invisible ones can be found in fcb.h. The convention that has been adopted is
  461. // that the lower 16 flags will be visible to the mini rdr and the upper 16 flags
  462. // will be reserved for the wrapper. This needs to be enforced in defining new flags.
  463. //
  464. ULONG Flags;
  465. //
  466. // the name alongwith the MRX_NET_ROOT prefix, i.e. fully qualified name
  467. //
  468. PUNICODE_STRING pAlreadyPrefixedName;
  469. //
  470. // the number of Fobx's associated with this open for which a cleanup IRP
  471. // has not been processed.
  472. //
  473. CLONG UncleanFobxCount;
  474. //
  475. // the number of local opens associated with this open on the server
  476. //
  477. CLONG OpenCount;
  478. //
  479. // the Key assigned by the mini redirector for this SRV_OPEN. Since the various mini
  480. // redirectors do not always get to pick the unique id for a open instance, the key
  481. // used to identify the open to the server is different for different mini redirectors
  482. // based upon the convention adopted at the server.
  483. //
  484. PVOID Key;
  485. //
  486. // the access and sharing rights specified for this SRV_OPEN. This is used in
  487. // determining is subsequent open requests can be collapsed with an existing
  488. // SRV_OPEN instance.
  489. //
  490. ACCESS_MASK DesiredAccess;
  491. ULONG ShareAccess;
  492. ULONG CreateOptions;
  493. //
  494. // The BufferingFlags field is temporal.....it does not really belong to the
  495. // srvopen; rather the srvopen is used as a representative of the fcb. On
  496. // each open, the bufferingflags field of the srvopen is taken as the minirdr's
  497. // contribution to the buffering state. On an oplock break, a srvopen is passed
  498. // (the one that's being broken) whose bufferflags field is taken as the new
  499. // proxy. On a close that changes the minirdr's contribution, the minirdr should
  500. // take steps to cause a ChangeBufferingState to the new state.
  501. //
  502. // just to reiterate, the field is just used to carry the information from
  503. // the minirdr to RxChangeBufferingState and does not hold longterm coherent
  504. // information.
  505. //
  506. ULONG BufferingFlags;
  507. //
  508. // List Entry to wire the SRV_OPEN to the list of SRV_OPENS maintained as
  509. // part of theFCB
  510. // THIS FIELD IS READONLY FOR MINIS
  511. //
  512. ULONG ulFileSizeVersion;
  513. LIST_ENTRY SrvOpenQLinks;
  514. } MRX_SRV_OPEN, *PMRX_SRV_OPEN;
  515. #define FOBX_FLAG_DFS_OPEN (0x0001)
  516. #define FOBX_FLAG_BAD_HANDLE (0x0002)
  517. #define FOBX_FLAG_BACKUP_INTENT (0x0004)
  518. #define FOBX_FLAG_NOT_USED (0x0008)
  519. #define FOBX_FLAG_FLUSH_EVEN_CACHED_READS (0x0010)
  520. #define FOBX_FLAG_DONT_ALLOW_PAGING_IO (0x0020)
  521. #define FOBX_FLAG_DONT_ALLOW_FASTIO_READ (0x0040)
  522. typedef struct _MRX_PIPE_HANDLE_INFORMATION {
  523. ULONG TypeOfPipe;
  524. ULONG ReadMode;
  525. ULONG CompletionMode;
  526. } MRX_PIPE_HANDLE_INFORMATION, *PMRX_PIPE_HANDLE_INFORMATION;
  527. #ifdef __cplusplus
  528. typedef struct _MRX_FOBX_ : public MRX_NORMAL_NODE_HEADER {
  529. #else // !__cplusplus
  530. typedef struct _MRX_FOBX_ {
  531. MRX_NORMAL_NODE_HEADER;
  532. #endif // __cplusplus
  533. //
  534. // the MRX_SRV_OPEN instance with which the FOBX is associated
  535. //
  536. PMRX_SRV_OPEN pSrvOpen;
  537. //
  538. // the FILE_OBJECT with which this FOBX is associated
  539. // In certain instances the I/O subsystem creates a FILE_OBJECT instance
  540. // on the stack in the interests of efficiency. In such cases this field
  541. // is NULL.
  542. //
  543. PFILE_OBJECT AssociatedFileObject;
  544. //
  545. // !!!! changes above this require realignment with fcb.h
  546. //
  547. //
  548. // The fields provided to accomodate additional state to be associated
  549. // by the various mini redirectors
  550. //
  551. PVOID Context;
  552. PVOID Context2;
  553. //
  554. // The FOBX flags are split into two groups, i.e., visible to mini rdrs and invisible to mini rdrs.
  555. // The visible ones are defined above and the definitions for the invisible ones can be found
  556. // in fcb.h. The convention that has been adopted is that the lower 16 flags will be visible
  557. // to the mini rdr and the upper 16 flags will be reserved for the wrapper. This needs to be
  558. // enforced in defining new flags.
  559. //
  560. ULONG Flags;
  561. union {
  562. struct {
  563. //
  564. // The query template is used to filter directory query requests.
  565. // It originally is set to null and on the first call the NtQueryDirectory
  566. // it is set to the input filename or "*" if the name is not supplied.
  567. // All subsquent queries then use this template.
  568. //
  569. UNICODE_STRING UnicodeQueryTemplate;
  570. }; // for directories
  571. PMRX_PIPE_HANDLE_INFORMATION PipeHandleInformation; // for pipes
  572. };
  573. //
  574. // The following field is used as an offset into the Eas for a
  575. // particular file. This will be the offset for the next
  576. // Ea to return. A value of 0xffffffff indicates that the
  577. // Ea's are exhausted.
  578. //
  579. //
  580. // This field is manipulated directly by the smbmini....maybe it should move down
  581. // one thing is that it is a reminder that NT allows a resume on getting EAs
  582. //
  583. ULONG OffsetOfNextEaToReturn;
  584. } MRX_FOBX, *PMRX_FOBX;
  585. //
  586. // Resource accquisition routines.
  587. //
  588. // The synchronization resources of interest to mini redirector writers are
  589. // primarily associated with the FCB. There is a paging I/O resource and a
  590. // regular resource. The paging I/O resource is managed by the wrapper. The only
  591. // resource accesible to mini redirector writers is the regular resource which
  592. // should be accessed using the supplied routines.
  593. //
  594. NTSTATUS
  595. RxAcquireExclusiveFcbResourceInMRx (
  596. PMRX_FCB Fcb
  597. );
  598. NTSTATUS
  599. RxAcquireSharedFcbResourceInMRx (
  600. PMRX_FCB Fcb
  601. );
  602. VOID
  603. RxReleaseFcbResourceInMRx (
  604. PMRX_FCB Fcb
  605. );
  606. #endif // __MRXFCB_H__