Create and open device/driver registry keys with right access mask

svn path=/trunk/; revision=18701
This commit is contained in:
Hervé Poussineau 2005-10-23 11:35:58 +00:00
parent f821b2833d
commit 37295e7c83

View file

@ -3326,7 +3326,11 @@ HKEY WINAPI SetupDiCreateDevRegKeyW(
0, 0,
NULL, NULL,
REG_OPTION_NON_VOLATILE, REG_OPTION_NON_VOLATILE,
#if _WIN32_WINNT >= 0x502
KEY_READ | KEY_WRITE, KEY_READ | KEY_WRITE,
#else
KEY_ALL_ACCESS,
#endif
NULL, NULL,
&hKey, &hKey,
&Disposition); &Disposition);
@ -5310,7 +5314,11 @@ SetupDiInstallDevice(
lpFullGuidString[RequiredSize + 2] = '\0'; lpFullGuidString[RequiredSize + 2] = '\0';
/* Open/Create driver key information */ /* 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) if (hKey == INVALID_HANDLE_VALUE && GetLastError() == ERROR_FILE_NOT_FOUND)
hKey = SetupDiCreateDevRegKeyW(DeviceInfoSet, DeviceInfoData, DICS_FLAG_GLOBAL, 0, DIREG_DRV, NULL, NULL); hKey = SetupDiCreateDevRegKeyW(DeviceInfoSet, DeviceInfoData, DICS_FLAG_GLOBAL, 0, DIREG_DRV, NULL, NULL);
if (hKey == INVALID_HANDLE_VALUE) if (hKey == INVALID_HANDLE_VALUE)