Author: mjmartin
Date: Thu May 12 23:31:32 2011
New Revision: 51688
URL:
http://svn.reactos.org/svn/reactos?rev=51688&view=rev
Log:
[USBHUB_NEW]
- Only get the string descriptors if they are available. Fixes crash when using usb mouse
and keyboards in windows.
Modified:
branches/usb-bringup/drivers/usb/usbhub_new/fdo.c
Modified: branches/usb-bringup/drivers/usb/usbhub_new/fdo.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbhub_…
==============================================================================
--- branches/usb-bringup/drivers/usb/usbhub_new/fdo.c [iso-8859-1] (original)
+++ branches/usb-bringup/drivers/usb/usbhub_new/fdo.c [iso-8859-1] Thu May 12 23:31:32
2011
@@ -914,38 +914,44 @@
//
//
- // Get the product string
- //
- Status = GetUsbStringDescriptor(UsbChildDeviceObject,
- UsbChildExtension->DeviceDesc.iProduct,
- 0,
-
(PVOID*)&UsbChildExtension->usTextDescription.Buffer,
-
&UsbChildExtension->usTextDescription.Length);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("USBHUB: GetUsbStringDescriptor failed with status %x\n",
Status);
- goto Cleanup;
- }
-
- UsbChildExtension->usTextDescription.MaximumLength =
UsbChildExtension->usTextDescription.Length;
- DPRINT1("Usb TextDescription %wZ\n",
&UsbChildExtension->usTextDescription);
-
- //
- // Get the Serial Number string
- //
- Status = GetUsbStringDescriptor(UsbChildDeviceObject,
- UsbChildExtension->DeviceDesc.iSerialNumber,
- 0,
-
(PVOID*)&UsbChildExtension->usInstanceId.Buffer,
- &UsbChildExtension->usInstanceId.Length);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("USBHUB: GetUsbStringDescriptor failed with status %x\n",
Status);
- goto Cleanup;
- }
-
- UsbChildExtension->usInstanceId.MaximumLength =
UsbChildExtension->usInstanceId.Length;
- DPRINT1("Usb InstanceId %wZ\n", &UsbChildExtension->usInstanceId);
+ // Get the product string if obe provided
+ //
+ if (UsbChildExtension->DeviceDesc.iProduct)
+ {
+ Status = GetUsbStringDescriptor(UsbChildDeviceObject,
+ UsbChildExtension->DeviceDesc.iProduct,
+ 0,
+
(PVOID*)&UsbChildExtension->usTextDescription.Buffer,
+
&UsbChildExtension->usTextDescription.Length);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("USBHUB: GetUsbStringDescriptor failed with status %x\n",
Status);
+ goto Cleanup;
+ }
+
+ UsbChildExtension->usTextDescription.MaximumLength =
UsbChildExtension->usTextDescription.Length;
+ DPRINT1("Usb TextDescription %wZ\n",
&UsbChildExtension->usTextDescription);
+ }
+
+ //
+ // Get the Serial Number string if obe provided
+ //
+ if (UsbChildExtension->DeviceDesc.iSerialNumber)
+ {
+ Status = GetUsbStringDescriptor(UsbChildDeviceObject,
+ UsbChildExtension->DeviceDesc.iSerialNumber,
+ 0,
+
(PVOID*)&UsbChildExtension->usInstanceId.Buffer,
+ &UsbChildExtension->usInstanceId.Length);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("USBHUB: GetUsbStringDescriptor failed with status %x\n",
Status);
+ goto Cleanup;
+ }
+
+ UsbChildExtension->usInstanceId.MaximumLength =
UsbChildExtension->usInstanceId.Length;
+ DPRINT1("Usb InstanceId %wZ\n",
&UsbChildExtension->usInstanceId);
+ }
return Status;