Commit f39adfe9 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winebus.sys: Make the device and instance IDs consistent.

parent 6e999b4a
...@@ -168,13 +168,26 @@ static WCHAR *get_instance_id(DEVICE_OBJECT *device) ...@@ -168,13 +168,26 @@ static WCHAR *get_instance_id(DEVICE_OBJECT *device)
static WCHAR *get_device_id(DEVICE_OBJECT *device) static WCHAR *get_device_id(DEVICE_OBJECT *device)
{ {
static const WCHAR formatW[] = {'%','s','\\','V','i','d','_','%','0','4','x','&','P','i','d','_','%','0','4','x',0}; static const WCHAR formatW[] = {'%','s','\\','v','i','d','_','%','0','4','x',
'&','p','i','d','_','%','0','4','x',0};
static const WCHAR format_inputW[] = {'%','s','\\','v','i','d','_','%','0','4','x',
'&','p','i','d','_','%','0','4','x','&','%','s','_','%','i',0};
struct device_extension *ext = (struct device_extension *)device->DeviceExtension; struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
DWORD len = strlenW(ext->busid) + 19; DWORD len = strlenW(ext->busid) + 34;
WCHAR *dst; WCHAR *dst;
if ((dst = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) if ((dst = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
{
if (ext->input == (WORD)-1)
{
sprintfW(dst, formatW, ext->busid, ext->vid, ext->pid); sprintfW(dst, formatW, ext->busid, ext->vid, ext->pid);
}
else
{
sprintfW(dst, format_inputW, ext->busid, ext->vid, ext->pid,
ext->is_gamepad ? igW : miW, ext->input);
}
}
return dst; return dst;
} }
......
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