Commit 6a5c1ca2 authored by Alexander Morozov's avatar Alexander Morozov Committed by Alexandre Julliard

setupapi: Create device interface keys in registry as in Windows XP.

parent b622101e
...@@ -2631,21 +2631,44 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW( ...@@ -2631,21 +2631,44 @@ 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;
if (instancePath) lstrcpyW(interfKeyName, ifaceInfo->symbolicLink);
if (lstrlenW(ifaceInfo->symbolicLink) > 3)
{ {
LONG l; interfKeyName[0] = '#';
interfKeyName[1] = '#';
l = RegCreateKeyExW(parent, instancePath, 0, NULL, 0, interfKeyName[3] = '#';
samDesired, NULL, &key, NULL); }
if (l) ptr = strchrW(interfKeyName, '\\');
if (ptr)
*ptr = 0;
l = RegCreateKeyExW(parent, interfKeyName, 0, NULL, 0,
samDesired, NULL, &interfKey, NULL);
if (!l)
{
if (instancePath)
{ {
SetLastError(l); LONG l;
key = INVALID_HANDLE_VALUE;
l = RegCreateKeyExW(interfKey, instancePath, 0, NULL, 0,
samDesired, NULL, &key, NULL);
if (l)
{
SetLastError(l);
key = INVALID_HANDLE_VALUE;
}
else if (InfHandle)
FIXME("INF section installation unsupported\n");
} }
else if (InfHandle) RegCloseKey(interfKey);
FIXME("INF section installation unsupported\n");
} }
else
SetLastError(l);
HeapFree(GetProcessHeap(), 0, interfKeyName);
HeapFree(GetProcessHeap(), 0, instancePath); HeapFree(GetProcessHeap(), 0, instancePath);
RegCloseKey(parent); RegCloseKey(parent);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment