[FLTMGR]
[reactos.git] / reactos / drivers / filters / fltmgr / fltmgr.h
1 #ifndef _FLTMGR_H
2 #define _FLTMGR_H
3
4 // Hack - our SDK reports NTDDI_VERSION as 0x05020100 (from _WIN32_WINNT 0x502)
5 // which doesn't pass the FLT_MGR_BASELINE check in fltkernel.h
6 #define NTDDI_VERSION NTDDI_WS03SP1
7
8 #include <ntifs.h>
9 #include <fltkernel.h>
10 #include <pseh/pseh2.h>
11
12 #define DRIVER_NAME L"FltMgr"
13
14 #define FLT_MAJOR_VERSION 0x0200
15 #define FLT_MINOR_VERSION 0x0000 //win2k3
16
17 #define FM_TAG_DISPATCH_TABLE 'ifMF'
18 #define FM_TAG_REGISTRY_DATA 'rtMF'
19 #define FM_TAG_DEV_OBJ_PTRS 'ldMF'
20 #define FM_TAG_UNICODE_STRING 'suMF'
21 #define FM_TAG_FILTER 'lfMF'
22 #define FM_TAG_CONTEXT_REGISTA 'rcMF'
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) accociated 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 //FM ? ? -fltmgr.sys - Unrecognized FltMgr tag(update pooltag.w)
119 //FMac - fltmgr.sys - ASCII String buffers
120 //FMas - fltmgr.sys - ASYNC_IO_COMPLETION_CONTEXT structure
121 //FMcb - fltmgr.sys - FLT_CCB structure
122 //FMcr - fltmgr.sys - Context registration structures
123 //FMct - fltmgr.sys - TRACK_COMPLETION_NODES structure
124 //FMdl - fltmgr.sys - Array of DEVICE_OBJECT pointers
125 //FMea - fltmgr.sys - EA buffer for create
126 //FMfc - fltmgr.sys - FLTMGR_FILE_OBJECT_CONTEXT structure
127 //FMfi - fltmgr.sys - Fast IO dispatch table
128 //FMfk - fltmgr.sys - Byte Range Lock structure
129 //FMfl - fltmgr.sys - FLT_FILTER structure
130 //FMfn - fltmgr.sys - NAME_CACHE_NODE structure
131 //FMfr - fltmgr.sys - FLT_FRAME structure
132 //FMfz - fltmgr.sys - FILE_LIST_CTRL structure
133 //FMib - fltmgr.sys - Irp SYSTEM buffers
134 //FMic - fltmgr.sys - IRP_CTRL structure
135 //FMin - fltmgr.sys - FLT_INSTANCE name
136 //FMil - fltmgr.sys - IRP_CTRL completion node stack
137 //FMis - fltmgr.sys - FLT_INSTANCE structure
138 //FMla - fltmgr.sys - Per - processor IRPCTRL lookaside lists
139 //FMnc - fltmgr.sys - NAME_CACHE_CREATE_CTRL structure
140 //FMng - fltmgr.sys - NAME_GENERATION_CONTEXT structure
141 //FMol - fltmgr.sys - OPLOCK_CONTEXT structure
142 //FMos - fltmgr.sys - Operation status ctrl structure
143 //FMpl - fltmgr.sys - Cache aware pushLock
144 //FMpr - fltmgr.sys - FLT_PRCB structure
145 //FMrl - fltmgr.sys - FLT_OBJECT rundown logs
146 //FMrp - fltmgr.sys - Reparse point data buffer
147 //FMrr - fltmgr.sys - Per - processor Cache - aware rundown ref structure
148 //FMsd - fltmgr.sys - Security descriptors
149 //FMsl - fltmgr.sys - STREAM_LIST_CTRL structure
150 //FMtn - fltmgr.sys - Temporary file names
151 //FMtr - fltmgr.sys - Temporary Registry information
152 //FMts - fltmgr.sys - Tree Stack
153 //FMus - fltmgr.sys - Unicode string
154 //FMvf - fltmgr.sys - FLT_VERIFIER_EXTENSION structure
155 //FMvj - fltmgr.sys - FLT_VERIFIER_OBJECT structure
156 //FMvo - fltmgr.sys - FLT_VOLUME structure
157 //FMwi - fltmgr.sys - Work item structures
158 //FMcn - fltmgr.sys - Non paged context extension structures.
159 //FMtp - fltmgr.sys - Non Paged tx vol context structures.
160 //FMlp - fltmgr.sys - Paged stream list control entry structures.
161
162
163
164
165 /*
166 FltAcquirePushLockExclusive
167 FltAcquirePushLockShared
168 FltAcquireResourceExclusive
169 FltAcquireResourceShared
170 FltAllocateCallbackData
171 FltAllocateContext
172 FltAllocateDeferredIoWorkItem
173 FltAllocateFileLock
174 FltAllocateGenericWorkItem
175 FltAllocatePoolAlignedWithTag
176 FltAttachVolume
177 FltAttachVolumeAtAltitude
178 FltBuildDefaultSecurityDescriptor
179 FltCancelFileOpen
180 FltCancelIo
181 FltCbdqDisable
182 FltCbdqEnable
183 FltCbdqInitialize
184 FltCbdqInsertIo
185 FltCbdqRemoveIo
186 FltCbdqRemoveNextIo
187 FltCheckAndGrowNameControl
188 FltCheckLockForReadAccess
189 FltCheckLockForWriteAccess
190 FltCheckOplock
191 FltClearCallbackDataDirty
192 FltClearCancelCompletion
193 FltClose
194 FltCloseClientPort
195 FltCloseCommunicationPort
196 FltCompareInstanceAltitudes
197 FltCompletePendedPostOperation
198 FltCompletePendedPreOperation
199 FltCreateCommunicationPort
200 FltCreateFile
201 FltCreateFileEx
202 FltCreateSystemVolumeInformationFolder
203 FltCurrentBatchOplock
204 FltDecodeParameters
205 FltDeleteContext
206 FltDeleteFileContext
207 FltDeleteInstanceContext
208 FltDeletePushLock
209 FltDeleteStreamContext
210 FltDeleteStreamHandleContext
211 FltDeleteVolumeContext
212 FltDetachVolume
213 FltDeviceIoControlFile
214 FltDoCompletionProcessingWhenSafe
215 FltEnumerateFilterInformation
216 FltEnumerateFilters
217 FltEnumerateInstanceInformationByFilter
218 FltEnumerateInstanceInformationByVolume
219 FltEnumerateInstances
220 FltEnumerateVolumeInformation
221 FltEnumerateVolumes
222 FltFlushBuffers
223 FltFreeCallbackData
224 FltFreeDeferredIoWorkItem
225 FltFreeFileLock
226 FltFreeGenericWorkItem
227 FltFreePoolAlignedWithTag
228 FltFreeSecurityDescriptor
229 FltFsControlFile
230 FltGetBottomInstance
231 FltGetContexts
232 FltGetDestinationFileNameInformation
233 FltGetDeviceObject
234 FltGetDiskDeviceObject
235 FltGetFileContext
236 FltGetFileNameInformation
237 FltGetFileNameInformationUnsafe
238 FltGetFilterFromInstance
239 FltGetFilterFromName
240 FltGetFilterInformation
241 FltGetInstanceContext
242 FltGetInstanceInformation
243 FltGetIrpName
244 FltGetLowerInstance
245 FltGetRequestorProcess
246 FltGetRequestorProcessId
247 FltGetRoutineAddress
248 FltGetStreamContext
249 FltGetStreamHandleContext
250 FltGetSwappedBufferMdlAddress
251 FltGetTopInstance
252 FltGetTunneledName
253 FltGetUpperInstance
254 FltGetVolumeContext
255 FltGetVolumeFromDeviceObject
256 FltGetVolumeFromFileObject
257 FltGetVolumeFromInstance
258 FltGetVolumeFromName
259 FltGetVolumeGuidName
260 FltGetVolumeInstanceFromName
261 FltGetVolumeName
262 FltGetVolumeProperties
263 FltInitializeFileLock
264 FltInitializeOplock
265 FltInitializePushLock
266 FltIs32bitProcess
267 FltIsCallbackDataDirty
268 FltIsDirectory
269 FltIsIoCanceled
270 FltIsOperationSynchronous
271 FltIsVolumeWritable
272 FltLoadFilter
273 FltLockUserBuffer
274 FltNotifyFilterChangeDirectory
275 FltObjectDereference
276 FltObjectReference
277 FltOpenVolume
278 FltOplockFsctrl
279 FltOplockIsFastIoPossible
280 FltParseFileName
281 FltParseFileNameInformation
282 FltPerformAsynchronousIo
283 FltPerformSynchronousIo
284 FltProcessFileLock
285 FltPurgeFileNameInformationCache
286 FltQueryEaFile
287 FltQueryInformationFile
288 FltQuerySecurityObject
289 FltQueryVolumeInformation
290 FltQueryVolumeInformationFile
291 FltQueueDeferredIoWorkItem
292 FltQueueGenericWorkItem
293 FltReadFile
294 FltReferenceContext
295 FltReferenceFileNameInformation
296 FltRegisterFilter
297 FltReissueSynchronousIo
298 FltReleaseContext
299 FltReleaseContexts
300 FltReleaseFileNameInformation
301 FltReleasePushLock
302 FltReleaseResource
303 FltRequestOperationStatusCallback
304 FltRetainSwappedBufferMdlAddress
305 FltReuseCallbackData
306 FltSendMessage
307 FltSetCallbackDataDirty
308 FltSetCancelCompletion
309 FltSetEaFile
310 FltSetFileContext
311 FltSetInformationFile
312 FltSetInstanceContext
313 FltSetSecurityObject
314 FltSetStreamContext
315 FltSetStreamHandleContext
316 FltSetVolumeContext
317 FltSetVolumeInformation
318 FltStartFiltering
319 FltSupportsFileContexts
320 FltSupportsStreamContexts
321 FltSupportsStreamHandleContexts
322 FltTagFile
323 FltUninitializeFileLock
324 FltUninitializeOplock
325 FltUnloadFilter
326 FltUnregisterFilter
327 FltUntagFile
328 FltWriteFile
329 */
330
331
332
333
334 #endif /* _FLTMGR_H */