Commit 01315d52 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wineusb.sys: Implement hardware IDs.

parent a66d44b9
...@@ -288,6 +288,19 @@ static void get_device_id(const struct usb_device *device, WCHAR *buffer) ...@@ -288,6 +288,19 @@ static void get_device_id(const struct usb_device *device, WCHAR *buffer)
sprintfW(buffer, formatW, desc.idVendor, desc.idProduct); sprintfW(buffer, formatW, desc.idVendor, desc.idProduct);
} }
static void get_hardware_ids(const struct usb_device *device, WCHAR *buffer)
{
static const WCHAR formatW[] = {'U','S','B','\\','V','I','D','_','%','0','4','X',
'&','P','I','D','_','%','0','4','X','&','R','E','V','_','%','0','4','X',0};
struct libusb_device_descriptor desc;
libusb_get_device_descriptor(device->libusb_device, &desc);
buffer += sprintfW(buffer, formatW, desc.idVendor, desc.idProduct, desc.bcdDevice) + 1;
get_device_id(device, buffer);
buffer += strlenW(buffer) + 1;
*buffer = 0;
}
static NTSTATUS query_id(const struct usb_device *device, IRP *irp, BUS_QUERY_ID_TYPE type) static NTSTATUS query_id(const struct usb_device *device, IRP *irp, BUS_QUERY_ID_TYPE type)
{ {
WCHAR *id = NULL; WCHAR *id = NULL;
...@@ -307,6 +320,11 @@ static NTSTATUS query_id(const struct usb_device *device, IRP *irp, BUS_QUERY_ID ...@@ -307,6 +320,11 @@ static NTSTATUS query_id(const struct usb_device *device, IRP *irp, BUS_QUERY_ID
} }
break; break;
case BusQueryHardwareIDs:
if ((id = ExAllocatePool(PagedPool, (28 + 37 + 1) * sizeof(WCHAR))))
get_hardware_ids(device, id);
break;
default: default:
FIXME("Unhandled ID query type %#x.\n", type); FIXME("Unhandled ID query type %#x.\n", type);
return irp->IoStatus.Status; return irp->IoStatus.Status;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment