2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: GPLv2+ - See COPYING in the top level directory
4 * PURPOSE: Kernel-Mode Test Suite I/O Test Helper driver
5 * PROGRAMMER: Thomas Faber <thfabba@gmx.de>
13 static KMT_IRP_HANDLER TestIrpHandler
;
17 IN PDRIVER_OBJECT DriverObject
,
18 IN PCUNICODE_STRING RegistryPath
,
19 OUT PCWSTR
*DeviceName
,
22 NTSTATUS Status
= STATUS_SUCCESS
;
26 UNREFERENCED_PARAMETER(DriverObject
);
27 UNREFERENCED_PARAMETER(RegistryPath
);
28 UNREFERENCED_PARAMETER(Flags
);
30 *DeviceName
= L
"IoHelper";
32 KmtRegisterIrpHandler(IRP_MJ_CREATE
, NULL
, TestIrpHandler
);
33 KmtRegisterIrpHandler(IRP_MJ_CLOSE
, NULL
, TestIrpHandler
);
40 IN PDRIVER_OBJECT DriverObject
)
44 UNREFERENCED_PARAMETER(DriverObject
);
50 IN PDEVICE_OBJECT DeviceObject
,
52 IN PIO_STACK_LOCATION IoStackLocation
)
54 NTSTATUS Status
= STATUS_SUCCESS
;
56 if (IoStackLocation
->MajorFunction
== IRP_MJ_CREATE
)
57 DPRINT("Helper Driver: Create Device %p", DeviceObject
);
58 else if (IoStackLocation
->MajorFunction
== IRP_MJ_CLOSE
)
59 DPRINT("Helper Driver: Close Device %p", DeviceObject
);
61 Irp
->IoStatus
.Status
= Status
;
62 Irp
->IoStatus
.Information
= 0;
64 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);