From f39adfe914f7503df0474bfed5d802f24b20dd48 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Tue, 4 Jun 2019 12:45:21 -0500 Subject: [PATCH] winebus.sys: Make the device and instance IDs consistent. Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/winebus.sys/main.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index 73e31549ff4..291ec7424f6 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -168,13 +168,26 @@ static WCHAR *get_instance_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; - DWORD len = strlenW(ext->busid) + 19; + DWORD len = strlenW(ext->busid) + 34; WCHAR *dst; if ((dst = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) - sprintfW(dst, formatW, ext->busid, ext->vid, ext->pid); + { + if (ext->input == (WORD)-1) + { + 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; }