ReactOS 0.4.15-dev-7918-g2a2556c
fltmgr_load.c File Reference
#include <kmt_test.h>
#include <fltkernel.h>
#include <debug.h>
Include dependency graph for fltmgr_load.c:

Go to the source code of this file.

Functions

TestQueryTeardown

Test volume attach routine. This is called by the driver's InstanceSetupCallback routine in response to a new volume attaching.

Parameters
FltObjectsFilter Object Pointers Pointer to an FLT_RELATED_OBJECTS structure that contains opaque pointers for the objects related to the current operation
FlagsFlag that indicates why the minifilter driver instance is being torn down
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)
 
VOID FLTAPI TestClientDisconnect (_In_opt_ PVOID ConnectionCookie)
 
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)
 
VOID TestQueryTeardown (_In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ FLT_INSTANCE_QUERY_TEARDOWN_FLAGS Flags)
 
TestEntry

Test entry point. This is called by DriverEntry as early as possible, but with ResultBuffer initialized, so that test macros work correctly

Parameters
DriverObjectDriver Object. This is guaranteed not to have been touched by DriverEntry before the call to TestEntry
RegistryPathDriver Registry Path This is guaranteed not to have been touched by DriverEntry before the call to TestEntry
DeviceNamePointer to receive a test-specific name for the device to create
FlagsPointer to a flags variable instructing DriverEntry how to proceed. See the KMT_TESTENTRY_FLAGS enumeration for possible values Initialized to zero on entry
Returns
Status. DriverEntry will fail if this is a failure status
NTSTATUS TestEntry (IN PDRIVER_OBJECT DriverObject, IN PCUNICODE_STRING RegistryPath, OUT PCWSTR *DeviceName, IN OUT INT *Flags)
 
TestUnload

Test unload routine. This is called by the driver's Unload routine as early as possible, with ResultBuffer and the test device object still valid, so that test macros work correctly

Parameters
DriverObjectDriver Object. This is guaranteed not to have been touched by Unload before the call to TestEntry
Returns
Status
VOID TestFilterUnload (IN ULONG Flags)
 
TestInstanceSetup

Test volume attach routine. This is called by the driver's InstanceSetupCallback routine in response to a new volume attaching.

Parameters
FltObjectsFilter Object Pointers Pointer to an FLT_RELATED_OBJECTS structure that contains opaque pointers for the objects related to the current operation
FlagsBitmask of flags that indicate why the instance is being attached
VolumeDeviceTypeDevice type of the file system volume
VolumeFilesystemTypeFile system type of the volume
VolumeNameUnicode string containing the name of the volume. The string is only valid within the context of this function
SectorSizeAdjusts the sector size to a minimum of 0x200, which is more reliable
ReportedSectorSizeSector size of the volume as reported by the filter manager
Returns
Status. Return STATUS_SUCCESS to attach or STATUS_FLT_DO_NOT_ATTACH to ignore
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)
 

Variables

static PDRIVER_OBJECT TestDriverObject
 

Function Documentation

◆ TestClientConnect()

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 at line 205 of file fltmgr_load.c.

211{
212 return 0;
213}

Referenced by TestEntry().

◆ TestClientDisconnect()

VOID FLTAPI TestClientDisconnect ( _In_opt_ PVOID  ConnectionCookie)

Definition at line 217 of file fltmgr_load.c.

219{
220
221}

Referenced by TestEntry().

◆ TestEntry()

NTSTATUS TestEntry ( IN PDRIVER_OBJECT  DriverObject,
IN PCUNICODE_STRING  RegistryPath,
OUT PCWSTR DeviceName,
IN OUT INT Flags 
)

Definition at line 74 of file fltmgr_load.c.

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}
#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 PASSIVE_LEVEL
Definition: env_spec_w32.h:693
VOID FLTAPI TestClientDisconnect(_In_opt_ PVOID ConnectionCookie)
Definition: fltmgr_load.c:217
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
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 UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define L(x)
Definition: ntvdm.h:50
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
_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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

◆ TestFilterUnload()

VOID TestFilterUnload ( IN ULONG  Flags)

Definition at line 117 of file fltmgr_load.c.

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}

◆ TestInstanceSetup()

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 at line 159 of file fltmgr_load.c.

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}
#define STATUS_FLT_DO_NOT_ATTACH
Definition: ntstatus.h:1436

◆ TestMessageHandler()

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 at line 225 of file fltmgr_load.c.

232{
233 return 0;
234}

◆ TestQueryTeardown()

VOID TestQueryTeardown ( _In_ PCFLT_RELATED_OBJECTS  FltObjects,
_In_ FLT_INSTANCE_QUERY_TEARDOWN_FLAGS  Flags 
)

Definition at line 193 of file fltmgr_load.c.

196{
197 trace("Received a teardown request, Flags %lu\n", Flags);
198
199 UNREFERENCED_PARAMETER(FltObjects);
201}

Variable Documentation

◆ TestDriverObject

PDRIVER_OBJECT TestDriverObject
static

Definition at line 44 of file fltmgr_load.c.

Referenced by TestEntry().