Author: vmikayelyan
Date: Fri Aug 19 16:55:09 2016
New Revision: 72392
URL:
http://svn.reactos.org/svn/reactos?rev=72392&view=rev
Log:
usb: HUB: Fix DV's enhanced I/O validation issues
Added USBHUB_DispatchSystemControl stub
Modified:
branches/GSoC_2016/USB/drivers/usb/usbhub/fdo.c
branches/GSoC_2016/USB/drivers/usb/usbhub/usbhub.c
Modified: branches/GSoC_2016/USB/drivers/usb/usbhub/fdo.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/USB/drivers/usb/usbhu…
==============================================================================
--- branches/GSoC_2016/USB/drivers/usb/usbhub/fdo.c [iso-8859-1] (original)
+++ branches/GSoC_2016/USB/drivers/usb/usbhub/fdo.c [iso-8859-1] Fri Aug 19 16:55:09 2016
@@ -1626,7 +1626,7 @@
RootHubDeviceObject = HubDeviceExtension->RootHubPhysicalDeviceObject;
// Send the StartDevice to RootHub
- Status = ForwardIrpAndWait(RootHubDeviceObject, Irp);
+ Status = ForwardIrpAndWait(HubDeviceExtension->LowerDeviceObject, Irp);
if (!NT_SUCCESS(Status))
{
Modified: branches/GSoC_2016/USB/drivers/usb/usbhub/usbhub.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/USB/drivers/usb/usbhu…
==============================================================================
--- branches/GSoC_2016/USB/drivers/usb/usbhub/usbhub.c [iso-8859-1] (original)
+++ branches/GSoC_2016/USB/drivers/usb/usbhub/usbhub.c [iso-8859-1] Fri Aug 19 16:55:09
2016
@@ -62,7 +62,7 @@
PDEVICE_OBJECT DeviceObject;
PHUB_DEVICE_EXTENSION HubDeviceExtension;
NTSTATUS Status;
- DPRINT("USBHUB: AddDevice\n");
+ DPRINT("USBHUB: AddDevice (%p)\n", PhysicalDeviceObject);
//
// Create the Device Object
//
@@ -167,6 +167,18 @@
}
NTSTATUS NTAPI
+USBHUB_DispatchSystemControl(
+ PDEVICE_OBJECT DeviceObject,
+ PIRP Irp)
+{
+ DPRINT("Usbhub: DispatchSystemControl\n");
+ if (((PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Common.IsFDO)
+ return USBHUB_IrpStub(DeviceObject, Irp);
+ else
+ return USBHUB_IrpStub(DeviceObject, Irp);
+}
+
+NTSTATUS NTAPI
USBHUB_DispatchInternalDeviceControl(
PDEVICE_OBJECT DeviceObject,
PIRP Irp)
@@ -275,6 +287,7 @@
DriverObject->MajorFunction[IRP_MJ_CLOSE] = USBHUB_Close;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = USBHUB_Cleanup;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] =
USBHUB_DispatchDeviceControl;
+ DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] =
USBHUB_DispatchSystemControl;
DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] =
USBHUB_DispatchInternalDeviceControl;
DriverObject->MajorFunction[IRP_MJ_PNP] = USBHUB_DispatchPnp;
DriverObject->MajorFunction[IRP_MJ_POWER] =USBHUB_DispatchPower;