ReactOS  0.4.14-dev-614-gbfd8a84
Filter.c
Go to the documentation of this file.
1 /*
2 * PROJECT: Filesystem Filter Manager
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: drivers/filters/fltmgr/Filter.c
5 * PURPOSE: Handles registration of mini filters
6 * PROGRAMMERS: Ged Murphy (gedmurphy@reactos.org)
7 */
8 
9 /* INCLUDES ******************************************************************/
10 
11 #include "fltmgr.h"
12 #include "fltmgrint.h"
13 #include "Registry.h"
14 
15 #define NDEBUG
16 #include <debug.h>
17 
18 
19 /* DATA *********************************************************************/
20 
21 #define SERVICES_KEY L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"
22 #define MAX_KEY_LENGTH 0x200
23 
26 
30 );
31 
32 VOID
34 );
35 
39  _Inout_ PFLTP_FRAME *Frame
40 );
41 
42 static
46  _Inout_ PUNICODE_STRING AltitudeString
47 );
48 
49 static
54  _Out_ PFLTP_FRAME *Frame
55 );
56 
57 
58 /* EXPORTED FUNCTIONS ******************************************************/
59 
61 NTAPI
63 {
64  UNICODE_STRING DriverServiceName;
65  UNICODE_STRING ServicesKey;
67 
68  /* Setup the base services key */
69  RtlInitUnicodeString(&ServicesKey, SERVICES_KEY);
70 
71  /* Initialize the string data */
72  DriverServiceName.Length = 0;
73  DriverServiceName.Buffer = (PWCH)Buffer;
74  DriverServiceName.MaximumLength = MAX_KEY_LENGTH;
75 
76  /* Create the full service key for this filter */
77  RtlCopyUnicodeString(&DriverServiceName, &ServicesKey);
78  RtlAppendUnicodeStringToString(&DriverServiceName, FilterName);
79 
80  /* Ask the kernel to load it for us */
81  return ZwLoadDriver(&DriverServiceName);
82 }
83 
85 NTAPI
87 {
88  //
89  //FIXME: This is a temp hack, it needs properly implementing
90  //
91 
92  UNICODE_STRING DriverServiceName;
93  UNICODE_STRING ServicesKey;
95 
96  /* Setup the base services key */
97  RtlInitUnicodeString(&ServicesKey, SERVICES_KEY);
98 
99  /* Initialize the string data */
100  DriverServiceName.Length = 0;
101  DriverServiceName.Buffer = (PWCH)Buffer;
102  DriverServiceName.MaximumLength = MAX_KEY_LENGTH;
103 
104  /* Create the full service key for this filter */
105  RtlCopyUnicodeString(&DriverServiceName, &ServicesKey);
106  RtlAppendUnicodeStringToString(&DriverServiceName, FilterName);
107  return ZwUnloadDriver(&DriverServiceName);
108 }
109 
110 NTSTATUS
111 NTAPI
115 {
118  PFLTP_FRAME Frame;
119  ULONG CallbackBufferSize;
120  ULONG FilterBufferSize;
121  ULONG Count = 0;
122  PCHAR Ptr;
124 
125  *RetFilter = NULL;
126 
127  /* Make sure we're targeting the correct major revision */
128  if ((Registration->Version & 0xFF00) != FLT_MAJOR_VERSION)
129  {
131  }
132 
133  /* Make sure our namespace callbacks are valid */
136  {
138  }
139 
140  /* Count the number of operations that were requested */
142  while (Callbacks)
143  {
144  Count++;
145 
146  /* Bail when we find the last one */
147  if (Callbacks->MajorFunction == IRP_MJ_OPERATION_END)
148  break;
149 
150  /* Move to the next item */
151  Callbacks++;
152  }
153 
154  /* Calculate the buffer sizes */
155  CallbackBufferSize = Count * sizeof(FLT_OPERATION_REGISTRATION);
156  FilterBufferSize = sizeof(FLT_FILTER) +
157  CallbackBufferSize +
159 
160  /* Allocate a buffer to hold our filter data */
162  FilterBufferSize,
163  FM_TAG_FILTER);
165  RtlZeroMemory(Filter, FilterBufferSize);
166 
167  /* Find the end of the fixed struct */
168  Ptr = (PCHAR)(Filter + 1);
169 
170  /* Store a copy of the driver object of this filter */
172 
173  /* Initialize the base object data */
175  Filter->Base.PointerCount = 1;
178 
179  /* Set the callback addresses */
188 
189  /* Initialize the instance list */
193 
197 
201 
202  /* Initialize the usermode port list */
205  Filter->PortList.mCount = 0;
206 
207  /* We got this far, assume success from here */
209 
210  /* Check if the caller requested any context data */
212  {
213  /* Register the contexts for this filter */
215  if (NT_SUCCESS(Status))
216  {
217  goto Quit;
218  }
219  }
220 
221  /* Check if the caller is registering any callbacks */
223  {
224  /* The callback data comes after the fixed struct */
226  Ptr += (Count * sizeof(FLT_OPERATION_REGISTRATION));
227 
228  /* Tag the operation data onto the end of the filter data */
230 
231  /* walk through the requested callbacks */
232  for (Callbacks = Filter->Operations;
233  Callbacks->MajorFunction != IRP_MJ_OPERATION_END;
234  Callbacks++)
235  {
236  // http://fsfilters.blogspot.co.uk/2011/03/how-file-system-filters-attach-to_17.html
237  /* Check if this is an attach to a volume */
238  if (Callbacks->MajorFunction == IRP_MJ_VOLUME_MOUNT)
239  {
240  Filter->PreVolumeMount = Callbacks->PreOperation;
241  Filter->PostVolumeMount = Callbacks->PostOperation;
242  }
243  else if (Callbacks->MajorFunction == IRP_MJ_SHUTDOWN)
244  {
245  Callbacks->PostOperation = NULL;
246  }
247  }
248  }
249 
250  /* Add the filter name buffer onto the end of the data and fill in the string */
251  Filter->Name.Length = 0;
253  Filter->Name.Buffer = (PWCH)Ptr;
255 
256  /* Lookup the altitude of the mini-filter */
258  if (!NT_SUCCESS(Status))
259  {
260  goto Quit;
261  }
262 
263  /* Lookup the filter frame */
265  if (Status == STATUS_NOT_FOUND)
266  {
267  /* Store the frame this mini-filter's main struct */
268  Filter->Frame = Frame;
269 
271  }
272 
273  if (!NT_SUCCESS(Status))
274  {
275  goto Quit;
276  }
277 
278  //
279  // - Slot the filter into the correct altitude location
280  // - More stuff??
281  //
282 
283  /* Store any existing driver unload routine before we make any changes */
285 
286  /* Check we opted not to have an unload routine, or if we want to stop the driver from being unloaded */
288  {
290  }
291  else
292  {
294  }
295 
296 
297 Quit:
298 
299  if (NT_SUCCESS(Status))
300  {
301  DPRINT1("Loaded FS mini-filter %wZ\n", &DriverObject->DriverExtension->ServiceKeyName);
302  *RetFilter = Filter;
303  }
304  else
305  {
306  DPRINT1("Failed to load FS mini-filter %wZ : 0x%X\n", &DriverObject->DriverExtension->ServiceKeyName, Status);
307 
308  // Add cleanup for context resources
309 
312  }
313 
314  return Status;
315 }
316 
317 VOID
318 FLTAPI
320 {
322  PLIST_ENTRY CurrentEntry;
324 
325  /* Set the draining flag */
327  if (!NT_SUCCESS(Status))
328  {
329  /* Someone already unregistered us, just remove our ref and bail */
331  return;
332  }
333 
334  /* Lock the instance list */
337 
338  /* Set the first entry in the list */
339  CurrentEntry = Filter->InstanceList.rList.Flink;
340 
341  /* Free all instances referenced by the filter */
342  while (CurrentEntry != &Filter->InstanceList.rList)
343  {
344  /* Get the record pointer */
345  Instance = CONTAINING_RECORD(CurrentEntry, FLT_INSTANCE, FilterLink);
346 
347  // FIXME: implement
348  (void)Instance;
349 
350  /* Reset the pointer and move to next entry */
351  Instance = NULL;
352  CurrentEntry = CurrentEntry->Flink;
353  }
354 
355  /* We're done with instances now */
358 
359  /* Remove the reference from the base object */
361 
362  /* Wait until we're sure nothing is using the filter */
364 
365  /* Delete the instance list lock */
367 
368  /* We're finished cleaning up now */
370 
371  /* Hand the memory back */
373 }
374 
375 NTSTATUS
376 NTAPI
378 {
380 
381  /* Grab a ref to the filter */
383  if (NT_SUCCESS(Status))
384  {
385  /* Make sure we aren't already starting up */
387  {
388  // Startup
389  }
390  else
391  {
393  }
394 
396  }
397 
398  return Status;
399 }
400 
401 NTSTATUS
402 NTAPI
405 {
407  UNREFERENCED_PARAMETER(FilterName);
408  *RetFilter = NULL;
409  return STATUS_NOT_IMPLEMENTED;
410 }
411 
412 
413 /* INTERNAL FUNCTIONS ******************************************************/
414 
415 NTSTATUS
417 {
418  /*
419  * Set the draining flag for the filter. This let's us force
420  * a post op callback for minifilters currently awaiting one.
421  */
422  if (InterlockedOr((PLONG)&Object->Flags, FLT_OBFL_DRAINING) & 1)
423  {
424  /* We've been called once, we're already being deleted */
426  }
427 
428  return STATUS_SUCCESS;
429 }
430 
431 VOID
433 {
434  __debugbreak();
435 }
436 
437 
438 NTSTATUS
441  _Inout_ PFLTP_FRAME *Frame)
442 {
445  *Frame = NULL;
446  return STATUS_SUCCESS;
447 }
448 
449 /* PRIVATE FUNCTIONS ******************************************************/
450 
451 static
452 NTSTATUS
454  _Inout_ PUNICODE_STRING AltitudeString)
455 {
456  UNICODE_STRING InstancesKey = RTL_CONSTANT_STRING(L"Instances");
457  UNICODE_STRING DefaultInstance = RTL_CONSTANT_STRING(L"DefaultInstance");
460  UNICODE_STRING FilterInstancePath;
461  ULONG BytesRequired;
462  HANDLE InstHandle = NULL;
463  HANDLE RootHandle;
464  PWCH InstBuffer = NULL;
465  PWCH AltBuffer = NULL;
467 
468  /* Get a handle to the instances key in the filter's services key */
471  &InstancesKey,
472  &RootHandle);
473  if (!NT_SUCCESS(Status))
474  {
475  return Status;
476  }
477 
478  /* Read the size 'default instances' string value */
479  Status = FltpReadRegistryValue(RootHandle,
480  &DefaultInstance,
481  REG_SZ,
482  NULL,
483  0,
484  &BytesRequired);
485 
486  /* We should get a buffer too small error */
488  {
489  /* Allocate the buffer we need to hold the string */
490  InstBuffer = ExAllocatePoolWithTag(PagedPool, BytesRequired, FM_TAG_UNICODE_STRING);
491  if (InstBuffer == NULL)
492  {
494  goto Quit;
495  }
496 
497  /* Now read the string value */
498  Status = FltpReadRegistryValue(RootHandle,
499  &DefaultInstance,
500  REG_SZ,
501  InstBuffer,
502  BytesRequired,
503  &BytesRequired);
504  }
505 
506  if (!NT_SUCCESS(Status))
507  {
508  goto Quit;
509  }
510 
511  /* Convert the string to a unicode_string */
512  RtlInitUnicodeString(&FilterInstancePath, InstBuffer);
513 
514  /* Setup the attributes using the root key handle */
516  &FilterInstancePath,
518  RootHandle,
519  NULL);
520 
521  /* Now open the key name which was stored in the default instance */
522  Status = ZwOpenKey(&InstHandle, KEY_QUERY_VALUE, &ObjectAttributes);
523  if (NT_SUCCESS(Status))
524  {
525  /* Get the size of the buffer that holds the altitude */
526  Status = FltpReadRegistryValue(InstHandle,
527  &Altitude,
528  REG_SZ,
529  NULL,
530  0,
531  &BytesRequired);
533  {
534  /* Allocate the required buffer */
535  AltBuffer = ExAllocatePoolWithTag(PagedPool, BytesRequired, FM_TAG_UNICODE_STRING);
536  if (AltBuffer == NULL)
537  {
539  goto Quit;
540  }
541 
542  /* And now finally read in the actual altitude string */
543  Status = FltpReadRegistryValue(InstHandle,
544  &Altitude,
545  REG_SZ,
546  AltBuffer,
547  BytesRequired,
548  &BytesRequired);
549  if (NT_SUCCESS(Status))
550  {
551  /* We made it, setup the return buffer */
552  AltitudeString->Length = BytesRequired;
553  AltitudeString->MaximumLength = BytesRequired;
554  AltitudeString->Buffer = AltBuffer;
555  }
556  }
557  }
558 
559 Quit:
560  if (!NT_SUCCESS(Status))
561  {
562  if (AltBuffer)
563  {
565  }
566  }
567 
568  if (InstBuffer)
569  {
571  }
572 
573  if (InstHandle)
574  {
575  ZwClose(InstHandle);
576  }
577  ZwClose(RootHandle);
578 
579  return Status;
580 }
581 
582 static
583 NTSTATUS
586  _Out_ PFLTP_FRAME *Frame)
587 {
591 
592  //
593  // Try to find a frame from our existing filter list (see FilterList)
594  // If none exists, create a new frame, add it and return it
595  //
596 
597  *Frame = NULL;
598  return STATUS_SUCCESS;
599 }
FLT_RESOURCE_LIST_HEAD InstanceList
Definition: fltmgrint.h:104
signed char * PCHAR
Definition: retypes.h:7
PVOID PreVolumeMount
Definition: fltmgrint.h:113
#define STATUS_FLT_DELETING_OBJECT
Definition: ntstatus.h:1214
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define IRP_MJ_VOLUME_MOUNT
Definition: fltkernel.h:77
static NTSTATUS GetFilterAltitude(_In_ PFLT_FILTER Filter, _Inout_ PUNICODE_STRING AltitudeString)
Definition: Filter.c:453
struct _FLT_OPERATION_REGISTRATION FLT_OPERATION_REGISTRATION
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
NTSTATUS FltpStartingToDrainObject(_Inout_ PFLT_OBJECT Object)
Definition: Filter.c:416
NTSTATUS FltpRegisterContexts(_In_ PFLT_FILTER Filter, _In_ const FLT_CONTEXT_REGISTRATION *Context)
Definition: Context.c:43
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LIST_ENTRY FilterList
Definition: Filter.c:24
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
FLT_OBJECT Base
Definition: fltmgrint.h:98
CONST FLT_OPERATION_REGISTRATION * OperationRegistration
Definition: fltkernel.h:733
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
USHORT MaximumLength
Definition: env_spec_w32.h:370
NTSTATUS NTAPI FltStartFiltering(_In_ PFLT_FILTER Filter)
Definition: Filter.c:377
#define IRP_MJ_SHUTDOWN
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
PFLT_NORMALIZE_CONTEXT_CLEANUP NormalizeContextCleanup
Definition: fltmgrint.h:117
char CHAR
Definition: xmlstorage.h:175
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
VOID FLTAPI FltObjectDereference(_Inout_ PVOID Object)
Definition: Object.c:53
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS ExInitializeResourceLite(PULONG res)
Definition: env_spec_w32.h:641
NTSTATUS NTAPI ExDeleteResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1456
PFLT_INSTANCE_TEARDOWN_CALLBACK InstanceTeardownStartCallback
Definition: fltkernel.h:737
PFLT_INSTANCE_SETUP_CALLBACK InstanceSetupCallback
Definition: fltkernel.h:735
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define FM_TAG_FILTER
Definition: fltmgr.h:19
PFLT_INSTANCE_TEARDOWN_CALLBACK InstanceTeardownStart
Definition: fltmgrint.h:109
PFLT_NORMALIZE_NAME_COMPONENT NormalizeNameComponentCallback
Definition: fltkernel.h:740
FLT_MUTEX_LIST_HEAD ActiveOpens
Definition: fltmgrint.h:120
#define FLT_MAJOR_VERSION
Definition: fltmgr.h:12
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
PFLT_FILTER_UNLOAD_CALLBACK OldDriverUnload
Definition: fltmgrint.h:119
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
_Must_inspect_result_ _In_ CONST FLT_REGISTRATION _Outptr_ PFLT_FILTER * RetFilter
Definition: fltkernel.h:991
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
DRIVER_UNLOAD * PDRIVER_UNLOAD
Definition: iotypes.h:2145
while(1)
Definition: macro.lex.yy.c:740
LIST_ENTRY mList
Definition: fltmgrint.h:56
PFLT_NORMALIZE_CONTEXT_CLEANUP NormalizeContextCleanupCallback
Definition: fltkernel.h:741
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FM_TAG_UNICODE_STRING
Definition: fltmgr.h:18
EX_RUNDOWN_REF RundownRef
Definition: fltmgrint.h:29
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
PFLT_INSTANCE_QUERY_TEARDOWN_CALLBACK InstanceQueryTeardownCallback
Definition: fltkernel.h:736
PDRIVER_EXTENSION DriverExtension
Definition: iotypes.h:2174
PFLT_INSTANCE_QUERY_TEARDOWN_CALLBACK InstanceQueryTeardown
Definition: fltmgrint.h:108
smooth NULL
Definition: ftsmooth.c:416
#define _Out_
Definition: no_sal2.h:323
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
Definition: bufpool.h:45
PDRIVER_OBJECT DriverObject
Definition: fltmgrint.h:103
NTSYSAPI NTSTATUS NTAPI ZwUnloadDriver(_In_ PUNICODE_STRING DriverServiceName)
VOID FLTAPI FltUnregisterFilter(_In_ PFLT_FILTER Filter)
Definition: Filter.c:319
NTSTATUS FltpReadRegistryValue(_In_ HANDLE KeyHandle, _In_ PUNICODE_STRING ValueName, _In_opt_ ULONG Type, _Out_writes_bytes_(BufferSize) PVOID Buffer, _In_ ULONG BufferSize, _Out_opt_ PULONG BytesRequired)
Definition: Registry.c:67
PFLT_INSTANCE_SETUP_CALLBACK InstanceSetup
Definition: fltmgrint.h:107
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define PCHAR
Definition: match.c:90
#define MAX_KEY_LENGTH
Definition: Filter.c:22
PFLTP_FRAME Frame
Definition: fltmgrint.h:99
_Must_inspect_result_ _Inout_ PFLT_VOLUME _In_ PCUNICODE_STRING Altitude
Definition: fltkernel.h:1172
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
PFLT_GENERATE_FILE_NAME GenerateFileNameCallback
Definition: fltkernel.h:739
#define STATUS_NOT_FOUND
Definition: shellext.h:72
PVOID PostVolumeMount
Definition: fltmgrint.h:114
const struct winhelp_callbacks Callbacks
Definition: callback.c:161
if(!(yy_init))
Definition: macro.lex.yy.c:714
NTSTATUS FltpOpenFilterServicesKey(_In_ PFLT_FILTER Filter, _In_ ACCESS_MASK DesiredAccess, _In_opt_ PUNICODE_STRING SubKey, _Out_ PHANDLE Handle)
Definition: Registry.c:28
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SERVICES_KEY
Definition: Filter.c:21
_Must_inspect_result_ _In_ CONST FLT_REGISTRATION * Registration
Definition: fltkernel.h:991
struct _FLT_OPERATION_REGISTRATION * PFLT_OPERATION_REGISTRATION
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
PFLT_FILTER_UNLOAD_CALLBACK FilterUnloadCallback
Definition: fltkernel.h:734
NTSTATUS FltpAttachFrame(_In_ PUNICODE_STRING Altitude, _Inout_ PFLTP_FRAME *Frame)
Definition: Filter.c:439
PFLT_OPERATION_REGISTRATION Operations
Definition: fltmgrint.h:118
#define _Inout_
Definition: no_sal2.h:244
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
static IUnknown Object
Definition: main.c:512
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
WCHAR * PWCH
Definition: ntbasedef.h:417
static const WCHAR L[]
Definition: oid.c:1250
PDRIVER_UNLOAD DriverUnload
Definition: iotypes.h:2180
VOID FltpExInitializeRundownProtection(_Out_ PEX_RUNDOWN_REF RundownRef)
Definition: Object.c:212
#define KeEnterCriticalRegion()
Definition: ke_x.h:83
#define InterlockedOr
Definition: interlocked.h:224
ULONG PointerCount
Definition: fltmgrint.h:28
Definition: typedefs.h:117
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
PFLT_INSTANCE_TEARDOWN_CALLBACK InstanceTeardownCompleteCallback
Definition: fltkernel.h:738
NTSTATUS(FLTAPI * PFLT_FILTER_UNLOAD_CALLBACK)(FLT_FILTER_UNLOAD_FLAGS Flags)
Definition: fltkernel.h:654
volatile FLT_OBJECT_FLAGS Flags
Definition: fltmgrint.h:27
PFLT_FILTER_UNLOAD_CALLBACK FilterUnload
Definition: fltmgrint.h:106
Status
Definition: gdiplustypes.h:24
#define _In_
Definition: no_sal2.h:204
VOID FltpMiniFilterDriverUnload()
Definition: Filter.c:432
UNICODE_STRING Name
Definition: fltmgrint.h:100
UNICODE_STRING ServiceKeyName
Definition: iotypes.h:2114
#define KeLeaveCriticalRegion()
Definition: ke_x.h:114
NTSTATUS NTAPI FltGetFilterFromName(_In_ PCUNICODE_STRING FilterName, _Out_ PFLT_FILTER *RetFilter)
Definition: Filter.c:403
PFLT_NORMALIZE_NAME_COMPONENT NormalizeNameComponent
Definition: fltmgrint.h:116
BOOLEAN FltpExRundownCompleted(_Inout_ PEX_RUNDOWN_REF RundownRef)
Definition: Object.c:231
NTSTATUS FLTAPI FltObjectReference(_Inout_ PVOID Object)
Definition: Object.c:41
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
FLT_FILTER_FLAGS Flags
Definition: fltmgrint.h:102
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
static NTSTATUS GetFilterFrame(_In_ PFLT_FILTER Filter, _In_ PUNICODE_STRING Altitude, _Out_ PFLTP_FRAME *Frame)
Definition: Filter.c:584
NTSTATUS NTAPI FltpObjectRundownWait(_Inout_ PEX_RUNDOWN_REF RundownRef)
Definition: Object.c:238
IN PVOID Instance
Definition: pci.h:359
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
#define DPRINT1
Definition: precomp.h:8
CONST FLT_CONTEXT_REGISTRATION * ContextRegistration
Definition: fltkernel.h:732
FAST_MUTEX mLock
Definition: fltmgrint.h:55
NTSTATUS NTAPI FltRegisterFilter(_In_ PDRIVER_OBJECT DriverObject, _In_ const FLT_REGISTRATION *Registration, _Out_ PFLT_FILTER *RetFilter)
Definition: Filter.c:112
ULONG ERESOURCE
Definition: env_spec_w32.h:594
unsigned int ULONG
Definition: retypes.h:1
FLT_MUTEX_LIST_HEAD PortList
Definition: fltmgrint.h:122
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define UNIMPLEMENTED
Definition: debug.h:114
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define FLTFL_REGISTRATION_DO_NOT_SUPPORT_SERVICE_STOP
Definition: fltkernel.h:725
PFLT_GENERATE_FILE_NAME GenerateFileName
Definition: fltmgrint.h:115
return STATUS_SUCCESS
Definition: btrfs.c:2938
signed int * PLONG
Definition: retypes.h:5
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
PFLT_INSTANCE_TEARDOWN_CALLBACK InstanceTeardownComplete
Definition: fltmgrint.h:110
UNICODE_STRING DefaultAltitude
Definition: fltmgrint.h:101
struct _FLT_FILTER FLT_FILTER
NTSTATUS NTAPI FltUnloadFilter(_In_ PCUNICODE_STRING FilterName)
Definition: Filter.c:86
ERESOURCE FilterListLock
Definition: Filter.c:25
NTSTATUS NTAPI FltLoadFilter(_In_ PCUNICODE_STRING FilterName)
Definition: Filter.c:62
FLT_MUTEX_LIST_HEAD ConnectionList
Definition: fltmgrint.h:121
#define IRP_MJ_OPERATION_END
Definition: fltkernel.h:79
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
#define REG_SZ
Definition: layer.c:22