Module: wine Branch: master Commit: 6a5c1ca25bd77fde9e825e31dca4d4cc0d1fea8a URL: http://source.winehq.org/git/wine.git/?a=commit;h=6a5c1ca25bd77fde9e825e31dc...
Author: Alexander Morozov amorozov@etersoft.ru Date: Tue Apr 1 14:25:01 2008 +0300
setupapi: Create device interface keys in registry as in Windows XP.
---
dlls/setupapi/devinst.c | 43 +++++++++++++++++++++++++++++++++---------- 1 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index e9c8124..ebfeee0 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -2631,21 +2631,44 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW( struct InterfaceInfo *ifaceInfo = (struct InterfaceInfo *)DeviceInterfaceData->Reserved; 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; - - l = RegCreateKeyExW(parent, instancePath, 0, NULL, 0, - samDesired, NULL, &key, NULL); - if (l) + 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) { - SetLastError(l); - key = INVALID_HANDLE_VALUE; + LONG l; + + 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) - FIXME("INF section installation unsupported\n"); + RegCloseKey(interfKey); } + else + SetLastError(l); + HeapFree(GetProcessHeap(), 0, interfKeyName); HeapFree(GetProcessHeap(), 0, instancePath); RegCloseKey(parent); }