From 54c5af9906917c1bbb8bfdd234a3712968d167e3 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Sat, 7 May 2011 16:10:09 +0000 Subject: [PATCH] [USBHUB_NEW] - Some devices implement a default Language, LangId of 0. Some do not. Use LangId 0x0409 (English) until LangId is implemented. - Remove an unused variable. svn path=/branches/usb-bringup/; revision=51622 --- drivers/usb/usbhub_new/fdo.c | 20 ++++++++++---------- drivers/usb/usbhub_new/usbhub.c | 2 -- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/usb/usbhub_new/fdo.c b/drivers/usb/usbhub_new/fdo.c index 2b1d7267aef..04f18716b01 100644 --- a/drivers/usb/usbhub_new/fdo.c +++ b/drivers/usb/usbhub_new/fdo.c @@ -688,21 +688,19 @@ GetUsbStringDescriptor( // // Get the index string descriptor length + // FIXME: Implement LangIds // Status = GetUsbDeviceDescriptor(ChildDeviceObject, USB_STRING_DESCRIPTOR_TYPE, Index, - 0, + 0x0409, StringDesc, sizeof(USB_STRING_DESCRIPTOR)); - - // - // If lenght is 4 only then either this is a bad index or the device is not reporting - // - if (StringDesc->bLength == 4) + if (!NT_SUCCESS(Status)) { - DPRINT1("USBHUB: Device Data Error\n"); - return STATUS_UNSUCCESSFUL; + DPRINT1("GetUsbDeviceDescriptor failed with status %x\n", Status); + ExFreePool(StringDesc); + return Status; } DPRINT1("StringDesc->bLength %d\n", StringDesc->bLength); @@ -724,19 +722,21 @@ GetUsbStringDescriptor( DPRINT1("Failed to allocate buffer for string!\n"); return STATUS_INSUFFICIENT_RESOURCES; } + RtlZeroMemory(StringDesc, SizeNeeded); + // // Get the string // Status = GetUsbDeviceDescriptor(ChildDeviceObject, USB_STRING_DESCRIPTOR_TYPE, Index, - 0, + 0x0409, StringDesc, SizeNeeded); if (!NT_SUCCESS(Status)) { - DPRINT1("Failed to get string from device\n"); + DPRINT1("GetUsbDeviceDescriptor failed with status %x\n", Status); ExFreePool(StringDesc); return Status; } diff --git a/drivers/usb/usbhub_new/usbhub.c b/drivers/usb/usbhub_new/usbhub.c index ca81b7a673e..fd9cc30f302 100644 --- a/drivers/usb/usbhub_new/usbhub.c +++ b/drivers/usb/usbhub_new/usbhub.c @@ -190,8 +190,6 @@ DriverEntry( IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) { - ULONG i; - DriverObject->DriverExtension->AddDevice = USBHUB_AddDevice; DPRINT1("USBHUB: DriverEntry\n");