[USB-BRINGUP-TRUNK]

- Allow surprise removal of HID devices
- Don't assemble useless empty resource lists

svn path=/branches/usb-bringup-trunk/; revision=55119
This commit is contained in:
Cameron Gutman 2012-01-23 16:22:43 +00:00
parent 33e7325e17
commit 1f321cafad
2 changed files with 11 additions and 32 deletions

View file

@ -1504,6 +1504,11 @@ HidPnp(
//
IoStack->Parameters.DeviceCapabilities.Capabilities->DeviceD1 = TRUE;
IoStack->Parameters.DeviceCapabilities.Capabilities->DeviceD2 = TRUE;
//
// don't need to safely remove
//
IoStack->Parameters.DeviceCapabilities.Capabilities->SurpriseRemovalOK = TRUE;
}
//

View file

@ -517,44 +517,18 @@ USBHUB_PdoHandlePnp(
}
case IRP_MN_QUERY_RESOURCES:
{
PCM_RESOURCE_LIST ResourceList;
DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES\n");
ResourceList = ExAllocatePool(PagedPool, sizeof(CM_RESOURCE_LIST));
if (!ResourceList)
{
DPRINT1("ExAllocatePool() failed\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
}
else
{
ResourceList->Count = 0;
Information = (ULONG_PTR)ResourceList;
Status = STATUS_SUCCESS;
}
Information = Irp->IoStatus.Information;
Status = Irp->IoStatus.Status;
break;
}
case IRP_MN_QUERY_RESOURCE_REQUIREMENTS:
{
PIO_RESOURCE_REQUIREMENTS_LIST ResourceList;
DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n");
ResourceList = ExAllocatePool(PagedPool, sizeof(IO_RESOURCE_REQUIREMENTS_LIST));
if (!ResourceList)
{
DPRINT1("ExAllocatePool() failed\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
}
else
{
RtlZeroMemory(ResourceList, sizeof(IO_RESOURCE_REQUIREMENTS_LIST));
ResourceList->ListSize = sizeof(IO_RESOURCE_REQUIREMENTS_LIST);
ResourceList->AlternativeLists = 1;
ResourceList->List->Version = 1;
ResourceList->List->Revision = 1;
ResourceList->List->Count = 0;
Information = (ULONG_PTR)ResourceList;
Status = STATUS_SUCCESS;
}
Information = Irp->IoStatus.Information;
Status = Irp->IoStatus.Status;
break;
}
case IRP_MN_QUERY_DEVICE_TEXT: