ReactOS 0.4.15-dev-8241-g63935f8
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
24typedef struct _FILTER_DATA
25{
30
32
33
34/* Prototypes */
35DRIVER_INITIALIZE DriverEntry;
36
37/* Globals */
44
49
51FLTAPI
54);
55
57FLTAPI
59 _In_ PCFLT_RELATED_OBJECTS FltObjects,
61 _In_ DEVICE_TYPE VolumeDeviceType,
62 _In_ FLT_FILESYSTEM_TYPE VolumeFilesystemType
63);
64
66FLTAPI
68 _In_ PCFLT_RELATED_OBJECTS FltObjects,
70);
71
73FLTAPI
76 _In_ PCFLT_RELATED_OBJECTS FltObjects,
78);
79
81FLTAPI
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
129NTAPI
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 {
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
247cleanup:
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
272FLTAPI
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
327FLTAPI
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),
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,
383 ReportedSectorSize,
384 &VolumeName);
385
386 Status = TestInstanceSetup(FltObjects,
387 Flags,
388 VolumeDeviceType,
389 VolumeFilesystemType,
390 &VolumeName,
392 ReportedSectorSize);
393
394 /* The buffer was allocated by the IoMgr */
396 }
397 }
398 }
399
400 return Status;
401}
402
403
418FLTAPI
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
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
486 _In_ PFLT_CONTEXT_REGISTRATION ContextRegistration,
488{
489 UNREFERENCED_PARAMETER(ContextRegistration);
493}
494
500 _In_ LONG MaxClientConnections)
501{
505 MaxConnections = MaxClientConnections;
506
507 return STATUS_SUCCESS;
508}
509
510
511/* Private Routines ******************************************/
512
514FLTAPI
517 _In_ PCFLT_RELATED_OBJECTS FltObjects,
519{
522 ULONG i;
523
525 MajorFunction = Data->Iopb->MajorFunction;
526
527 for (i = 0; i < CallbacksCount; i++)
528 {
530 {
531 // Call their pre-callback
533 FltObjects,
535 }
536 }
537
538 return Status;
539}
540
542FLTAPI
545 _In_ PCFLT_RELATED_OBJECTS FltObjects,
548{
551 ULONG i;
552
554 MajorFunction = Data->Iopb->MajorFunction;
555
556 for (i = 0; i < CallbacksCount; i++)
557 {
559 {
560 // Call their post-callback
562 FltObjects,
564 Flags);
565 }
566 }
567
568 return Status;
569}
#define PAGED_CODE()
NTSTATUS NTAPI FltStartFiltering(_In_ PFLT_FILTER Filter)
Definition: Filter.c:377
VOID FLTAPI FltUnregisterFilter(_In_ PFLT_FILTER Filter)
Definition: Filter.c:319
NTSTATUS NTAPI FltRegisterFilter(_In_ PDRIVER_OBJECT DriverObject, _In_ const FLT_REGISTRATION *Registration, _Out_ PFLT_FILTER *RetFilter)
Definition: Filter.c:112
NTSTATUS FLTAPI FltBuildDefaultSecurityDescriptor(_Outptr_ PSECURITY_DESCRIPTOR *SecurityDescriptor, _In_ ACCESS_MASK DesiredAccess)
Definition: Misc.c:27
VOID FLTAPI FltFreeSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor)
Definition: Misc.c:39
NTSTATUS FLTAPI FltGetDiskDeviceObject(_In_ PFLT_VOLUME Volume, _Outptr_ PDEVICE_OBJECT *DiskDeviceObject)
Definition: Misc.c:48
static void TestEntry(const ENTRY *pEntry)
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
static OBJECT_ATTRIBUTES KmtestFileObject
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define DEVICE_TYPE
Definition: guid.c:10
static void cleanup(void)
Definition: main.c:1335
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
Definition: string_lib.cpp:62
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define NonPagedPool
Definition: env_spec_w32.h:307
_Must_inspect_result_ _Inout_opt_ PUNICODE_STRING VolumeName
Definition: fltkernel.h:1117
struct _FLT_REGISTRATION FLT_REGISTRATION
enum _FLT_POSTOP_CALLBACK_STATUS FLT_POSTOP_CALLBACK_STATUS
struct _FLT_VOLUME_PROPERTIES * PFLT_VOLUME_PROPERTIES
ULONG FLT_INSTANCE_SETUP_FLAGS
Definition: fltkernel.h:527
#define FLT_MGR_LONGHORN
Definition: fltkernel.h:39
ULONG FLT_FILTER_UNLOAD_FLAGS
Definition: fltkernel.h:649
VOID(FLTAPI * PFLT_DISCONNECT_NOTIFY)(_In_opt_ PVOID ConnectionCookie)
Definition: fltkernel.h:856
enum _FLT_PREOP_CALLBACK_STATUS FLT_PREOP_CALLBACK_STATUS
@ FLT_PREOP_SUCCESS_NO_CALLBACK
Definition: fltkernel.h:574
@ FLT_POSTOP_FINISHED_PROCESSING
Definition: fltkernel.h:588
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ FILE_INFORMATION_CLASS _Out_opt_ PULONG LengthReturned
Definition: fltkernel.h:1308
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
_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:1877
#define FLT_PORT_ALL_ACCESS
Definition: fltkernel.h:836
#define FLT_REGISTRATION_VERSION
Definition: fltkernel.h:718
struct _FLT_PORT * PFLT_PORT
Definition: fltkernel.h:87
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
ULONG FLT_INSTANCE_QUERY_TEARDOWN_FLAGS
Definition: fltkernel.h:552
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY ConnectNotifyCallback
Definition: fltkernel.h:1875
#define IRP_MJ_OPERATION_END
Definition: fltkernel.h:79
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY DisconnectNotifyCallback
Definition: fltkernel.h:1876
ULONG FLT_POST_OPERATION_FLAGS
Definition: fltkernel.h:592
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49
struct _FLT_VOLUME_PROPERTIES FLT_VOLUME_PROPERTIES
VOID TestQueryTeardown(_In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ FLT_INSTANCE_QUERY_TEARDOWN_FLAGS Flags)
Definition: fltmgr_create.c:92
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)
VOID TestFilterUnload(IN ULONG Flags)
Definition: fltmgr_create.c:79
Status
Definition: gdiplustypes.h:25
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
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define KMTEST_DEVICE_DRIVER_PATH
Definition: kmt_public.h:34
PKMT_RESULTBUFFER ResultBuffer
BOOLEAN KmtIsCheckedBuild
BOOLEAN KmtIsMultiProcessorBuild
static PFLT_CONTEXT_REGISTRATION Contexts
static PDEVICE_OBJECT KmtestDeviceObject
NTSTATUS FLTAPI FilterInstanceSetup(_In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ FLT_INSTANCE_SETUP_FLAGS Flags, _In_ DEVICE_TYPE VolumeDeviceType, _In_ FLT_FILESYSTEM_TYPE VolumeFilesystemType)
static PFLT_DISCONNECT_NOTIFY FilterDisconnect
FLT_PREOP_CALLBACK_STATUS FLTAPI FilterPreOperation(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _Outptr_result_maybenull_ PVOID *CompletionContext)
NTSTATUS KmtFilterRegisterCallbacks(_In_ CONST FLT_OPERATION_REGISTRATION *OperationRegistration)
static PFLT_MESSAGE_NOTIFY FilterMessage
NTSTATUS KmtFilterRegisterContexts(_In_ PFLT_CONTEXT_REGISTRATION ContextRegistration, _In_ PVOID Callback)
DRIVER_INITIALIZE DriverEntry
struct _FILTER_DATA * PFILTER_DATA
FLT_REGISTRATION FilterRegistration
static LONG MaxConnections
static PFLT_OPERATION_REGISTRATION Callbacks
static PFLT_CONNECT_NOTIFY FilterConnect
struct _FILTER_DATA FILTER_DATA
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)
NTSTATUS FLTAPI FilterQueryTeardown(_In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ FLT_INSTANCE_QUERY_TEARDOWN_FLAGS Flags)
static FILTER_DATA FilterData
NTSTATUS KmtFilterRegisterComms(_In_ PFLT_CONNECT_NOTIFY ConnectNotifyCallback, _In_ PFLT_DISCONNECT_NOTIFY DisconnectNotifyCallback, _In_opt_ PFLT_MESSAGE_NOTIFY MessageNotifyCallback, _In_ LONG MaxClientConnections)
#define KMTEST_FILTER_POOL_TAG
NTSTATUS FLTAPI FilterUnload(_In_ FLT_FILTER_UNLOAD_FLAGS Flags)
static PDRIVER_OBJECT TestDriverObject
static ULONG CallbacksCount
UNICODE_STRING Volume
Definition: fltkernel.h:1172
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define _Inout_
Definition: ms_sal.h:378
#define _Outptr_result_maybenull_
Definition: ms_sal.h:428
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define KernelMode
Definition: asm.h:34
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1161
#define PRCB_BUILD_UNIPROCESSOR
Definition: ketypes.h:324
#define PRCB_BUILD_DEBUG
Definition: ketypes.h:323
int Count
Definition: noreturn.cpp:7
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define FILE_ALL_ACCESS
Definition: nt_native.h:651
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
NTSTATUS NTAPI IoGetDeviceObjectPointer(IN PUNICODE_STRING ObjectName, IN ACCESS_MASK DesiredAccess, OUT PFILE_OBJECT *FileObject, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1435
NTSTATUS NTAPI IoVolumeDeviceToDosName(IN PVOID VolumeDeviceObject, OUT PUNICODE_STRING DosName)
Definition: volume.c:1279
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
#define STATUS_ALREADY_REGISTERED
Definition: ntstatus.h:1126
#define L(x)
Definition: ntvdm.h:50
NTSTATUS NTAPI ObReferenceObjectByPointer(IN PVOID Object, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode)
Definition: obref.c:381
#define CONST
Definition: pedump.c:81
long LONG
Definition: pedump.c:60
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
PVOID DeviceExtension
Definition: env_spec_w32.h:418
FLT_REGISTRATION FilterRegistration
PFLT_PORT ServerPort
PDRIVER_OBJECT DriverObject
PFLT_FILTER Filter
PFLT_PRE_OPERATION_CALLBACK PreOperation
Definition: fltkernel.h:612
PFLT_POST_OPERATION_CALLBACK PostOperation
Definition: fltkernel.h:613
FLT_OPERATION_REGISTRATION_FLAGS Flags
Definition: fltkernel.h:611
UCHAR BuildType
Definition: ketypes.h:683
#define max(a, b)
Definition: svc.c:63
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define NTAPI
Definition: typedefs.h:36
int32_t INT
Definition: typedefs.h:58
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ UCHAR MajorFunction
Definition: wdfdevice.h:1697
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE _In_opt_ __drv_aliasesMem WDFCONTEXT CompletionContext
Definition: wdfrequest.h:898
_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:191
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ ULONG SectorSize
Definition: halfuncs.h:291
* PFILE_OBJECT
Definition: iotypes.h:1998
#define IRP_MJ_MAXIMUM_FUNCTION
#define ObDereferenceObject
Definition: obfuncs.h:203
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180