From 37295e7c83b90de047b841bdf18f4d7d79a5ab6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 23 Oct 2005 11:35:58 +0000 Subject: [PATCH] Create and open device/driver registry keys with right access mask svn path=/trunk/; revision=18701 --- reactos/lib/setupapi/devinst.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/reactos/lib/setupapi/devinst.c b/reactos/lib/setupapi/devinst.c index 7870f7b05d2..8e6db21b5f0 100644 --- a/reactos/lib/setupapi/devinst.c +++ b/reactos/lib/setupapi/devinst.c @@ -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)