xref: /reactos/sdk/include/ddk/mrxfcb.h (revision c2c66aff)
1 #ifndef __MRXFCB_H__
2 #define __MRXFCB_H__
3 
4 typedef struct _MRX_NORMAL_NODE_HEADER
5 {
6     NODE_TYPE_CODE NodeTypeCode;
7     NODE_BYTE_SIZE NodeByteSize;
8     volatile ULONG NodeReferenceCount;
9 } MRX_NORMAL_NODE_HEADER;
10 
11 #define SRVCALL_FLAG_CASE_INSENSITIVE_NETROOTS 0x4
12 #define SRVCALL_FLAG_CASE_INSENSITIVE_FILENAMES 0x8
13 #define SRVCALL_FLAG_DFS_AWARE_SERVER 0x10
14 #define SRVCALL_FLAG_FORCE_FINALIZED 0x20
15 
16 typedef struct _MRX_SRV_CALL_
17 {
18     MRX_NORMAL_NODE_HEADER;
19     PVOID Context;
20     PVOID Context2;
21     PRDBSS_DEVICE_OBJECT RxDeviceObject;
22     PUNICODE_STRING pSrvCallName;
23     PUNICODE_STRING pPrincipalName;
24     PUNICODE_STRING pDomainName;
25     ULONG Flags;
26     LONG MaximumNumberOfCloseDelayedFiles;
27     NTSTATUS Status;
28 } MRX_SRV_CALL, *PMRX_SRV_CALL;
29 
30 #define NET_ROOT_DISK ((UCHAR)0)
31 #define NET_ROOT_PIPE ((UCHAR)1)
32 #define NET_ROOT_PRINT ((UCHAR)3)
33 #define NET_ROOT_WILD ((UCHAR)4)
34 #define NET_ROOT_MAILSLOT ((UCHAR)5)
35 
36 typedef UCHAR NET_ROOT_TYPE, *PNET_ROOT_TYPE;
37 
38 #define MRX_NET_ROOT_STATE_GOOD ((UCHAR)0)
39 
40 typedef UCHAR MRX_NET_ROOT_STATE, *PMRX_NET_ROOT_STATE;
41 typedef UCHAR MRX_PURGE_RELATIONSHIP, *PMRX_PURGE_RELATIONSHIP;
42 typedef UCHAR MRX_PURGE_SYNCLOCATION, *PMRX_PURGE_SYNCLOCATION;
43 
44 #define NETROOT_FLAG_SUPPORTS_SYMBOLIC_LINKS 0x1
45 #define NETROOT_FLAG_DFS_AWARE_NETROOT 0x2
46 
47 typedef struct _NETROOT_THROTTLING_PARAMETERS
48 {
49     ULONG Increment;
50     ULONG MaximumDelay;
51 } NETROOT_THROTTLING_PARAMETERS, *PNETROOT_THROTTLING_PARAMETERS;
52 
53 typedef struct _MRX_NET_ROOT_
54 {
55     MRX_NORMAL_NODE_HEADER;
56     PMRX_SRV_CALL pSrvCall;
57     PVOID Context;
58     PVOID Context2;
59     ULONG Flags;
60     volatile ULONG NumberOfFcbs;
61     volatile ULONG NumberOfSrvOpens;
62     MRX_NET_ROOT_STATE MRxNetRootState;
63     NET_ROOT_TYPE Type;
64     MRX_PURGE_RELATIONSHIP PurgeRelationship;
65     MRX_PURGE_SYNCLOCATION PurgeSyncLocation;
66     DEVICE_TYPE DeviceType;
67     PUNICODE_STRING pNetRootName;
68     UNICODE_STRING InnerNamePrefix;
69     ULONG  ParameterValidationStamp;
70     union
71     {
72         struct
73         {
74             ULONG DataCollectionSize;
75             NETROOT_THROTTLING_PARAMETERS PipeReadThrottlingParameters;
76         } NamedPipeParameters;
77         struct
78         {
79             ULONG ClusterSize;
80             ULONG ReadAheadGranularity;
81             NETROOT_THROTTLING_PARAMETERS LockThrottlingParameters;
82             ULONG RenameInfoOverallocationSize;
83             GUID VolumeId;
84         } DiskParameters;
85     };
86 } MRX_NET_ROOT, *PMRX_NET_ROOT;
87 
88 #define VNETROOT_FLAG_CSCAGENT_INSTANCE 0x00000001
89 
90 typedef struct _MRX_V_NET_ROOT_
91 {
92     MRX_NORMAL_NODE_HEADER;
93     PMRX_NET_ROOT pNetRoot;
94     PVOID Context;
95     PVOID Context2;
96     ULONG Flags;
97     ULONG NumberOfOpens;
98     volatile ULONG NumberOfFobxs;
99     LUID LogonId;
100     PUNICODE_STRING pUserDomainName;
101     PUNICODE_STRING pUserName;
102     PUNICODE_STRING pPassword;
103     ULONG SessionId;
104     NTSTATUS ConstructionStatus;
105     BOOLEAN IsExplicitConnection;
106 } MRX_V_NET_ROOT, *PMRX_V_NET_ROOT;
107 
108 typedef struct _MRX_FCB_
109 {
110     FSRTL_ADVANCED_FCB_HEADER Header;
111     PMRX_NET_ROOT pNetRoot;
112     PVOID Context;
113     PVOID Context2;
114     volatile ULONG NodeReferenceCount;
115     ULONG FcbState;
116     volatile CLONG UncleanCount;
117     CLONG UncachedUncleanCount;
118     volatile CLONG OpenCount;
119     volatile ULONG OutstandingLockOperationsCount;
120     ULONGLONG ActualAllocationLength;
121     ULONG Attributes;
122     BOOLEAN IsFileWritten;
123     BOOLEAN fShouldBeOrphaned;
124     BOOLEAN fMiniInited;
125     UCHAR CachedNetRootType;
126     LIST_ENTRY SrvOpenList;
127     ULONG SrvOpenListVersion;
128 } MRX_FCB, *PMRX_FCB;
129 
130 #define SRVOPEN_FLAG_DONTUSE_READ_CACHING 0x1
131 #define SRVOPEN_FLAG_DONTUSE_WRITE_CACHING 0x2
132 #define SRVOPEN_FLAG_CLOSED 0x4
133 #define SRVOPEN_FLAG_CLOSE_DELAYED 0x8
134 #define SRVOPEN_FLAG_FILE_RENAMED 0x10
135 #define SRVOPEN_FLAG_FILE_DELETED 0x20
136 #define SRVOPEN_FLAG_BUFFERING_STATE_CHANGE_PENDING 0x40
137 #define SRVOPEN_FLAG_COLLAPSING_DISABLED 0x80
138 #define SRVOPEN_FLAG_BUFFERING_STATE_CHANGE_REQUESTS_PURGED 0x100
139 #define SRVOPEN_FLAG_NO_BUFFERING_STATE_CHANGE 0x200
140 #define SRVOPEN_FLAG_ORPHANED 0x400
141 
142 typedef
143 NTSTATUS
144 (NTAPI *PMRX_SHADOW_CALLDOWN) (
145     IN OUT PRX_CONTEXT RxContext
146     );
147 
148 typedef struct
149 {
150     PFILE_OBJECT UnderlyingFileObject;
151     PDEVICE_OBJECT UnderlyingDeviceObject;
152     ULONG LockKey;
153     PFAST_IO_READ FastIoRead;
154     PFAST_IO_WRITE FastIoWrite;
155     PMRX_SHADOW_CALLDOWN DispatchRoutine;
156 } MRXSHADOW_SRV_OPEN, *PMRXSHADOW_SRV_OPEN;
157 
158 typedef struct _MRX_SRV_OPEN_
159 {
160     MRX_NORMAL_NODE_HEADER;
161     PMRX_FCB pFcb;
162     PMRX_V_NET_ROOT pVNetRoot;
163     PVOID Context;
164     PVOID Context2;
165 #if (_WIN32_WINNT >= 0x0600)
166     PMRXSHADOW_SRV_OPEN ShadowContext;
167 #endif
168     ULONG Flags;
169     PUNICODE_STRING pAlreadyPrefixedName;
170     CLONG UncleanFobxCount;
171     CLONG OpenCount;
172     PVOID Key;
173     ACCESS_MASK DesiredAccess;
174     ULONG ShareAccess;
175     ULONG CreateOptions;
176     ULONG BufferingFlags;
177     ULONG ulFileSizeVersion;
178     LIST_ENTRY SrvOpenQLinks;
179 } MRX_SRV_OPEN, *PMRX_SRV_OPEN;
180 
181 #define FOBX_FLAG_DFS_OPEN 0x0001
182 #define FOBX_FLAG_BAD_HANDLE 0x0002
183 #define FOBX_FLAG_BACKUP_INTENT 0x0004
184 
185 typedef struct _MRX_PIPE_HANDLE_INFORMATION
186 {
187     ULONG TypeOfPipe;
188     ULONG ReadMode;
189     ULONG CompletionMode;
190 } MRX_PIPE_HANDLE_INFORMATION, *PMRX_PIPE_HANDLE_INFORMATION;
191 
192 typedef struct _MRX_FOBX_
193 {
194     MRX_NORMAL_NODE_HEADER;
195     PMRX_SRV_OPEN pSrvOpen;
196     PFILE_OBJECT AssociatedFileObject;
197     PVOID Context;
198     PVOID Context2;
199     ULONG Flags;
200     union
201     {
202         struct
203         {
204             UNICODE_STRING UnicodeQueryTemplate;
205         };
206         PMRX_PIPE_HANDLE_INFORMATION PipeHandleInformation;
207     };
208     ULONG OffsetOfNextEaToReturn;
209 } MRX_FOBX, *PMRX_FOBX;
210 
211 NTSTATUS
212 NTAPI
213 RxAcquireExclusiveFcbResourceInMRx(
214     _Inout_ PMRX_FCB Fcb);
215 
216 #endif
217