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
10 #include <pseh/pseh2.h>
12 #define DRIVER_NAME L"FltMgr"
14 #define FLT_MAJOR_VERSION 0x0200
15 #define FLT_MINOR_VERSION 0x0000 //win2k3
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'
24 #define MAX_DEVNAME_LENGTH 64
27 typedef struct _DRIVER_DATA
29 PDRIVER_OBJECT DriverObject
;
30 PDEVICE_OBJECT DeviceObject
;
31 UNICODE_STRING ServiceKey
;
33 PDEVICE_OBJECT CommsDeviceObject
;
35 PFAST_IO_DISPATCH FastIoDispatch
;
37 FAST_MUTEX FilterAttachLock
;
39 } DRIVER_DATA
, *PDRIVER_DATA
;
41 typedef struct _FLTMGR_DEVICE_EXTENSION
43 /* The file system we're attached to */
44 PDEVICE_OBJECT AttachedToDeviceObject
;
46 /* The storage stack(disk) accociated with the file system device object we're attached to */
47 PDEVICE_OBJECT StorageStackDeviceObject
;
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
];
54 } FLTMGR_DEVICE_EXTENSION
, *PFLTMGR_DEVICE_EXTENSION
;
59 _In_ PFLT_FILTER Filter
,
60 _In_
const FLT_CONTEXT_REGISTRATION
*Context
64 FltpExInitializeRundownProtection(
65 _Out_ PEX_RUNDOWN_REF RundownRef
69 FltpExAcquireRundownProtection(
70 _Inout_ PEX_RUNDOWN_REF RundownRef
74 FltpExReleaseRundownProtection(
75 _Inout_ PEX_RUNDOWN_REF RundownRef
80 FltpObjectRundownWait(
81 _Inout_ PEX_RUNDOWN_REF RundownRef
85 FltpExRundownCompleted(
86 _Inout_ PEX_RUNDOWN_REF RundownRef
89 /////////// FIXME: put these into the correct header
91 FltpGetBaseDeviceObjectName(_In_ PDEVICE_OBJECT DeviceObject
,
92 _Inout_ PUNICODE_STRING ObjectName
);
95 FltpGetObjectName(_In_ PVOID Object
,
96 _Inout_ PUNICODE_STRING ObjectName
);
99 FltpReallocateUnicodeString(_In_ PUNICODE_STRING String
,
100 _In_ SIZE_T NewLength
,
101 _In_ BOOLEAN CopyExisting
);
104 FltpFreeUnicodeString(_In_ PUNICODE_STRING String
);
105 ////////////////////////////////////////////////
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.
166 FltAcquirePushLockExclusive
167 FltAcquirePushLockShared
168 FltAcquireResourceExclusive
169 FltAcquireResourceShared
170 FltAllocateCallbackData
172 FltAllocateDeferredIoWorkItem
174 FltAllocateGenericWorkItem
175 FltAllocatePoolAlignedWithTag
177 FltAttachVolumeAtAltitude
178 FltBuildDefaultSecurityDescriptor
187 FltCheckAndGrowNameControl
188 FltCheckLockForReadAccess
189 FltCheckLockForWriteAccess
191 FltClearCallbackDataDirty
192 FltClearCancelCompletion
195 FltCloseCommunicationPort
196 FltCompareInstanceAltitudes
197 FltCompletePendedPostOperation
198 FltCompletePendedPreOperation
199 FltCreateCommunicationPort
202 FltCreateSystemVolumeInformationFolder
203 FltCurrentBatchOplock
207 FltDeleteInstanceContext
209 FltDeleteStreamContext
210 FltDeleteStreamHandleContext
211 FltDeleteVolumeContext
213 FltDeviceIoControlFile
214 FltDoCompletionProcessingWhenSafe
215 FltEnumerateFilterInformation
217 FltEnumerateInstanceInformationByFilter
218 FltEnumerateInstanceInformationByVolume
219 FltEnumerateInstances
220 FltEnumerateVolumeInformation
224 FltFreeDeferredIoWorkItem
226 FltFreeGenericWorkItem
227 FltFreePoolAlignedWithTag
228 FltFreeSecurityDescriptor
232 FltGetDestinationFileNameInformation
234 FltGetDiskDeviceObject
236 FltGetFileNameInformation
237 FltGetFileNameInformationUnsafe
238 FltGetFilterFromInstance
240 FltGetFilterInformation
241 FltGetInstanceContext
242 FltGetInstanceInformation
245 FltGetRequestorProcess
246 FltGetRequestorProcessId
249 FltGetStreamHandleContext
250 FltGetSwappedBufferMdlAddress
255 FltGetVolumeFromDeviceObject
256 FltGetVolumeFromFileObject
257 FltGetVolumeFromInstance
260 FltGetVolumeInstanceFromName
262 FltGetVolumeProperties
263 FltInitializeFileLock
265 FltInitializePushLock
267 FltIsCallbackDataDirty
270 FltIsOperationSynchronous
274 FltNotifyFilterChangeDirectory
279 FltOplockIsFastIoPossible
281 FltParseFileNameInformation
282 FltPerformAsynchronousIo
283 FltPerformSynchronousIo
285 FltPurgeFileNameInformationCache
287 FltQueryInformationFile
288 FltQuerySecurityObject
289 FltQueryVolumeInformation
290 FltQueryVolumeInformationFile
291 FltQueueDeferredIoWorkItem
292 FltQueueGenericWorkItem
295 FltReferenceFileNameInformation
297 FltReissueSynchronousIo
300 FltReleaseFileNameInformation
303 FltRequestOperationStatusCallback
304 FltRetainSwappedBufferMdlAddress
307 FltSetCallbackDataDirty
308 FltSetCancelCompletion
311 FltSetInformationFile
312 FltSetInstanceContext
315 FltSetStreamHandleContext
317 FltSetVolumeInformation
319 FltSupportsFileContexts
320 FltSupportsStreamContexts
321 FltSupportsStreamHandleContexts
323 FltUninitializeFileLock
324 FltUninitializeOplock
334 #endif /* _FLTMGR_H */