ReactOS  0.4.13-dev-1148-g9b75b67
fltmgr_create.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS kernel-mode tests - Filter Manager
3  * LICENSE: GPLv2+ - See COPYING in the top level directory
4  * PURPOSE: Tests for checking the create operations
5  * PROGRAMMER: Ged Murphy <gedmurphy@reactos.org>
6  */
7 
8 #include <kmt_test.h>
9 #include <fltkernel.h>
10 
11 //#define NDEBUG
12 #include <debug.h>
13 
14 /* prototypes */
15 static
17 FLTAPI
20  _In_ PCFLT_RELATED_OBJECTS FltObjects,
22 );
23 
24 static
26 FLTAPI
29  _In_ PCFLT_RELATED_OBJECTS FltObjects,
32 );
33 
34 
35 /* Globals */
37 
38 
40 {
41  { IRP_MJ_CREATE,
42  0,
45 
47 };
48 
49 
55  IN OUT INT *Flags)
56 {
58 
59  PAGED_CODE();
60 
63 
64  DPRINT("Entry!\n");
65 
66  ok_irql(PASSIVE_LEVEL);
68 
69  *DeviceName = L"fltmgr_create";
70 
71  trace("Hi, this is the filter manager create test driver\n");
72 
74 
75  return Status;
76 }
77 
78 VOID
80  IN ULONG Flags)
81 {
82  PAGED_CODE();
83 
84  DPRINT("Unload!\n");
85 
86  ok_irql(PASSIVE_LEVEL);
87 
88  trace("Unloading filter manager test driver\n");
89 }
90 
91 VOID
93  _In_ PCFLT_RELATED_OBJECTS FltObjects,
95 {
96  UNREFERENCED_PARAMETER(FltObjects);
98 }
99 
100 NTSTATUS
102  _In_ PCFLT_RELATED_OBJECTS FltObjects,
104  _In_ DEVICE_TYPE VolumeDeviceType,
105  _In_ FLT_FILESYSTEM_TYPE VolumeFilesystemType,
108  _In_ ULONG ReportedSectorSize
109 )
110 {
111  trace("Received an attach request for VolumeType 0x%X, FileSystemType %d\n",
112  VolumeDeviceType,
113  VolumeFilesystemType);
114 
116 }
117 
118 static
120 FLTAPI
123  _In_ PCFLT_RELATED_OBJECTS FltObjects,
125 {
126  PFLT_IO_PARAMETER_BLOCK Iopb = Data->Iopb;
127 
129 
131 }
132 
133 static
135 FLTAPI
138  _In_ PCFLT_RELATED_OBJECTS FltObjects,
141 {
142  PFLT_IO_PARAMETER_BLOCK Iopb = Data->Iopb;
143 
145 
147 }
static FLT_PREOP_CALLBACK_STATUS FLTAPI TestFilterPreOperation(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _Outptr_result_maybenull_ PVOID *CompletionContext)
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define IN
Definition: typedefs.h:38
ULONG FLT_INSTANCE_QUERY_TEARDOWN_FLAGS
Definition: fltkernel.h:552
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
enum _FLT_POSTOP_CALLBACK_STATUS FLT_POSTOP_CALLBACK_STATUS
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS KmtFilterRegisterCallbacks(_In_ CONST FLT_OPERATION_REGISTRATION *OperationRegistration)
WCHAR DeviceName[]
Definition: adapter.cpp:21
int32_t INT
Definition: typedefs.h:56
#define PAGED_CODE()
Definition: video.h:57
#define _In_opt_
Definition: no_sal2.h:213
NTSTATUS TestEntry(IN PDRIVER_OBJECT DriverObject, IN PCUNICODE_STRING RegistryPath, OUT PCWSTR *DeviceName, IN OUT INT *Flags)
Definition: fltmgr_create.c:51
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
enum _FLT_PREOP_CALLBACK_STATUS FLT_PREOP_CALLBACK_STATUS
ULONG FLT_POST_OPERATION_FLAGS
Definition: fltkernel.h:592
_Unreferenced_parameter_ PVOID * CompletionContext
Definition: cdprocs.h:1130
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
void DPRINT(...)
Definition: polytest.cpp:61
#define trace
Definition: atltest.h:70
#define STATUS_FLT_DO_NOT_ATTACH
Definition: ntstatus.h:1218
#define _Outptr_result_maybenull_
Definition: no_sal2.h:426
#define _Inout_
Definition: no_sal2.h:244
VOID TestFilterUnload(IN ULONG Flags)
Definition: fltmgr_create.c:79
static const WCHAR L[]
Definition: oid.c:1250
VOID TestQueryTeardown(_In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ FLT_INSTANCE_QUERY_TEARDOWN_FLAGS Flags)
Definition: fltmgr_create.c:92
#define VOID
Definition: acefi.h:82
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
static FLT_POSTOP_CALLBACK_STATUS FLTAPI TestFilterPostOperation(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _In_opt_ PVOID CompletionContext, _In_ FLT_POST_OPERATION_FLAGS Flags)
Status
Definition: gdiplustypes.h:24
#define _In_
Definition: no_sal2.h:204
ULONG FLT_INSTANCE_SETUP_FLAGS
Definition: fltkernel.h:527
#define DEVICE_TYPE
Definition: guid.c:10
static PDRIVER_OBJECT TestDriverObject
Definition: fltmgr_create.c:36
_Must_inspect_result_ _Inout_opt_ PUNICODE_STRING VolumeName
Definition: fltkernel.h:1117
CONST FLT_OPERATION_REGISTRATION Callbacks[]
Definition: fltmgr_create.c:39
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
#define ok_eq_hex(value, expected)
_In_ ULONG SectorSize
Definition: halfuncs.h:291
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define CONST
Definition: pedump.c:81
#define IRP_MJ_OPERATION_END
Definition: fltkernel.h:79
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)