mirror of
https://github.com/reactos/reactos.git
synced 2026-10-31 15:12:43 +08:00
[MOUCLASS] Support IRP_MJ_READ on Port device objects
This commit is contained in:
@@ -92,15 +92,11 @@ ClassRead(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
PCLASS_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
|
||||
PCOMMON_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
|
||||
PREAD_DATA ReadData;
|
||||
|
||||
TRACE_(CLASS_NAME, "IRP_MJ_READ\n");
|
||||
|
||||
ASSERT(DeviceExtension->Common.IsClassDO);
|
||||
|
||||
if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
|
||||
return ForwardIrpAndForget(DeviceObject, Irp);
|
||||
|
||||
if (IoGetCurrentIrpStackLocation(Irp)->Parameters.Read.Length < sizeof(MOUSE_INPUT_DATA))
|
||||
{
|
||||
Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
|
||||
@@ -110,7 +106,18 @@ ClassRead(
|
||||
return STATUS_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
return HandleReadIrp(DeviceObject, DeviceExtension->ReadData, Irp);
|
||||
if (DeviceExtension->IsClassDO)
|
||||
{
|
||||
ReadData = ((PCLASS_DEVICE_EXTENSION)DeviceExtension)->ReadData;
|
||||
}
|
||||
else
|
||||
{
|
||||
PPORT_DEVICE_EXTENSION Port = (PPORT_DEVICE_EXTENSION)DeviceExtension;
|
||||
PCLASS_DEVICE_EXTENSION Class = (PCLASS_DEVICE_EXTENSION)Port->ClassDO->DeviceExtension;
|
||||
ReadData = Class->ReadData;
|
||||
}
|
||||
|
||||
return HandleReadIrp(DeviceObject, ReadData, Irp);
|
||||
}
|
||||
|
||||
static NTSTATUS NTAPI
|
||||
|
||||
Reference in New Issue
Block a user