mirror of
https://github.com/reactos/reactos.git
synced 2024-08-28 22:28:36 +00:00
![Thomas Faber](/assets/img/avatar_default.png)
- Add a dummy IoHelper driver that can be loaded by driver/device tests - Minor changes to other standalone drivers svn path=/branches/GSoC_2011/KMTestSuite/; revision=53177
68 lines
1.5 KiB
C
68 lines
1.5 KiB
C
/*
|
|
* PROJECT: ReactOS kernel-mode tests
|
|
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
|
* PURPOSE: Kernel-Mode Test Suite I/O Test Helper driver
|
|
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
|
|
*/
|
|
|
|
#include <kmt_test.h>
|
|
|
|
//#define NDEBUG
|
|
#include <debug.h>
|
|
|
|
static KMT_IRP_HANDLER TestIrpHandler;
|
|
|
|
NTSTATUS
|
|
TestEntry(
|
|
IN PDRIVER_OBJECT DriverObject,
|
|
IN PCUNICODE_STRING RegistryPath,
|
|
OUT PCWSTR *DeviceName,
|
|
IN OUT INT *Flags)
|
|
{
|
|
NTSTATUS Status = STATUS_SUCCESS;
|
|
|
|
PAGED_CODE();
|
|
|
|
UNREFERENCED_PARAMETER(DriverObject);
|
|
UNREFERENCED_PARAMETER(RegistryPath);
|
|
UNREFERENCED_PARAMETER(Flags);
|
|
|
|
*DeviceName = L"IoHelper";
|
|
|
|
KmtRegisterIrpHandler(IRP_MJ_CREATE, NULL, TestIrpHandler);
|
|
KmtRegisterIrpHandler(IRP_MJ_CLOSE, NULL, TestIrpHandler);
|
|
|
|
return Status;
|
|
}
|
|
|
|
VOID
|
|
TestUnload(
|
|
IN PDRIVER_OBJECT DriverObject)
|
|
{
|
|
PAGED_CODE();
|
|
|
|
UNREFERENCED_PARAMETER(DriverObject);
|
|
}
|
|
|
|
static
|
|
NTSTATUS
|
|
TestIrpHandler(
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
IN PIRP Irp,
|
|
IN PIO_STACK_LOCATION IoStackLocation)
|
|
{
|
|
NTSTATUS Status = STATUS_SUCCESS;
|
|
|
|
if (IoStackLocation->MajorFunction == IRP_MJ_CREATE)
|
|
DPRINT("Helper Driver: Create Device %p", DeviceObject);
|
|
else if (IoStackLocation->MajorFunction == IRP_MJ_CLOSE)
|
|
DPRINT("Helper Driver: Close Device %p", DeviceObject);
|
|
|
|
Irp->IoStatus.Status = Status;
|
|
Irp->IoStatus.Information = 0;
|
|
|
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
|
|
|
return Status;
|
|
}
|