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