setupapi: Create device interface keys in registry as in Windows XP.
This commit is contained in:
parent
b622101ef2
commit
6a5c1ca25b
|
@ -2631,12 +2631,30 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW(
|
||||||
struct InterfaceInfo *ifaceInfo =
|
struct InterfaceInfo *ifaceInfo =
|
||||||
(struct InterfaceInfo *)DeviceInterfaceData->Reserved;
|
(struct InterfaceInfo *)DeviceInterfaceData->Reserved;
|
||||||
PWSTR instancePath = SETUPDI_GetInstancePath(ifaceInfo);
|
PWSTR instancePath = SETUPDI_GetInstancePath(ifaceInfo);
|
||||||
|
PWSTR interfKeyName = HeapAlloc(GetProcessHeap(), 0,
|
||||||
|
(lstrlenW(ifaceInfo->symbolicLink) + 1) * sizeof(WCHAR));
|
||||||
|
HKEY interfKey;
|
||||||
|
WCHAR *ptr;
|
||||||
|
|
||||||
|
lstrcpyW(interfKeyName, ifaceInfo->symbolicLink);
|
||||||
|
if (lstrlenW(ifaceInfo->symbolicLink) > 3)
|
||||||
|
{
|
||||||
|
interfKeyName[0] = '#';
|
||||||
|
interfKeyName[1] = '#';
|
||||||
|
interfKeyName[3] = '#';
|
||||||
|
}
|
||||||
|
ptr = strchrW(interfKeyName, '\\');
|
||||||
|
if (ptr)
|
||||||
|
*ptr = 0;
|
||||||
|
l = RegCreateKeyExW(parent, interfKeyName, 0, NULL, 0,
|
||||||
|
samDesired, NULL, &interfKey, NULL);
|
||||||
|
if (!l)
|
||||||
|
{
|
||||||
if (instancePath)
|
if (instancePath)
|
||||||
{
|
{
|
||||||
LONG l;
|
LONG l;
|
||||||
|
|
||||||
l = RegCreateKeyExW(parent, instancePath, 0, NULL, 0,
|
l = RegCreateKeyExW(interfKey, instancePath, 0, NULL, 0,
|
||||||
samDesired, NULL, &key, NULL);
|
samDesired, NULL, &key, NULL);
|
||||||
if (l)
|
if (l)
|
||||||
{
|
{
|
||||||
|
@ -2646,6 +2664,11 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW(
|
||||||
else if (InfHandle)
|
else if (InfHandle)
|
||||||
FIXME("INF section installation unsupported\n");
|
FIXME("INF section installation unsupported\n");
|
||||||
}
|
}
|
||||||
|
RegCloseKey(interfKey);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
SetLastError(l);
|
||||||
|
HeapFree(GetProcessHeap(), 0, interfKeyName);
|
||||||
HeapFree(GetProcessHeap(), 0, instancePath);
|
HeapFree(GetProcessHeap(), 0, instancePath);
|
||||||
RegCloseKey(parent);
|
RegCloseKey(parent);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue