ReactOS  0.4.13-dev-1148-g9b75b67
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 */
16 FLTAPI
20  _In_reads_bytes_opt_(SizeOfContext) PVOID ConnectionContext,
22  _Outptr_result_maybenull_ PVOID *ConnectionPortCookie
23 );
24 
25 VOID
26 FLTAPI
28  _In_opt_ PVOID ConnectionCookie
29 );
30 
32 FLTAPI
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 
116 VOID
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 
158 NTSTATUS
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 
192 VOID
194  _In_ PCFLT_RELATED_OBJECTS FltObjects,
196 {
197  trace("Received a teardown request, Flags %lu\n", Flags);
198 
199  UNREFERENCED_PARAMETER(FltObjects);
201 }
202 
203 NTSTATUS
204 FLTAPI
208  _In_reads_bytes_opt_(SizeOfContext) PVOID ConnectionContext,
210  _Outptr_result_maybenull_ PVOID *ConnectionPortCookie)
211 {
212  return 0;
213 }
214 
215 VOID
216 FLTAPI
218  _In_opt_ PVOID ConnectionCookie)
219 {
220 
221 }
222 
223 NTSTATUS
224 FLTAPI
226  _In_opt_ PVOID ConnectionCookie,
231  _Out_ PULONG ReturnOutputBufferLength)
232 {
233  return 0;
234 }
VOID FLTAPI TestClientDisconnect(_In_opt_ PVOID ConnectionCookie)
Definition: fltmgr_load.c:217
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 _Out_writes_bytes_to_opt_(size, count)
Definition: no_sal2.h:375
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define _In_reads_bytes_opt_(size)
Definition: no_sal2.h:230
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG _In_ ULONG OutputBufferLength
Definition: fltkernel.h:1374
VOID TestQueryTeardown(_In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ FLT_INSTANCE_QUERY_TEARDOWN_FLAGS Flags)
Definition: fltmgr_load.c:193
_Outptr_ PFLT_PORT * ClientPort
Definition: fltkernel.h:1892
WCHAR DeviceName[]
Definition: adapter.cpp:21
NTSTATUS TestEntry(IN PDRIVER_OBJECT DriverObject, IN PCUNICODE_STRING RegistryPath, OUT PCWSTR *DeviceName, IN OUT INT *Flags)
Definition: fltmgr_load.c:74
int32_t INT
Definition: typedefs.h:56
#define PAGED_CODE()
Definition: video.h:57
CHAR InputBuffer[80]
Definition: conmgr.c:33
#define _In_opt_
Definition: no_sal2.h:213
struct _FLT_PORT * PFLT_PORT
Definition: fltkernel.h:87
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define _Out_
Definition: no_sal2.h:323
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
void DPRINT(...)
Definition: polytest.cpp:61
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
NTSTATUS FLTAPI TestMessageHandler(_In_opt_ PVOID ConnectionCookie, _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: fltmgr_load.c:225
#define trace
Definition: atltest.h:70
NTSTATUS KmtFilterRegisterComms(_In_ PFLT_CONNECT_NOTIFY ConnectNotifyCallback, _In_ PFLT_DISCONNECT_NOTIFY DisconnectNotifyCallback, _In_opt_ PFLT_MESSAGE_NOTIFY MessageNotifyCallback, _In_ LONG MaxClientConnections)
#define STATUS_FLT_DO_NOT_ATTACH
Definition: ntstatus.h:1218
#define _Outptr_result_maybenull_
Definition: no_sal2.h:426
static const WCHAR L[]
Definition: oid.c:1250
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
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
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG InputBufferLength
Definition: fltkernel.h:1372
Status
Definition: gdiplustypes.h:24
#define _In_
Definition: no_sal2.h:204
ULONG FLT_INSTANCE_SETUP_FLAGS
Definition: fltkernel.h:527
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID ServerPortCookie
Definition: fltkernel.h:1873
#define DEVICE_TYPE
Definition: guid.c:10
unsigned int * PULONG
Definition: retypes.h:1
_Must_inspect_result_ _Inout_opt_ PUNICODE_STRING VolumeName
Definition: fltkernel.h:1117
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
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
_Must_inspect_result_ _In_ LPCGUID ULONG SizeOfContext
Definition: fltkernel.h:2520
_In_ ULONG SectorSize
Definition: halfuncs.h:291
return STATUS_SUCCESS
Definition: btrfs.c:2966
VOID TestFilterUnload(IN ULONG Flags)
Definition: fltmgr_load.c:117
static PDRIVER_OBJECT TestDriverObject
Definition: fltmgr_load.c:44