Use RegistryCreateSubKey to create the settings key, if it does not exist,
when attempting to save the current settings. The SettingsKey's sub keys do
not exist when first installing drivers from emulated devices. This is only
an issue when the emulated devices have had network settings applied before
installing the PV drivers.
Also adds NTSTATUS values to error path logging.
Signed-off-by: Owen Smith <owen.smith@citrix.com>
SettingsKey = DriverGetSettingsKey();
- status = RegistryOpenSubKey(SettingsKey,
- SubKeyName,
- KEY_ALL_ACCESS,
- &SubKey);
+ status = RegistryCreateSubKey(SettingsKey,
+ SubKeyName,
+ REG_OPTION_NON_VOLATILE,
+ &SubKey);
if (!NT_SUCCESS(status))
goto fail2;
RtlFreeAnsiString(&Ansi);
fail1:
- Error("fail1\n", status);
+ Error("fail1 (%08x)\n", status);
return status;
}
RegistryCloseKey(SubKey);
fail1:
- Error("fail1\n", status);
+ Error("fail1 (%08x)\n", status);
return status;
}