Zebediah Figura : winebus.sys: Just report the bus ID when enumerating compatible IDs.

Alexandre Julliard julliard at winehq.org
Tue Jun 4 16:28:14 CDT 2019


Module: wine
Branch: master
Commit: e83fd91d5ff08045697398ecf131e0abe6d6f3ec
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e83fd91d5ff08045697398ecf131e0abe6d6f3ec

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Tue Jun  4 12:45:22 2019 -0500

winebus.sys: Just report the bus ID when enumerating compatible IDs.

It's the only one we actually match against.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winebus.sys/main.c | 27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
index 291ec74..7207e14 100644
--- a/dlls/winebus.sys/main.c
+++ b/dlls/winebus.sys/main.c
@@ -195,33 +195,14 @@ static WCHAR *get_device_id(DEVICE_OBJECT *device)
 static WCHAR *get_compatible_ids(DEVICE_OBJECT *device)
 {
     struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
-    WCHAR *iid, *did, *dst, *ptr;
-    DWORD len;
-
-    if (!(iid = get_instance_id(device)))
-        return NULL;
-
-    if (!(did = get_device_id(device)))
-    {
-        HeapFree(GetProcessHeap(), 0, iid);
-        return NULL;
-    }
+    WCHAR *dst;
 
-    len = strlenW(iid) + strlenW(did) + strlenW(ext->busid) + 4;
-    if ((dst = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
+    if ((dst = HeapAlloc(GetProcessHeap(), 0, (strlenW(ext->busid) + 2) * sizeof(WCHAR))))
     {
-        ptr = dst;
-        strcpyW(ptr, iid);
-        ptr += strlenW(iid) + 1;
-        strcpyW(ptr, did);
-        ptr += strlenW(did) + 1;
-        strcpyW(ptr, ext->busid);
-        ptr += strlenW(ext->busid) + 1;
-        *ptr = 0;
+        strcpyW(dst, ext->busid);
+        dst[strlenW(dst) + 1] = 0;
     }
 
-    HeapFree(GetProcessHeap(), 0, iid);
-    HeapFree(GetProcessHeap(), 0, did);
     return dst;
 }
 




More information about the wine-cvs mailing list