[HIDCLASS]

- Implement IRP_MN_REMOVE_DEVICE for FDOs and PDOs
- USB mice will now work after being disconnected then reconnected

svn path=/branches/usb-bringup-trunk/; revision=55194
This commit is contained in:
Cameron Gutman 2012-01-26 03:27:22 +00:00
parent f7c472bda7
commit e33d8f1ee5
2 changed files with 23 additions and 10 deletions

View file

@ -384,9 +384,18 @@ HidClassFDO_RemoveDevice(
IN PDEVICE_OBJECT DeviceObject, IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
UNIMPLEMENTED PHIDCLASS_FDO_EXTENSION FDODeviceExtension = DeviceObject->DeviceExtension;
ASSERT(FALSE); NTSTATUS Status;
return STATUS_NOT_IMPLEMENTED;
/* Pass the IRP down */
IoSkipCurrentIrpStackLocation(Irp);
Status = IoCallDriver(FDODeviceExtension->Common.HidDeviceExtension.NextDeviceObject, Irp);
/* Now teardown our portion of the device stack */
IoDetachDevice(FDODeviceExtension->Common.HidDeviceExtension.NextDeviceObject);
IoDeleteDevice(DeviceObject);
return Status;
} }
NTSTATUS NTSTATUS

View file

@ -514,14 +514,18 @@ HidClassPDO_PnP(
} }
case IRP_MN_REMOVE_DEVICE: case IRP_MN_REMOVE_DEVICE:
{ {
DPRINT1("[HIDCLASS] PDO IRP_MN_REMOVE_DEVICE not implemented\n"); /* Disable the device interface */
ASSERT(FALSE); if (PDODeviceExtension->DeviceInterface.Length != 0)
IoSetDeviceInterfaceState(&PDODeviceExtension->DeviceInterface, FALSE);
// /* Complete the IRP */
// do nothing Irp->IoStatus.Status = STATUS_SUCCESS;
// IoCompleteRequest(Irp, IO_NO_INCREMENT);
Status = STATUS_SUCCESS; //Irp->IoStatus.Status;
break; /* Delete our device object*/
IoDeleteDevice(DeviceObject);
return STATUS_SUCCESS;
} }
case IRP_MN_QUERY_INTERFACE: case IRP_MN_QUERY_INTERFACE:
{ {