[NTOSKRNL]

- Reenable and fix the correct reset code
[HIDCLASS]
- Disable removal of PDOs due to IRP cancellation issues
[USBEHCI][USBOHCI][USBUHCI]
- Disable removal of FDOs due to reinitialization issues

svn path=/trunk/; revision=55827
This commit is contained in:
Cameron Gutman 2012-02-23 01:23:30 +00:00
parent 8afc22a95d
commit a982c0c4c9
5 changed files with 53 additions and 28 deletions

View file

@ -580,7 +580,12 @@ HidClassPDO_PnP(
// //
// no/op // no/op
// //
#if 0
Status = STATUS_SUCCESS; Status = STATUS_SUCCESS;
#else
DPRINT1("Denying removal of HID device due to IRP cancellation bugs\n");
Status = STATUS_UNSUCCESSFUL;
#endif
break; break;
} }
default: default:

View file

@ -537,6 +537,7 @@ CHCDController::HandlePnp(
case IRP_MN_QUERY_REMOVE_DEVICE: case IRP_MN_QUERY_REMOVE_DEVICE:
case IRP_MN_QUERY_STOP_DEVICE: case IRP_MN_QUERY_STOP_DEVICE:
{ {
#if 0
// //
// sure // sure
// //
@ -547,6 +548,12 @@ CHCDController::HandlePnp(
// //
IoSkipCurrentIrpStackLocation(Irp); IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(m_NextDeviceObject, Irp); return IoCallDriver(m_NextDeviceObject, Irp);
#else
DPRINT1("Denying controller removal due to reinitialization bugs\n");
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_UNSUCCESSFUL;
#endif
} }
case IRP_MN_REMOVE_DEVICE: case IRP_MN_REMOVE_DEVICE:
{ {

View file

@ -537,6 +537,7 @@ CHCDController::HandlePnp(
case IRP_MN_QUERY_REMOVE_DEVICE: case IRP_MN_QUERY_REMOVE_DEVICE:
case IRP_MN_QUERY_STOP_DEVICE: case IRP_MN_QUERY_STOP_DEVICE:
{ {
#if 0
// //
// sure // sure
// //
@ -547,6 +548,12 @@ CHCDController::HandlePnp(
// //
IoSkipCurrentIrpStackLocation(Irp); IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(m_NextDeviceObject, Irp); return IoCallDriver(m_NextDeviceObject, Irp);
#else
DPRINT1("Denying controller removal due to reinitialization bugs\n");
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_UNSUCCESSFUL;
#endif
} }
case IRP_MN_REMOVE_DEVICE: case IRP_MN_REMOVE_DEVICE:
{ {

View file

@ -537,6 +537,7 @@ CHCDController::HandlePnp(
case IRP_MN_QUERY_REMOVE_DEVICE: case IRP_MN_QUERY_REMOVE_DEVICE:
case IRP_MN_QUERY_STOP_DEVICE: case IRP_MN_QUERY_STOP_DEVICE:
{ {
#if 0
// //
// sure // sure
// //
@ -547,6 +548,12 @@ CHCDController::HandlePnp(
// //
IoSkipCurrentIrpStackLocation(Irp); IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(m_NextDeviceObject, Irp); return IoCallDriver(m_NextDeviceObject, Irp);
#else
DPRINT1("Denying controller removal due to reinitialization bugs\n");
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_UNSUCCESSFUL;
#endif
} }
case IRP_MN_REMOVE_DEVICE: case IRP_MN_REMOVE_DEVICE:
{ {

View file

@ -555,17 +555,26 @@ IopResetDevice(PPLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData)
ASSERT(DeviceNode->Flags & DNF_ENUMERATED); ASSERT(DeviceNode->Flags & DNF_ENUMERATED);
ASSERT(DeviceNode->Flags & DNF_PROCESSED); ASSERT(DeviceNode->Flags & DNF_PROCESSED);
#if 0 /* Check if there's already a driver loaded for this device */
if (DeviceNode->Flags & DNF_ADDED)
{
/* Remove the device node */ /* Remove the device node */
Status = IopRemoveDevice(DeviceNode); Status = IopRemoveDevice(DeviceNode);
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
/* Invalidate device relations for the parent to reenumerate the device */ /* Invalidate device relations for the parent to reenumerate the device */
Status = IoSynchronousInvalidateDeviceRelations(DeviceNode->Parent->PhysicalDeviceObject, BusRelations); Status = IoSynchronousInvalidateDeviceRelations(DeviceNode->Parent->PhysicalDeviceObject, BusRelations);
DPRINT1("A new driver has been loaded for '%wZ'\n", &DeviceInstance); DPRINT1("A new driver has been loaded for '%wZ' (FDO above removed)\n", &DeviceNode->InstancePath);
} }
#else else
/* FIXME: We might clear some important flags */ {
/* A driver has already been loaded for this device */
DPRINT1("A reboot is required for the current driver for '%wZ' to be replaced\n", &DeviceNode->InstancePath);
}
}
else
{
/* FIXME: What if the device really is disabled? */
DeviceNode->Flags &= ~DNF_DISABLED; DeviceNode->Flags &= ~DNF_DISABLED;
/* Load service data from the registry */ /* Load service data from the registry */
@ -575,18 +584,8 @@ IopResetDevice(PPLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData)
{ {
/* Start the service and begin PnP initialization of the device again */ /* Start the service and begin PnP initialization of the device again */
Status = IopActionInitChildServices(DeviceNode, DeviceNode->Parent); Status = IopActionInitChildServices(DeviceNode, DeviceNode->Parent);
DPRINT1("HACK: A new driver has been loaded for '%wZ' WITHOUT removing the old one\n", &DeviceInstance); DPRINT1("A new driver will be loaded for '%wZ' (no FDO above)\n", &DeviceNode->InstancePath);
} }
#endif
else if (DeviceNode->Flags & DNF_ADDED)
{
/* A driver has already been loaded for this device */
DPRINT1("A reboot is required for the current driver for '%wZ' to be replaced\n", &DeviceInstance);
}
else
{
/* This device needs a driver */
DPRINT1("A reboot is required for the new driver for '%wZ' to load\n", &DeviceInstance);
} }
ObDereferenceObject(DeviceObject); ObDereferenceObject(DeviceObject);