mirror of
https://github.com/reactos/reactos.git
synced 2024-09-08 19:59:49 +00:00
[USBHUB_NEW]
- Only get the string descriptors if they are available. Fixes crash when using usb mouse and keyboards in windows. svn path=/branches/usb-bringup/; revision=51688
This commit is contained in:
parent
76310d7679
commit
9d7751a2f6
|
@ -914,38 +914,44 @@ CreateDeviceIds(
|
||||||
//
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the product string
|
// Get the product string if obe provided
|
||||||
//
|
//
|
||||||
Status = GetUsbStringDescriptor(UsbChildDeviceObject,
|
if (UsbChildExtension->DeviceDesc.iProduct)
|
||||||
UsbChildExtension->DeviceDesc.iProduct,
|
|
||||||
0,
|
|
||||||
(PVOID*)&UsbChildExtension->usTextDescription.Buffer,
|
|
||||||
&UsbChildExtension->usTextDescription.Length);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
{
|
||||||
DPRINT1("USBHUB: GetUsbStringDescriptor failed with status %x\n", Status);
|
Status = GetUsbStringDescriptor(UsbChildDeviceObject,
|
||||||
goto Cleanup;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
UsbChildExtension->usTextDescription.MaximumLength = UsbChildExtension->usTextDescription.Length;
|
|
||||||
DPRINT1("Usb TextDescription %wZ\n", &UsbChildExtension->usTextDescription);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the Serial Number string
|
// Get the Serial Number string if obe provided
|
||||||
//
|
//
|
||||||
Status = GetUsbStringDescriptor(UsbChildDeviceObject,
|
if (UsbChildExtension->DeviceDesc.iSerialNumber)
|
||||||
UsbChildExtension->DeviceDesc.iSerialNumber,
|
|
||||||
0,
|
|
||||||
(PVOID*)&UsbChildExtension->usInstanceId.Buffer,
|
|
||||||
&UsbChildExtension->usInstanceId.Length);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
{
|
||||||
DPRINT1("USBHUB: GetUsbStringDescriptor failed with status %x\n", Status);
|
Status = GetUsbStringDescriptor(UsbChildDeviceObject,
|
||||||
goto Cleanup;
|
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;
|
UsbChildExtension->usInstanceId.MaximumLength = UsbChildExtension->usInstanceId.Length;
|
||||||
DPRINT1("Usb InstanceId %wZ\n", &UsbChildExtension->usInstanceId);
|
DPRINT1("Usb InstanceId %wZ\n", &UsbChildExtension->usInstanceId);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue