mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
Try to open driver registry key before creating it.
Fixes bug 977 svn path=/trunk/; revision=19186
This commit is contained in:
parent
035f7342cb
commit
bcd8352715
1 changed files with 7 additions and 1 deletions
|
@ -210,7 +210,13 @@ NetClassInstaller(
|
|||
hKey = INVALID_HANDLE_VALUE;
|
||||
|
||||
/* Write 'Linkage' key in hardware key */
|
||||
hKey = SetupDiCreateDevRegKeyW(DeviceInfoSet, DeviceInfoData, DICS_FLAG_GLOBAL, 0, DIREG_DRV, NULL, NULL);
|
||||
#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)
|
||||
{
|
||||
rc = GetLastError();
|
||||
|
|
Loading…
Reference in a new issue