Skip to content

Commit 23d8d38

Browse files
committed
usb: HUB: Fix DV's enhanced I/O validation issues
Added USBHUB_DispatchSystemControl stub svn path=/branches/GSoC_2016/USB/; revision=72392
1 parent 087e7ad commit 23d8d38

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

drivers/usb/usbhub/fdo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1626,7 +1626,7 @@ USBHUB_FdoStartDevice(
16261626
RootHubDeviceObject = HubDeviceExtension->RootHubPhysicalDeviceObject;
16271627

16281628
// Send the StartDevice to RootHub
1629-
Status = ForwardIrpAndWait(RootHubDeviceObject, Irp);
1629+
Status = ForwardIrpAndWait(HubDeviceExtension->LowerDeviceObject, Irp);
16301630

16311631
if (!NT_SUCCESS(Status))
16321632
{

drivers/usb/usbhub/usbhub.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ USBHUB_AddDevice(
6262
PDEVICE_OBJECT DeviceObject;
6363
PHUB_DEVICE_EXTENSION HubDeviceExtension;
6464
NTSTATUS Status;
65-
DPRINT("USBHUB: AddDevice\n");
65+
DPRINT("USBHUB: AddDevice (%p)\n", PhysicalDeviceObject);
6666
//
6767
// Create the Device Object
6868
//
@@ -166,6 +166,18 @@ USBHUB_DispatchDeviceControl(
166166
return USBHUB_IrpStub(DeviceObject, Irp);
167167
}
168168

169+
NTSTATUS NTAPI
170+
USBHUB_DispatchSystemControl(
171+
PDEVICE_OBJECT DeviceObject,
172+
PIRP Irp)
173+
{
174+
DPRINT("Usbhub: DispatchSystemControl\n");
175+
if (((PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Common.IsFDO)
176+
return USBHUB_IrpStub(DeviceObject, Irp);
177+
else
178+
return USBHUB_IrpStub(DeviceObject, Irp);
179+
}
180+
169181
NTSTATUS NTAPI
170182
USBHUB_DispatchInternalDeviceControl(
171183
PDEVICE_OBJECT DeviceObject,
@@ -275,6 +287,7 @@ DriverEntry(
275287
DriverObject->MajorFunction[IRP_MJ_CLOSE] = USBHUB_Close;
276288
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = USBHUB_Cleanup;
277289
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = USBHUB_DispatchDeviceControl;
290+
DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = USBHUB_DispatchSystemControl;
278291
DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = USBHUB_DispatchInternalDeviceControl;
279292
DriverObject->MajorFunction[IRP_MJ_PNP] = USBHUB_DispatchPnp;
280293
DriverObject->MajorFunction[IRP_MJ_POWER] =USBHUB_DispatchPower;

0 commit comments

Comments
 (0)