ReactOS 0.4.16-dev-125-g798ea90
fltmgr_load.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 filters load correctly
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 */
16FLTAPI
20 _In_reads_bytes_opt_(SizeOfContext) PVOID ConnectionContext,
22 _Outptr_result_maybenull_ PVOID *ConnectionPortCookie
23);
24
25VOID
26FLTAPI
28 _In_opt_ PVOID ConnectionCookie
29);
30
32FLTAPI
34 _In_opt_ PVOID ConnectionCookie,
39 _Out_ PULONG ReturnOutputBufferLength
40);
41
42
43/* Globals */
45
46
47
78 IN OUT INT *Flags)
79{
81
82 PAGED_CODE();
83
86
87 DPRINT("Entry!\n");
88
89 ok_irql(PASSIVE_LEVEL);
91
92 *DeviceName = L"FltMgrLoad";
93
94 trace("Hi, this is the filter manager load test driver\n");
95
97
98 return Status;
99}
100
116VOID
118 IN ULONG Flags)
119{
120 PAGED_CODE();
121
122 DPRINT("Unload!\n");
123
124 ok_irql(PASSIVE_LEVEL);
125
126 trace("Unloading filter manager load test driver\n");
127}
128
129
160 _In_ PCFLT_RELATED_OBJECTS FltObjects,
162 _In_ DEVICE_TYPE VolumeDeviceType,
163 _In_ FLT_FILESYSTEM_TYPE VolumeFilesystemType,
166 _In_ ULONG ReportedSectorSize
167)
168{
169 trace("Received an attach request for VolumeType 0x%X, FileSystemType %d\n",
170 VolumeDeviceType,
171 VolumeFilesystemType);
172
173 /* We're not interested in attaching to any volumes in this test */
175}
176
192VOID
194 _In_ PCFLT_RELATED_OBJECTS FltObjects,
196{
197 trace("Received a teardown request, Flags %lu\n", Flags);
198
199 UNREFERENCED_PARAMETER(FltObjects);
201}
202
204FLTAPI
208 _In_reads_bytes_opt_(SizeOfContext) PVOID ConnectionContext,
210 _Outptr_result_maybenull_ PVOID *ConnectionPortCookie)
211{
212 return 0;
213}
214
215VOID
216FLTAPI
218 _In_opt_ PVOID ConnectionCookie)
219{
220
221}
222
224FLTAPI
226 _In_opt_ PVOID ConnectionCookie,
231 _Out_ PULONG ReturnOutputBufferLength)
232{
233 return 0;
234}
#define PAGED_CODE()
static KMT_MESSAGE_HANDLER TestMessageHandler
Definition: Example_drv.c:16
#define trace
Definition: atltest.h:70
LONG NTSTATUS
Definition: precomp.h:26
#define DEVICE_TYPE
Definition: guid.c:10
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
_Must_inspect_result_ _Inout_opt_ PUNICODE_STRING VolumeName
Definition: fltkernel.h:1117
_Outptr_ PFLT_PORT * ClientPort
Definition: fltkernel.h:1891
ULONG FLT_INSTANCE_SETUP_FLAGS
Definition: fltkernel.h:527
_Must_inspect_result_ _In_ LPCGUID ULONG SizeOfContext
Definition: fltkernel.h:2520
struct _FLT_PORT * PFLT_PORT
Definition: fltkernel.h:87
ULONG FLT_INSTANCE_QUERY_TEARDOWN_FLAGS
Definition: fltkernel.h:552
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID ServerPortCookie
Definition: fltkernel.h:1874
VOID TestQueryTeardown(_In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ FLT_INSTANCE_QUERY_TEARDOWN_FLAGS Flags)
Definition: fltmgr_load.c:193
VOID FLTAPI TestClientDisconnect(_In_opt_ PVOID ConnectionCookie)
Definition: fltmgr_load.c:217
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)
Definition: fltmgr_load.c:159
VOID TestFilterUnload(IN ULONG Flags)
Definition: fltmgr_load.c:117
NTSTATUS FLTAPI TestClientConnect(_In_ PFLT_PORT ClientPort, _In_opt_ PVOID ServerPortCookie, _In_reads_bytes_opt_(SizeOfContext) PVOID ConnectionContext, _In_ ULONG SizeOfContext, _Outptr_result_maybenull_ PVOID *ConnectionPortCookie)
Definition: fltmgr_load.c:205
static PDRIVER_OBJECT TestDriverObject
Definition: fltmgr_load.c:44
NTSTATUS TestEntry(IN PDRIVER_OBJECT DriverObject, IN PCUNICODE_STRING RegistryPath, OUT PCWSTR *DeviceName, IN OUT INT *Flags)
Definition: fltmgr_load.c:74
Status
Definition: gdiplustypes.h:25
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: ms_sal.h:428
#define _Out_
Definition: ms_sal.h:345
#define _Out_writes_bytes_to_opt_(size, count)
Definition: ms_sal.h:361
#define _In_
Definition: ms_sal.h:308
#define _In_reads_bytes_opt_(size)
Definition: ms_sal.h:322
#define _In_opt_
Definition: ms_sal.h:309
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_FLT_DO_NOT_ATTACH
Definition: ntstatus.h:1436
#define L(x)
Definition: ntvdm.h:50
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_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_ WDFREQUEST _In_ size_t OutputBufferLength
Definition: wdfio.h:320
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
Definition: wdfio.h:322
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:863
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ ULONG SectorSize
Definition: halfuncs.h:291