ReactOS  0.4.14-dev-57-g333b8f1
kmtest_fsminifilter.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS kernel-mode tests - Filter Manager
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE: FS Mini-filter wrapper to host the filter manager tests
5  * COPYRIGHT: Copyright 2017 Thomas Faber <thomas.faber@reactos.org>
6  * Copyright 2017 Ged Murphy <ged.murphy@reactos.org>
7  */
8 
9 #include <ntifs.h>
10 #include <ndk/ketypes.h>
11 #include <fltkernel.h>
12 
13 #define KMT_DEFINE_TEST_FUNCTIONS
14 #include <kmt_test.h>
15 
16 #define NDEBUG
17 #include <debug.h>
18 
19 #include <kmt_public.h>
20 
21 #define KMTEST_FILTER_POOL_TAG 'fTMK'
22 
23 
24 typedef struct _FILTER_DATA
25 {
30 
32 
33 
34 /* Prototypes */
35 DRIVER_INITIALIZE DriverEntry;
36 
37 /* Globals */
42 static ULONG CallbacksCount = 0;
44 
48 static LONG MaxConnections = 0;
49 
51 FLTAPI
54 );
55 
57 FLTAPI
59  _In_ PCFLT_RELATED_OBJECTS FltObjects,
61  _In_ DEVICE_TYPE VolumeDeviceType,
62  _In_ FLT_FILESYSTEM_TYPE VolumeFilesystemType
63 );
64 
66 FLTAPI
68  _In_ PCFLT_RELATED_OBJECTS FltObjects,
70 );
71 
73 FLTAPI
76  _In_ PCFLT_RELATED_OBJECTS FltObjects,
78 );
79 
81 FLTAPI
84  _In_ PCFLT_RELATED_OBJECTS FltObjects,
87 );
88 
89 
90 
92 {
93  sizeof(FLT_REGISTRATION), // Size
94  FLT_REGISTRATION_VERSION, // Version
95  0, // Flags
96  NULL, // ContextRegistration
97  NULL, // OperationRegistration
98  FilterUnload, // FilterUnloadCallback
99  FilterInstanceSetup, // InstanceSetupCallback
100  FilterQueryTeardown, // InstanceQueryTeardownCallback
101  NULL, // InstanceTeardownStartCallback
102  NULL, // InstanceTeardownCompleteCallback
103  NULL, // AmFilterGenerateFileNameCallback
104  NULL, // AmFilterNormalizeNameComponentCallback
105  NULL, // NormalizeContextCleanupCallback
107  NULL, // TransactionNotificationCallback
108  NULL, // AmFilterNormalizeNameComponentExCallback
109 #endif
110 };
111 
112 
113 
114 /* Filter Interface Routines ****************************/
115 
128 NTSTATUS
129 NTAPI
133 {
138  WCHAR DeviceNameBuffer[128] = L"\\Device\\Kmtest-";
139  UNICODE_STRING KmtestDeviceName;
141  PKMT_DEVICE_EXTENSION KmtestDeviceExtension;
142  PCWSTR DeviceNameSuffix;
143  INT Flags = 0;
144  PKPRCB Prcb;
145 
146  PAGED_CODE();
147  //__debugbreak();
148  DPRINT("DriverEntry\n");
149 
151 
152  Prcb = KeGetCurrentPrcb();
156 
157  /* get the Kmtest device, so that we get a ResultBuffer pointer */
160 
161  if (!NT_SUCCESS(Status))
162  {
163  DPRINT1("Failed to get Kmtest device object pointer\n");
164  goto cleanup;
165  }
166 
168 
169  if (!NT_SUCCESS(Status))
170  {
171  DPRINT1("Failed to reference Kmtest device object\n");
172  goto cleanup;
173  }
174 
177  KmtestDeviceExtension = KmtestDeviceObject->DeviceExtension;
178  ResultBuffer = KmtestDeviceExtension->ResultBuffer;
179  DPRINT("KmtestDeviceObject: %p\n", (PVOID)KmtestDeviceObject);
180  DPRINT("KmtestDeviceExtension: %p\n", (PVOID)KmtestDeviceExtension);
181  DPRINT("Setting ResultBuffer: %p\n", (PVOID)ResultBuffer);
182 
183 
184  /* call TestEntry */
185  RtlInitUnicodeString(&DeviceName, DeviceNameBuffer);
186  DeviceName.MaximumLength = sizeof DeviceNameBuffer;
187  TestEntry(DriverObject, RegistryPath, &DeviceNameSuffix, &Flags);
188 
189  RtlAppendUnicodeToString(&DeviceName, DeviceNameSuffix);
190 
191  /* Register with the filter manager */
192  if (!(Flags & TESTENTRY_NO_REGISTER_FILTER))
193  {
196  &FilterData.Filter);
197  if (!NT_SUCCESS(Status))
198  {
199  DPRINT1("Failed to register the filter driver %wZ\n", &DeviceName);
200  goto cleanup;
201  }
202  }
203 
204  if (!(Flags & TESTENTRY_NO_CREATE_COMMS_PORT))
205  {
206  /* Create a security descriptor */
209  if (!NT_SUCCESS(Status))
210  {
211  goto cleanup;
212  }
213 
214  /* Initialize the security descriptor object */
216  &DeviceName,
218  NULL,
220 
221 
222  /* Create the usermode communication port */
223  Status = FltCreateCommunicationPort(FilterData.Filter,
226  NULL,
231 
232  /* Free the security descriptor */
234 
235  if (!NT_SUCCESS(Status))
236  {
237  goto cleanup;
238  }
239  }
240 
241  if (!(Flags & TESTENTRY_NO_START_FILTERING))
242  {
243  /* Start filtering the requests */
245  }
246 
247 cleanup:
248  if (!NT_SUCCESS(Status))
249  {
251  {
252  FltCloseCommunicationPort(FilterData.ServerPort);
253  }
254  if (FilterData.Filter)
255  {
257  }
258  }
259 
260  return Status;
261 }
262 
271 NTSTATUS
272 FLTAPI
275 {
276  PAGED_CODE();
278  //__debugbreak();
279 
280  DPRINT("DriverUnload\n");
281 
283 
284  /* Close the port and unregister the filter */
286  {
287  FltCloseCommunicationPort(FilterData.ServerPort);
289  }
290  if (FilterData.Filter)
291  {
294  }
295 
296  if (Callbacks)
297  {
299  Callbacks = NULL;
300  CallbacksCount = 0;
301  }
302 
303  return STATUS_SUCCESS;
304 }
305 
306 
326 NTSTATUS
327 FLTAPI
329  _In_ PCFLT_RELATED_OBJECTS FltObjects,
331  _In_ DEVICE_TYPE VolumeDeviceType,
332  _In_ FLT_FILESYSTEM_TYPE VolumeFilesystemType)
333 {
334 #if 0
335  UCHAR VolPropBuffer[sizeof(FLT_VOLUME_PROPERTIES) + 512];
336  PFLT_VOLUME_PROPERTIES VolumeProperties = (PFLT_VOLUME_PROPERTIES)VolPropBuffer;
337 #endif
340  ULONG ReportedSectorSize = 0;
341  ULONG SectorSize = 0;
343 
344  PAGED_CODE();
345 
346  UNREFERENCED_PARAMETER(FltObjects);
348 
349  if (!(Flags & TESTENTRY_NO_INSTANCE_SETUP))
350  {
352 
353 #if 0 // FltGetVolumeProperties is not yet implemented
354  /* Get the properties of this volume */
356  VolumeProperties,
357  sizeof(VolPropBuffer),
358  &LengthReturned);
359  if (NT_SUCCESS(Status))
360  {
361  FLT_ASSERT((VolumeProperties->SectorSize == 0) || (VolumeProperties->SectorSize >= MIN_SECTOR_SIZE));
362  SectorSize = max(VolumeProperties->SectorSize, MIN_SECTOR_SIZE);
363  ReportedSectorSize = VolumeProperties->SectorSize;
364  }
365  else
366  {
367  DPRINT1("Failed to get the volume properties : 0x%X", Status);
368  return Status;
369  }
370 #endif
371  /* Get the storage device object we want a name for */
372  Status = FltGetDiskDeviceObject(FltObjects->Volume, &DeviceObject);
373  if (NT_SUCCESS(Status))
374  {
375  /* Get the dos device name */
377  if (NT_SUCCESS(Status))
378  {
379  DPRINT("VolumeDeviceType %lu, VolumeFilesystemType %lu, Real SectSize=0x%04x, Reported SectSize=0x%04x, Name=\"%wZ\"",
380  VolumeDeviceType,
381  VolumeFilesystemType,
382  SectorSize,
383  ReportedSectorSize,
384  &VolumeName);
385 
386  Status = TestInstanceSetup(FltObjects,
387  Flags,
388  VolumeDeviceType,
389  VolumeFilesystemType,
390  &VolumeName,
391  SectorSize,
392  ReportedSectorSize);
393 
394  /* The buffer was allocated by the IoMgr */
396  }
397  }
398  }
399 
400  return Status;
401 }
402 
403 
417 NTSTATUS
418 FLTAPI
420  _In_ PCFLT_RELATED_OBJECTS FltObjects,
422 {
423  PAGED_CODE();
424 
425  if (!(Flags & TESTENTRY_NO_QUERY_TEARDOWN))
426  {
427  TestQueryTeardown(FltObjects, Flags);
428  }
429 
430  /* We always allow a volume to detach */
431  return STATUS_SUCCESS;
432 }
433 
434 
435 /* Public Routines **************************************/
436 
437 NTSTATUS
439  _In_ CONST FLT_OPERATION_REGISTRATION *OperationRegistration)
440 {
441  ULONG Count = 0;
442  ULONG i;
443 
444  if (Callbacks)
445  {
447  }
448 
449  /* Count how many IRPs being registered */
450  for (i = 0; i < IRP_MJ_MAXIMUM_FUNCTION; i++)
451  {
452  if (OperationRegistration[i].MajorFunction == IRP_MJ_OPERATION_END)
453  break;
454  Count++;
455  }
456 
457  /* Allocate enough pool to hold a copy of the array */
459  sizeof(FLT_OPERATION_REGISTRATION) * (Count + 1),
461  if (Callbacks == NULL)
462  {
464  }
465 
466  /* Copy the array, but using our own pre/post callbacks */
467  for (i = 0; i < Count; i++)
468  {
469  Callbacks[i].MajorFunction = OperationRegistration[i].MajorFunction;
470  Callbacks[i].Flags = OperationRegistration[i].Flags;
473  }
474 
475  /* Terminate the array */
477 
478  /* Save the count of IRPs, not counting IRP_MJ_OPERATION_END last entry */
480 
481  return STATUS_SUCCESS;
482 }
483 
484 NTSTATUS
486  _In_ PFLT_CONTEXT_REGISTRATION ContextRegistration,
488 {
489  UNREFERENCED_PARAMETER(ContextRegistration);
492  return STATUS_NOT_IMPLEMENTED;
493 }
494 
495 NTSTATUS
500  _In_ LONG MaxClientConnections)
501 {
505  MaxConnections = MaxClientConnections;
506 
507  return STATUS_SUCCESS;
508 }
509 
510 
511 /* Private Routines ******************************************/
512 
514 FLTAPI
517  _In_ PCFLT_RELATED_OBJECTS FltObjects,
519 {
521  UCHAR MajorFunction;
522  ULONG i;
523 
525  MajorFunction = Data->Iopb->MajorFunction;
526 
527  for (i = 0; i < CallbacksCount; i++)
528  {
529  if (MajorFunction == Callbacks[i].MajorFunction)
530  {
531  // Call their pre-callback
533  FltObjects,
535  }
536  }
537 
538  return Status;
539 }
540 
542 FLTAPI
545  _In_ PCFLT_RELATED_OBJECTS FltObjects,
548 {
550  UCHAR MajorFunction;
551  ULONG i;
552 
554  MajorFunction = Data->Iopb->MajorFunction;
555 
556  for (i = 0; i < CallbacksCount; i++)
557  {
558  if (MajorFunction == Callbacks[i].MajorFunction)
559  {
560  // Call their post-callback
562  FltObjects,
564  Flags);
565  }
566  }
567 
568  return Status;
569 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define IN
Definition: typedefs.h:38
#define FLT_PORT_ALL_ACCESS
Definition: fltkernel.h:836
#define max(a, b)
Definition: svc.c:63
NTSTATUS FLTAPI FilterInstanceSetup(_In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ FLT_INSTANCE_SETUP_FLAGS Flags, _In_ DEVICE_TYPE VolumeDeviceType, _In_ FLT_FILESYSTEM_TYPE VolumeFilesystemType)
ULONG FLT_INSTANCE_QUERY_TEARDOWN_FLAGS
Definition: fltkernel.h:552
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define FILE_ALL_ACCESS
Definition: nt_native.h:651
PFLT_PORT ServerPort
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
enum _FLT_POSTOP_CALLBACK_STATUS FLT_POSTOP_CALLBACK_STATUS
NTSTATUS NTAPI FltStartFiltering(_In_ PFLT_FILTER Filter)
Definition: Filter.c:377
NTSTATUS FLTAPI FltBuildDefaultSecurityDescriptor(_Outptr_ PSECURITY_DESCRIPTOR *SecurityDescriptor, _In_ ACCESS_MASK DesiredAccess)
Definition: Misc.c:27
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
#define IRP_MJ_MAXIMUM_FUNCTION
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS KmtFilterRegisterCallbacks(_In_ CONST FLT_OPERATION_REGISTRATION *OperationRegistration)
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1062
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define FLT_MGR_LONGHORN
Definition: fltkernel.h:39
NTSTATUS NTAPI IoGetDeviceObjectPointer(IN PUNICODE_STRING ObjectName, IN ACCESS_MASK DesiredAccess, OUT PFILE_OBJECT *FileObject, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1435
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
#define KMTEST_DEVICE_DRIVER_PATH
Definition: kmt_public.h:34
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define PRCB_BUILD_DEBUG
Definition: ketypes.h:242
int32_t INT
Definition: typedefs.h:56
PFLT_FILTER Filter
FLT_OPERATION_REGISTRATION_FLAGS Flags
Definition: fltkernel.h:611
#define PAGED_CODE()
Definition: video.h:57
#define _In_opt_
Definition: no_sal2.h:213
FLT_REGISTRATION FilterRegistration
NTSTATUS KmtFilterRegisterContexts(_In_ PFLT_CONTEXT_REGISTRATION ContextRegistration, _In_ PVOID Callback)
#define KMTEST_FILTER_POOL_TAG
struct _FLT_PORT * PFLT_PORT
Definition: fltkernel.h:87
struct _FILTER_DATA * PFILTER_DATA
static void TestEntry(const ENTRY *pEntry)
NTSTATUS NTAPI IoVolumeDeviceToDosName(IN PVOID VolumeDeviceObject, OUT PUNICODE_STRING DosName)
Definition: volume.c:1284
BOOLEAN KmtIsCheckedBuild
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
enum _FLT_PREOP_CALLBACK_STATUS FLT_PREOP_CALLBACK_STATUS
ULONG FLT_POST_OPERATION_FLAGS
Definition: fltkernel.h:592
PDRIVER_OBJECT DriverObject
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
PFLT_POST_OPERATION_CALLBACK PostOperation
Definition: fltkernel.h:613
static PFLT_DISCONNECT_NOTIFY FilterDisconnect
long LONG
Definition: pedump.c:60
struct _FLT_VOLUME_PROPERTIES * PFLT_VOLUME_PROPERTIES
_Unreferenced_parameter_ PVOID * CompletionContext
Definition: cdprocs.h:1130
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
FLT_POSTOP_CALLBACK_STATUS FLTAPI FilterPostOperation(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _In_opt_ PVOID CompletionContext, _In_ FLT_POST_OPERATION_FLAGS Flags)
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ FILE_INFORMATION_CLASS _Out_opt_ PULONG LengthReturned
Definition: fltkernel.h:1306
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
BOOLEAN KmtIsMultiProcessorBuild
void DPRINT(...)
Definition: polytest.cpp:61
NTSTATUS NTAPI ObReferenceObjectByPointer(IN PVOID Object, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode)
Definition: obref.c:383
static LONG MaxConnections
VOID FLTAPI FltUnregisterFilter(_In_ PFLT_FILTER Filter)
Definition: Filter.c:319
FLT_PREOP_CALLBACK_STATUS FLTAPI FilterPreOperation(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _Outptr_result_maybenull_ PVOID *CompletionContext)
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
Definition: string_lib.cpp:62
static ULONG CallbacksCount
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY DisconnectNotifyCallback
Definition: fltkernel.h:1873
NTSTATUS KmtFilterRegisterComms(_In_ PFLT_CONNECT_NOTIFY ConnectNotifyCallback, _In_ PFLT_DISCONNECT_NOTIFY DisconnectNotifyCallback, _In_opt_ PFLT_MESSAGE_NOTIFY MessageNotifyCallback, _In_ LONG MaxClientConnections)
#define _Outptr_result_maybenull_
Definition: no_sal2.h:426
NTSTATUS(FLTAPI * PFLT_MESSAGE_NOTIFY)(_In_opt_ PVOID PortCookie, _In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer, _In_ ULONG InputBufferLength, _Out_writes_bytes_to_opt_(OutputBufferLength, *ReturnOutputBufferLength) PVOID OutputBuffer, _In_ ULONG OutputBufferLength, _Out_ PULONG ReturnOutputBufferLength)
Definition: fltkernel.h:839
#define _Inout_
Definition: no_sal2.h:244
NTSTATUS FLTAPI FltGetVolumeProperties(_In_ PFLT_VOLUME Volume, _Out_writes_bytes_to_opt_(VolumePropertiesLength, *LengthReturned) PFLT_VOLUME_PROPERTIES VolumeProperties, _In_ ULONG VolumePropertiesLength, _Out_ PULONG LengthReturned)
Definition: Volume.c:26
* PFILE_OBJECT
Definition: iotypes.h:1955
VOID TestFilterUnload(IN ULONG Flags)
Definition: fltmgr_create.c:79
NTSTATUS FLTAPI FilterQueryTeardown(_In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ FLT_INSTANCE_QUERY_TEARDOWN_FLAGS Flags)
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
static PFLT_CONNECT_NOTIFY FilterConnect
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
unsigned char UCHAR
Definition: xmlstorage.h:181
static PDRIVER_OBJECT TestDriverObject
static const WCHAR L[]
Definition: oid.c:1250
UCHAR BuildType
Definition: ketypes.h:599
VOID TestQueryTeardown(_In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ FLT_INSTANCE_QUERY_TEARDOWN_FLAGS Flags)
Definition: fltmgr_create.c:92
#define STATUS_ALREADY_REGISTERED
Definition: ntstatus.h:951
static PDEVICE_OBJECT KmtestDeviceObject
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY ConnectNotifyCallback
Definition: fltkernel.h:1873
Status
Definition: gdiplustypes.h:24
static PFLT_MESSAGE_NOTIFY FilterMessage
#define _In_
Definition: no_sal2.h:204
NTSTATUS(FLTAPI * PFLT_CONNECT_NOTIFY)(_In_ PFLT_PORT ClientPort, _In_opt_ PVOID ServerPortCookie, _In_reads_bytes_opt_(SizeOfContext) PVOID ConnectionContext, _In_ ULONG SizeOfContext, _Outptr_result_maybenull_ PVOID *ConnectionPortCookie)
Definition: fltkernel.h:848
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
static PFLT_OPERATION_REGISTRATION Callbacks
DRIVER_INITIALIZE DriverEntry
ULONG FLT_INSTANCE_SETUP_FLAGS
Definition: fltkernel.h:527
#define FLT_REGISTRATION_VERSION
Definition: fltkernel.h:718
FLT_REGISTRATION FilterRegistration
#define PRCB_BUILD_UNIPROCESSOR
Definition: ketypes.h:243
struct _FILTER_DATA FILTER_DATA
#define DEVICE_TYPE
Definition: guid.c:10
static FILTER_DATA FilterData
NTSTATUS FLTAPI FilterUnload(_In_ FLT_FILTER_UNLOAD_FLAGS Flags)
struct _FLT_REGISTRATION FLT_REGISTRATION
VOID(FLTAPI * PFLT_DISCONNECT_NOTIFY)(_In_opt_ PVOID ConnectionCookie)
Definition: fltkernel.h:856
#define DPRINT1
Definition: precomp.h:8
VOID FLTAPI FltFreeSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor)
Definition: Misc.c:39
_Must_inspect_result_ _Inout_opt_ PUNICODE_STRING VolumeName
Definition: fltkernel.h:1117
static OBJECT_ATTRIBUTES KmtestFileObject
NTSTATUS NTAPI FltRegisterFilter(_In_ PDRIVER_OBJECT DriverObject, _In_ const FLT_REGISTRATION *Registration, _Out_ PFLT_FILTER *RetFilter)
Definition: Filter.c:112
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
char * cleanup(char *str)
Definition: wpickclick.c:99
NTSTATUS FLTAPI FltGetDiskDeviceObject(_In_ PFLT_VOLUME Volume, _Outptr_ PDEVICE_OBJECT *DiskDeviceObject)
Definition: Misc.c:48
PFLT_PRE_OPERATION_CALLBACK PreOperation
Definition: fltkernel.h:612
static PFLT_CONTEXT_REGISTRATION Contexts
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
_In_ ULONG SectorSize
Definition: halfuncs.h:291
return STATUS_SUCCESS
Definition: btrfs.c:2966
PKMT_RESULTBUFFER ResultBuffer
LPFNPSPCALLBACK Callback
Definition: desk.c:111
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY _In_opt_ PFLT_MESSAGE_NOTIFY MessageNotifyCallback
Definition: fltkernel.h:1873
ULONG FLT_FILTER_UNLOAD_FLAGS
Definition: fltkernel.h:649
struct _FLT_VOLUME_PROPERTIES FLT_VOLUME_PROPERTIES
#define CONST
Definition: pedump.c:81
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define IRP_MJ_OPERATION_END
Definition: fltkernel.h:79
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49
NTSTATUS TestInstanceSetup(_In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ FLT_INSTANCE_SETUP_FLAGS Flags, _In_ DEVICE_TYPE VolumeDeviceType, _In_ FLT_FILESYSTEM_TYPE VolumeFilesystemType, _In_ PUNICODE_STRING VolumeName, _In_ ULONG SectorSize, _In_ ULONG ReportedSectorSize)