mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[SETUPAPI] SetupDiCreateDevRegKeyW / SetupDiOpenDevRegKey: Create or open the 'Device Parameters' subkey of the given devices enum key when we try to access its hardware key.
This creates the PortName value in the proper location for serial ports.
This commit is contained in:
parent
e32a2cc026
commit
de08785ade
1 changed files with 33 additions and 0 deletions
|
@ -1515,6 +1515,27 @@ HKEY WINAPI SetupDiCreateDevRegKeyW(
|
|||
SetLastError(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (Scope == DICS_FLAG_GLOBAL)
|
||||
{
|
||||
HKEY hTempKey = hKey;
|
||||
|
||||
rc = RegCreateKeyExW(hTempKey,
|
||||
L"Device Parameters",
|
||||
0,
|
||||
NULL,
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
#if _WIN32_WINNT >= 0x502
|
||||
KEY_READ | KEY_WRITE,
|
||||
#else
|
||||
KEY_ALL_ACCESS,
|
||||
#endif
|
||||
NULL,
|
||||
&hKey,
|
||||
NULL);
|
||||
if (rc == ERROR_SUCCESS)
|
||||
RegCloseKey(hTempKey);
|
||||
}
|
||||
}
|
||||
else /* KeyType == DIREG_DRV */
|
||||
{
|
||||
|
@ -5905,6 +5926,18 @@ HKEY WINAPI SetupDiOpenDevRegKey(
|
|||
{
|
||||
case DIREG_DEV:
|
||||
key = SETUPDI_OpenDevKey(RootKey, devInfo, samDesired);
|
||||
if (Scope == DICS_FLAG_GLOBAL)
|
||||
{
|
||||
LONG rc;
|
||||
HKEY hTempKey = key;
|
||||
rc = RegOpenKeyExW(hTempKey,
|
||||
L"Device Parameters",
|
||||
0,
|
||||
samDesired,
|
||||
&key);
|
||||
if (rc == ERROR_SUCCESS)
|
||||
RegCloseKey(hTempKey);
|
||||
}
|
||||
break;
|
||||
case DIREG_DRV:
|
||||
key = SETUPDI_OpenDrvKey(RootKey, devInfo, samDesired);
|
||||
|
|
Loading…
Reference in a new issue