5 #include <ndk/obfuncs.h>
6 #include <ndk/exfuncs.h>
8 #include <pseh/pseh2.h>
10 #define DRIVER_NAME L"FltMgr"
12 #define FLT_MAJOR_VERSION 0x0200
13 #define FLT_MINOR_VERSION 0x0000 //win2k3
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'
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) associated 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
);
108 ////////////////////////////////////////////////
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.
169 FltAcquirePushLockExclusive
170 FltAcquirePushLockShared
171 FltAcquireResourceExclusive
172 FltAcquireResourceShared
173 FltAllocateCallbackData
175 FltAllocateDeferredIoWorkItem
177 FltAllocateGenericWorkItem
178 FltAllocatePoolAlignedWithTag
180 FltAttachVolumeAtAltitude
181 FltBuildDefaultSecurityDescriptor
190 FltCheckAndGrowNameControl
191 FltCheckLockForReadAccess
192 FltCheckLockForWriteAccess
194 FltClearCallbackDataDirty
195 FltClearCancelCompletion
198 FltCloseCommunicationPort
199 FltCompareInstanceAltitudes
200 FltCompletePendedPostOperation
201 FltCompletePendedPreOperation
202 FltCreateCommunicationPort
205 FltCreateSystemVolumeInformationFolder
206 FltCurrentBatchOplock
210 FltDeleteInstanceContext
212 FltDeleteStreamContext
213 FltDeleteStreamHandleContext
214 FltDeleteVolumeContext
216 FltDeviceIoControlFile
217 FltDoCompletionProcessingWhenSafe
218 FltEnumerateFilterInformation
220 FltEnumerateInstanceInformationByFilter
221 FltEnumerateInstanceInformationByVolume
222 FltEnumerateInstances
223 FltEnumerateVolumeInformation
227 FltFreeDeferredIoWorkItem
229 FltFreeGenericWorkItem
230 FltFreePoolAlignedWithTag
231 FltFreeSecurityDescriptor
235 FltGetDestinationFileNameInformation
237 FltGetDiskDeviceObject
239 FltGetFileNameInformation
240 FltGetFileNameInformationUnsafe
241 FltGetFilterFromInstance
243 FltGetFilterInformation
244 FltGetInstanceContext
245 FltGetInstanceInformation
248 FltGetRequestorProcess
249 FltGetRequestorProcessId
252 FltGetStreamHandleContext
253 FltGetSwappedBufferMdlAddress
258 FltGetVolumeFromDeviceObject
259 FltGetVolumeFromFileObject
263 FltGetVolumeInstanceFromName
265 FltGetVolumeProperties
266 FltInitializeFileLock
268 FltInitializePushLock
270 FltIsCallbackDataDirty
273 FltIsOperationSynchronous
277 FltNotifyFilterChangeDirectory
282 FltOplockIsFastIoPossible
284 FltParseFileNameInformation
285 FltPerformAsynchronousIo
286 FltPerformSynchronousIo
288 FltPurgeFileNameInformationCache
290 FltQueryInformationFile
291 FltQuerySecurityObject
292 FltQueryVolumeInformation
293 FltQueryVolumeInformationFile
294 FltQueueDeferredIoWorkItem
295 FltQueueGenericWorkItem
298 FltReferenceFileNameInformation
300 FltReissueSynchronousIo
303 FltReleaseFileNameInformation
306 FltRequestOperationStatusCallback
307 FltRetainSwappedBufferMdlAddress
310 FltSetCallbackDataDirty
311 FltSetCancelCompletion
314 FltSetInformationFile
315 FltSetInstanceContext
318 FltSetStreamHandleContext
320 FltSetVolumeInformation
322 FltSupportsFileContexts
323 FltSupportsStreamContexts
324 FltSupportsStreamHandleContexts
326 FltUninitializeFileLock
327 FltUninitializeOplock
337 #endif /* _FLTMGR_H */