[FASTFAT] Fix size checking in VfatGetFileNameInformation()
[reactos.git] / drivers / filters / fltmgr / fltmgr.h
1 #ifndef _FLTMGR_H
2 #define _FLTMGR_H
3
4 #include <ntifs.h>
5 #include <ndk/obfuncs.h>
6 #include <ndk/exfuncs.h>
7 #include <fltkernel.h>
8 #include <pseh/pseh2.h>
9
10 #define DRIVER_NAME L"FltMgr"
11
12 #define FLT_MAJOR_VERSION 0x0200
13 #define FLT_MINOR_VERSION 0x0000 //win2k3
14
15 #define FM_TAG_DISPATCH_TABLE 'ifMF'
16 #define FM_TAG_REGISTRY_DATA 'rtMF'
17 #define FM_TAG_DEV_OBJ_PTRS 'ldMF'
18 #define FM_TAG_UNICODE_STRING 'suMF'
19 #define FM_TAG_FILTER 'lfMF'
20 #define FM_TAG_CONTEXT_REGISTA 'rcMF'
21 #define FM_TAG_CCB 'bcMF'
22 #define FM_TAG_TEMP_REGISTRY 'rtMF'
23
24 #define MAX_DEVNAME_LENGTH 64
25
26
27 typedef struct _DRIVER_DATA
28 {
29 PDRIVER_OBJECT DriverObject;
30 PDEVICE_OBJECT DeviceObject;
31 UNICODE_STRING ServiceKey;
32
33 PDEVICE_OBJECT CommsDeviceObject;
34
35 PFAST_IO_DISPATCH FastIoDispatch;
36
37 FAST_MUTEX FilterAttachLock;
38
39 } DRIVER_DATA, *PDRIVER_DATA;
40
41 typedef struct _FLTMGR_DEVICE_EXTENSION
42 {
43 /* The file system we're attached to */
44 PDEVICE_OBJECT AttachedToDeviceObject;
45
46 /* The storage stack(disk) associated with the file system device object we're attached to */
47 PDEVICE_OBJECT StorageStackDeviceObject;
48
49 /* Either physical drive for volume device objects otherwise
50 * it's the name of the control device we're attached to */
51 UNICODE_STRING DeviceName;
52 WCHAR DeviceNameBuffer[MAX_DEVNAME_LENGTH];
53
54 } FLTMGR_DEVICE_EXTENSION, *PFLTMGR_DEVICE_EXTENSION;
55
56
57 NTSTATUS
58 FltpRegisterContexts(
59 _In_ PFLT_FILTER Filter,
60 _In_ const FLT_CONTEXT_REGISTRATION *Context
61 );
62
63 VOID
64 FltpExInitializeRundownProtection(
65 _Out_ PEX_RUNDOWN_REF RundownRef
66 );
67
68 BOOLEAN
69 FltpExAcquireRundownProtection(
70 _Inout_ PEX_RUNDOWN_REF RundownRef
71 );
72
73 BOOLEAN
74 FltpExReleaseRundownProtection(
75 _Inout_ PEX_RUNDOWN_REF RundownRef
76 );
77
78 NTSTATUS
79 NTAPI
80 FltpObjectRundownWait(
81 _Inout_ PEX_RUNDOWN_REF RundownRef
82 );
83
84 BOOLEAN
85 FltpExRundownCompleted(
86 _Inout_ PEX_RUNDOWN_REF RundownRef
87 );
88
89 /////////// FIXME: put these into the correct header
90 NTSTATUS
91 FltpGetBaseDeviceObjectName(_In_ PDEVICE_OBJECT DeviceObject,
92 _Inout_ PUNICODE_STRING ObjectName);
93
94 NTSTATUS
95 FltpGetObjectName(_In_ PVOID Object,
96 _Inout_ PUNICODE_STRING ObjectName);
97
98 NTSTATUS
99 FltpReallocateUnicodeString(_In_ PUNICODE_STRING String,
100 _In_ SIZE_T NewLength,
101 _In_ BOOLEAN CopyExisting);
102
103 VOID
104 FltpFreeUnicodeString(_In_ PUNICODE_STRING String);
105
106
107
108 ////////////////////////////////////////////////
109
110
111
112
113
114
115
116
117
118
119
120
121 //FM ? ? -fltmgr.sys - Unrecognized FltMgr tag(update pooltag.w)
122 //FMac - fltmgr.sys - ASCII String buffers
123 //FMas - fltmgr.sys - ASYNC_IO_COMPLETION_CONTEXT structure
124 //FMcb - fltmgr.sys - FLT_CCB structure
125 //FMcr - fltmgr.sys - Context registration structures
126 //FMct - fltmgr.sys - TRACK_COMPLETION_NODES structure
127 //FMdl - fltmgr.sys - Array of DEVICE_OBJECT pointers
128 //FMea - fltmgr.sys - EA buffer for create
129 //FMfc - fltmgr.sys - FLTMGR_FILE_OBJECT_CONTEXT structure
130 //FMfi - fltmgr.sys - Fast IO dispatch table
131 //FMfk - fltmgr.sys - Byte Range Lock structure
132 //FMfl - fltmgr.sys - FLT_FILTER structure
133 //FMfn - fltmgr.sys - NAME_CACHE_NODE structure
134 //FMfr - fltmgr.sys - FLT_FRAME structure
135 //FMfz - fltmgr.sys - FILE_LIST_CTRL structure
136 //FMib - fltmgr.sys - Irp SYSTEM buffers
137 //FMic - fltmgr.sys - IRP_CTRL structure
138 //FMin - fltmgr.sys - FLT_INSTANCE name
139 //FMil - fltmgr.sys - IRP_CTRL completion node stack
140 //FMis - fltmgr.sys - FLT_INSTANCE structure
141 //FMla - fltmgr.sys - Per - processor IRPCTRL lookaside lists
142 //FMnc - fltmgr.sys - NAME_CACHE_CREATE_CTRL structure
143 //FMng - fltmgr.sys - NAME_GENERATION_CONTEXT structure
144 //FMol - fltmgr.sys - OPLOCK_CONTEXT structure
145 //FMos - fltmgr.sys - Operation status ctrl structure
146 //FMpl - fltmgr.sys - Cache aware pushLock
147 //FMpr - fltmgr.sys - FLT_PRCB structure
148 //FMrl - fltmgr.sys - FLT_OBJECT rundown logs
149 //FMrp - fltmgr.sys - Reparse point data buffer
150 //FMrr - fltmgr.sys - Per - processor Cache - aware rundown ref structure
151 //FMsd - fltmgr.sys - Security descriptors
152 //FMsl - fltmgr.sys - STREAM_LIST_CTRL structure
153 //FMtn - fltmgr.sys - Temporary file names
154 //FMtr - fltmgr.sys - Temporary Registry information
155 //FMts - fltmgr.sys - Tree Stack
156 //FMus - fltmgr.sys - Unicode string
157 //FMvf - fltmgr.sys - FLT_VERIFIER_EXTENSION structure
158 //FMvj - fltmgr.sys - FLT_VERIFIER_OBJECT structure
159 //FMvo - fltmgr.sys - FLT_VOLUME structure
160 //FMwi - fltmgr.sys - Work item structures
161 //FMcn - fltmgr.sys - Non paged context extension structures.
162 //FMtp - fltmgr.sys - Non Paged tx vol context structures.
163 //FMlp - fltmgr.sys - Paged stream list control entry structures.
164
165
166
167
168 /*
169 FltAcquirePushLockExclusive
170 FltAcquirePushLockShared
171 FltAcquireResourceExclusive
172 FltAcquireResourceShared
173 FltAllocateCallbackData
174 FltAllocateContext
175 FltAllocateDeferredIoWorkItem
176 FltAllocateFileLock
177 FltAllocateGenericWorkItem
178 FltAllocatePoolAlignedWithTag
179 FltAttachVolume
180 FltAttachVolumeAtAltitude
181 FltBuildDefaultSecurityDescriptor
182 FltCancelFileOpen
183 FltCancelIo
184 FltCbdqDisable
185 FltCbdqEnable
186 FltCbdqInitialize
187 FltCbdqInsertIo
188 FltCbdqRemoveIo
189 FltCbdqRemoveNextIo
190 FltCheckAndGrowNameControl
191 FltCheckLockForReadAccess
192 FltCheckLockForWriteAccess
193 FltCheckOplock
194 FltClearCallbackDataDirty
195 FltClearCancelCompletion
196 FltClose
197 FltCloseClientPort
198 FltCloseCommunicationPort
199 FltCompareInstanceAltitudes
200 FltCompletePendedPostOperation
201 FltCompletePendedPreOperation
202 FltCreateCommunicationPort
203 FltCreateFile
204 FltCreateFileEx
205 FltCreateSystemVolumeInformationFolder
206 FltCurrentBatchOplock
207 FltDecodeParameters
208 FltDeleteContext
209 FltDeleteFileContext
210 FltDeleteInstanceContext
211 FltDeletePushLock
212 FltDeleteStreamContext
213 FltDeleteStreamHandleContext
214 FltDeleteVolumeContext
215 FltDetachVolume
216 FltDeviceIoControlFile
217 FltDoCompletionProcessingWhenSafe
218 FltEnumerateFilterInformation
219 FltEnumerateFilters
220 FltEnumerateInstanceInformationByFilter
221 FltEnumerateInstanceInformationByVolume
222 FltEnumerateInstances
223 FltEnumerateVolumeInformation
224 FltEnumerateVolumes
225 FltFlushBuffers
226 FltFreeCallbackData
227 FltFreeDeferredIoWorkItem
228 FltFreeFileLock
229 FltFreeGenericWorkItem
230 FltFreePoolAlignedWithTag
231 FltFreeSecurityDescriptor
232 FltFsControlFile
233 FltGetBottomInstance
234 FltGetContexts
235 FltGetDestinationFileNameInformation
236 FltGetDeviceObject
237 FltGetDiskDeviceObject
238 FltGetFileContext
239 FltGetFileNameInformation
240 FltGetFileNameInformationUnsafe
241 FltGetFilterFromInstance
242 FltGetFilterFromName
243 FltGetFilterInformation
244 FltGetInstanceContext
245 FltGetInstanceInformation
246 FltGetIrpName
247 FltGetLowerInstance
248 FltGetRequestorProcess
249 FltGetRequestorProcessId
250 FltGetRoutineAddress
251 FltGetStreamContext
252 FltGetStreamHandleContext
253 FltGetSwappedBufferMdlAddress
254 FltGetTopInstance
255 FltGetTunneledName
256 FltGetUpperInstance
257 FltGetVolumeContext
258 FltGetVolumeFromDeviceObject
259 FltGetVolumeFromFileObject
260 FltLoadFilter
261 FltGetVolumeFromName
262 FltGetVolumeGuidName
263 FltGetVolumeInstanceFromName
264 FltGetVolumeName
265 FltGetVolumeProperties
266 FltInitializeFileLock
267 FltInitializeOplock
268 FltInitializePushLock
269 FltIs32bitProcess
270 FltIsCallbackDataDirty
271 FltIsDirectory
272 FltIsIoCanceled
273 FltIsOperationSynchronous
274 FltIsVolumeWritable
275 FltLoadFilter
276 FltLockUserBuffer
277 FltNotifyFilterChangeDirectory
278 FltObjectDereference
279 FltObjectReference
280 FltOpenVolume
281 FltOplockFsctrl
282 FltOplockIsFastIoPossible
283 FltParseFileName
284 FltParseFileNameInformation
285 FltPerformAsynchronousIo
286 FltPerformSynchronousIo
287 FltProcessFileLock
288 FltPurgeFileNameInformationCache
289 FltQueryEaFile
290 FltQueryInformationFile
291 FltQuerySecurityObject
292 FltQueryVolumeInformation
293 FltQueryVolumeInformationFile
294 FltQueueDeferredIoWorkItem
295 FltQueueGenericWorkItem
296 FltReadFile
297 FltReferenceContext
298 FltReferenceFileNameInformation
299 FltRegisterFilter
300 FltReissueSynchronousIo
301 FltReleaseContext
302 FltReleaseContexts
303 FltReleaseFileNameInformation
304 FltReleasePushLock
305 FltReleaseResource
306 FltRequestOperationStatusCallback
307 FltRetainSwappedBufferMdlAddress
308 FltReuseCallbackData
309 FltSendMessage
310 FltSetCallbackDataDirty
311 FltSetCancelCompletion
312 FltSetEaFile
313 FltSetFileContext
314 FltSetInformationFile
315 FltSetInstanceContext
316 FltSetSecurityObject
317 FltSetStreamContext
318 FltSetStreamHandleContext
319 FltSetVolumeContext
320 FltSetVolumeInformation
321 FltStartFiltering
322 FltSupportsFileContexts
323 FltSupportsStreamContexts
324 FltSupportsStreamHandleContexts
325 FltTagFile
326 FltUninitializeFileLock
327 FltUninitializeOplock
328 FltUnloadFilter
329 FltUnregisterFilter
330 FltUntagFile
331 FltWriteFile
332 */
333
334
335
336
337 #endif /* _FLTMGR_H */