mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[SETUPAPI] Create device interface related keys in case they don't exist yet (#9283)
In SetupDiCreateDeviceInterfaceRegKeyW(), force creating device and reference subkeys of device interface in Registry if they are not created yet. - Change RegOpenKeyExW() to RegCreateKeyExW() for device and reference subkeys. This properly fixes audio device name string improperly set in registry and displaying audio device name system-wide. Now it's properly written not only after re-installing audio driver from Device Manager, but also during 2nd setup stage, so it's correct just right after 1st boot. Addendum to1ef584c446andb205c04173. CORE-20603
This commit is contained in:
@@ -2716,8 +2716,8 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW(
|
||||
* as we don't need a ref part in key name. */
|
||||
SymbolicLink[Index + 1] = UNICODE_NULL;
|
||||
|
||||
/* Open device instance key */
|
||||
rc = RegOpenKeyExW(hKey, SymbolicLink, 0, samDesired, &hDevKey);
|
||||
/* Create device instance key */
|
||||
rc = RegCreateKeyExW(hKey, SymbolicLink, 0, NULL, 0, samDesired, NULL, &hDevKey, NULL);
|
||||
HeapFree(GetProcessHeap(), 0, SymbolicLink);
|
||||
RegCloseKey(hKey);
|
||||
if (rc != ERROR_SUCCESS)
|
||||
@@ -2727,8 +2727,8 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW(
|
||||
return INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
/* Open reference key */
|
||||
rc = RegOpenKeyExW(hDevKey, ReferenceString, 0, samDesired, &hRefKey);
|
||||
/* Create reference key */
|
||||
rc = RegCreateKeyExW(hDevKey, ReferenceString, 0, NULL, 0, samDesired, NULL, &hRefKey, NULL);
|
||||
HeapFree(GetProcessHeap(), 0, ReferenceString);
|
||||
RegCloseKey(hDevKey);
|
||||
if (rc != ERROR_SUCCESS)
|
||||
|
||||
Reference in New Issue
Block a user