mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Create and open device/driver registry keys with right access mask
svn path=/trunk/; revision=18701
This commit is contained in:
parent
f821b2833d
commit
37295e7c83
1 changed files with 9 additions and 1 deletions
|
@ -3326,7 +3326,11 @@ HKEY WINAPI SetupDiCreateDevRegKeyW(
|
|||
0,
|
||||
NULL,
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
#if _WIN32_WINNT >= 0x502
|
||||
KEY_READ | KEY_WRITE,
|
||||
#else
|
||||
KEY_ALL_ACCESS,
|
||||
#endif
|
||||
NULL,
|
||||
&hKey,
|
||||
&Disposition);
|
||||
|
@ -5310,7 +5314,11 @@ SetupDiInstallDevice(
|
|||
lpFullGuidString[RequiredSize + 2] = '\0';
|
||||
|
||||
/* Open/Create driver key information */
|
||||
hKey = SetupDiOpenDevRegKey(DeviceInfoSet, DeviceInfoData, DICS_FLAG_GLOBAL, 0, DIREG_DRV, KEY_SET_VALUE);
|
||||
#if _WIN32_WINNT >= 0x502
|
||||
hKey = SetupDiOpenDevRegKey(DeviceInfoSet, DeviceInfoData, DICS_FLAG_GLOBAL, 0, DIREG_DRV, KEY_READ | KEY_WRITE);
|
||||
#else
|
||||
hKey = SetupDiOpenDevRegKey(DeviceInfoSet, DeviceInfoData, DICS_FLAG_GLOBAL, 0, DIREG_DRV, KEY_ALL_ACCESS);
|
||||
#endif
|
||||
if (hKey == INVALID_HANDLE_VALUE && GetLastError() == ERROR_FILE_NOT_FOUND)
|
||||
hKey = SetupDiCreateDevRegKeyW(DeviceInfoSet, DeviceInfoData, DICS_FLAG_GLOBAL, 0, DIREG_DRV, NULL, NULL);
|
||||
if (hKey == INVALID_HANDLE_VALUE)
|
||||
|
|
Loading…
Reference in a new issue