Author: cgutman
Date: Thu Jan 26 03:27:22 2012
New Revision: 55194
URL:
http://svn.reactos.org/svn/reactos?rev=55194&view=rev
Log:
[HIDCLASS]
- Implement IRP_MN_REMOVE_DEVICE for FDOs and PDOs
- USB mice will now work after being disconnected then reconnected
Modified:
branches/usb-bringup-trunk/drivers/hid/hidclass/fdo.c
branches/usb-bringup-trunk/drivers/hid/hidclass/pdo.c
Modified: branches/usb-bringup-trunk/drivers/hid/hidclass/fdo.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/hid/h…
==============================================================================
--- branches/usb-bringup-trunk/drivers/hid/hidclass/fdo.c [iso-8859-1] (original)
+++ branches/usb-bringup-trunk/drivers/hid/hidclass/fdo.c [iso-8859-1] Thu Jan 26 03:27:22
2012
@@ -384,9 +384,18 @@
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- UNIMPLEMENTED
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
+ PHIDCLASS_FDO_EXTENSION FDODeviceExtension = DeviceObject->DeviceExtension;
+ NTSTATUS Status;
+
+ /* 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
Modified: branches/usb-bringup-trunk/drivers/hid/hidclass/pdo.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/hid/h…
==============================================================================
--- branches/usb-bringup-trunk/drivers/hid/hidclass/pdo.c [iso-8859-1] (original)
+++ branches/usb-bringup-trunk/drivers/hid/hidclass/pdo.c [iso-8859-1] Thu Jan 26 03:27:22
2012
@@ -514,14 +514,18 @@
}
case IRP_MN_REMOVE_DEVICE:
{
- DPRINT1("[HIDCLASS] PDO IRP_MN_REMOVE_DEVICE not implemented\n");
- ASSERT(FALSE);
-
- //
- // do nothing
- //
- Status = STATUS_SUCCESS; //Irp->IoStatus.Status;
- break;
+ /* Disable the device interface */
+ if (PDODeviceExtension->DeviceInterface.Length != 0)
+ IoSetDeviceInterfaceState(&PDODeviceExtension->DeviceInterface,
FALSE);
+
+ /* Complete the IRP */
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+
+ /* Delete our device object*/
+ IoDeleteDevice(DeviceObject);
+
+ return STATUS_SUCCESS;
}
case IRP_MN_QUERY_INTERFACE:
{