https://git.reactos.org/?p=reactos.git;a=commitdiff;h=23ccd13639265a5a8b889…
commit 23ccd13639265a5a8b889956d76491f8e2e55db2
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sun Jun 21 09:57:17 2020 +0200
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sun Jun 21 10:39:34 2020 +0200
[I8042PRT] Get rid of IrpStub. CORE-12148 CORE-17136
We neither want to handle IRPs we don't understand, nor do we want to
assert in case of unexpected IOCTLs.
---
drivers/input/i8042prt/i8042prt.c | 25 +++----------------------
1 file changed, 3 insertions(+), 22 deletions(-)
diff --git a/drivers/input/i8042prt/i8042prt.c b/drivers/input/i8042prt/i8042prt.c
index 19027a9b0df..879c231d80f 100644
--- a/drivers/input/i8042prt/i8042prt.c
+++ b/drivers/input/i8042prt/i8042prt.c
@@ -18,7 +18,6 @@
/* FUNCTIONS *****************************************************************/
static DRIVER_STARTIO i8042StartIo;
-static DRIVER_DISPATCH IrpStub;
_Dispatch_type_(IRP_MJ_DEVICE_CONTROL)
static DRIVER_DISPATCH i8042DeviceControl;
_Dispatch_type_(IRP_MJ_INTERNAL_DEVICE_CONTROL)
@@ -387,21 +386,6 @@ done:
return Status;
}
-static NTSTATUS NTAPI
-IrpStub(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp)
-{
- NTSTATUS Status = Irp->IoStatus.Status;
-
- UNREFERENCED_PARAMETER(DeviceObject);
-
- /* Do nothing */
- ASSERT(FALSE);
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return Status;
-}
-
static NTSTATUS NTAPI
i8042DeviceControl(
IN PDEVICE_OBJECT DeviceObject,
@@ -416,9 +400,10 @@ i8042DeviceControl(
{
case Keyboard:
return i8042KbdDeviceControl(DeviceObject, Irp);
- break;
default:
- return IrpStub(DeviceObject, Irp);
+ Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_INVALID_DEVICE_REQUEST;
}
}
@@ -499,7 +484,6 @@ DriverEntry(
IN PUNICODE_STRING RegistryPath)
{
PI8042_DRIVER_EXTENSION DriverExtension;
- ULONG i;
NTSTATUS Status;
Status = IoAllocateDriverObjectExtension(
@@ -537,9 +521,6 @@ DriverEntry(
DriverObject->DriverExtension->AddDevice = i8042AddDevice;
DriverObject->DriverStartIo = i8042StartIo;
- for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++)
- DriverObject->MajorFunction[i] = IrpStub;
-
DriverObject->MajorFunction[IRP_MJ_CREATE] = i8042Create;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = i8042Cleanup;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = i8042Close;