setupapi: Add a check of "#" for interface subkey names.
This commit is contained in:
parent
2ea559b8b2
commit
bae4ebb7d7
|
@ -1986,21 +1986,24 @@ static void SETUPDI_AddDeviceInterfaces(SP_DEVINFO_DATA *dev, HKEY key,
|
||||||
HKEY subKey;
|
HKEY subKey;
|
||||||
SP_DEVICE_INTERFACE_DATA *iface = NULL;
|
SP_DEVICE_INTERFACE_DATA *iface = NULL;
|
||||||
|
|
||||||
/* The subkey name is the reference string, with a '#' prepended */
|
if (*subKeyName == '#')
|
||||||
SETUPDI_AddInterfaceInstance(dev, interface, subKeyName + 1,
|
|
||||||
&iface);
|
|
||||||
l = RegOpenKeyExW(key, subKeyName, 0, KEY_READ, &subKey);
|
|
||||||
if (!l)
|
|
||||||
{
|
{
|
||||||
WCHAR symbolicLink[MAX_PATH];
|
/* The subkey name is the reference string, with a '#' prepended */
|
||||||
DWORD dataType;
|
SETUPDI_AddInterfaceInstance(dev, interface, subKeyName + 1,
|
||||||
|
&iface);
|
||||||
|
l = RegOpenKeyExW(key, subKeyName, 0, KEY_READ, &subKey);
|
||||||
|
if (!l)
|
||||||
|
{
|
||||||
|
WCHAR symbolicLink[MAX_PATH];
|
||||||
|
DWORD dataType;
|
||||||
|
|
||||||
len = sizeof(symbolicLink);
|
len = sizeof(symbolicLink);
|
||||||
l = RegQueryValueExW(subKey, SymbolicLink, NULL, &dataType,
|
l = RegQueryValueExW(subKey, SymbolicLink, NULL, &dataType,
|
||||||
(BYTE *)symbolicLink, &len);
|
(BYTE *)symbolicLink, &len);
|
||||||
if (!l && dataType == REG_SZ)
|
if (!l && dataType == REG_SZ)
|
||||||
SETUPDI_SetInterfaceSymbolicLink(iface, symbolicLink);
|
SETUPDI_SetInterfaceSymbolicLink(iface, symbolicLink);
|
||||||
RegCloseKey(subKey);
|
RegCloseKey(subKey);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* Allow enumeration to continue */
|
/* Allow enumeration to continue */
|
||||||
l = ERROR_SUCCESS;
|
l = ERROR_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue