From e2f1f39b52715f61b574f11d5e4de584d8b440b6 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Thu, 25 Oct 2007 08:10:59 -0700 Subject: [PATCH] setupapi: Include enumerator string as part of device instance ID. --- dlls/setupapi/devinst.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 531597d18c8..9f27333833c 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -2176,16 +2176,17 @@ static void SETUPDI_EnumerateMatchingDeviceInstances(struct DeviceInfoSet *set, if ((flags & DIGCF_ALLCLASSES) || IsEqualGUID(class, &deviceClass)) { - static const WCHAR fmt[] = {'%','s','\\','%','s',0}; + static const WCHAR fmt[] = + {'%','s','\\','%','s','\\','%','s',0}; LPWSTR instanceId; instanceId = HeapAlloc(GetProcessHeap(), 0, - (lstrlenW(deviceName) + - lstrlenW(deviceInstance) + 2) * sizeof(WCHAR)); + (lstrlenW(enumerator) + lstrlenW(deviceName) + + lstrlenW(deviceInstance) + 3) * sizeof(WCHAR)); if (instanceId) { - sprintfW(instanceId, fmt, deviceName, - deviceInstance); + sprintfW(instanceId, fmt, enumerator, + deviceName, deviceInstance); SETUPDI_AddDeviceToSet(set, &deviceClass, 0 /* FIXME: DevInst */, instanceId, FALSE, NULL);