[PATCH v2 3/3] winebus.sys: Just report the bus ID when enumerating compatible IDs.
Zebediah Figura
zfigura at codeweavers.com
Tue Jun 4 12:45:22 CDT 2019
From: Zebediah Figura <z.figura12 at gmail.com>
It's the only one we actually match against.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
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;
+ WCHAR *dst;
- if (!(iid = get_instance_id(device)))
- return NULL;
-
- if (!(did = get_device_id(device)))
+ if ((dst = HeapAlloc(GetProcessHeap(), 0, (strlenW(ext->busid) + 2) * sizeof(WCHAR))))
{
- HeapFree(GetProcessHeap(), 0, iid);
- return NULL;
+ strcpyW(dst, ext->busid);
+ dst[strlenW(dst) + 1] = 0;
}
- len = strlenW(iid) + strlenW(did) + strlenW(ext->busid) + 4;
- if ((dst = HeapAlloc(GetProcessHeap(), 0, len * 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;
- }
-
- HeapFree(GetProcessHeap(), 0, iid);
- HeapFree(GetProcessHeap(), 0, did);
return dst;
}
--
2.7.4
More information about the wine-devel
mailing list