[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Create SettingsKey SubKeys if needed


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Mon, 24 Oct 2022 11:25:50 +0100
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Mon, 24 Oct 2022 10:26:04 +0000
  • Ironport-data: A9a23:dd7lB6IdUjL7gjAMFE//H55y9xWSRhNeGxNOi0AnO82iCwXC/D5+JTap8FxYKXLHAnKFQRCUKd8VXaBHv+i/NEmMm6Zy6n/ay50QCTAIHpg0VNh7+WbDZ5RAX3zZ3ZnLV9Oy0w4ltQIrCCOTmCbI1V5N6fvOEp1YpF133sKuDaPFrN3JdqnZfIS/G1HM/iGOO1Rz/AiBDdJlytl9AnN3bFwCiYNWqD1F/rSjSjOGZ+WUV86qd7b5fWE7gzhQ/BqkpMmct1OnIPL1VMfo5RoAPDtNZzB4Y+OdKctI9mEFj78cZGnAlvB7gt6exW0Gx9961PWQ2yCrvR4SNjz3/HPX6txUBga2AnUXfgSBgTzYUhpTCh/fE1kyl6aXwFLFRxBxfluNovDPgmxuhHgf6T3G3uHVM519dJ+SX72zXqEgchrPCAowu5xoxWaVxSrhj3DFVFpRy3ViyAxGxHGDxUwJ/NaMLJM7PncOFij1tEvUFzTvIXW1dNLPFoQeALZS2Pgm47R2ANs06DwmwyzhBYdlZEwDPfPVukBeVkWzh2ysQ+R/8W+F8e/gv1Li/WrfXfFxPWC7F1chPvxQ5/cIwAZZzYv+xyw/1MDqkxyedwsu80+mUDG1ql/o5Fmhm5Q5hDUUrJqNmYwE9wxKD+1OlS3C4fUVI56teJhGdS8z2Oi7S2FTl/D1oiA1jSv58oE1NsaEwxWzy7W3IUPL9DrMkz0nmDzkKd3YMkU251yvp6bNfVZsANLMmlk89NYfaFjI3bXsYY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aGStMwCm38YIeIvpfZQE49/skpZcZy6f7Ths/9dqu1r4zMrlVhWXlL/QEWBkll+YTGUSQsQeQBO+czH0FsYw9H/CIuOfrbFyuP1CIU5sAABG616iZc7j2/NG9EwwwKZDUqKHR/Qw9d+7x/8MfMdnWn8EWlSsoAzbB/otVcyV16kzcXzLEaLfX048GaTjhe42n6YaK5wRObtxpH4IEc9EZev1e8TpLc8M8OkWItEL4WY7C0JI2tWRKPBdeiVfFTly7RNOa7DA6C8bYXyrRU0fpmBxqfgWilPcMkp5nXWhemvpzR372riR3wki0XS8+znSVpkjSTlMrJLbJPEUb47+eMc9zZ96c6wdL+ZOmB1mvLme//db0kjGL7Ug76oFHbtu2C85+xNU5m7H+QtbY24fvGQvc9no46upYLzWxOeK7pfwB9RLJUXAz0LkI9jUbF7TsogjAE/eCECB4X7Jnq21sRFSUUFnkUQmDkiI819FZZs/mDazYkcdcvSX7pUHCOZmm9xBdSqXqkZrSknjSQ/b1QUWH7XMOTXev+UtVxymEhq9BmiEqj+uxpHj1BdmbNBrEL7jGZDS3ybPI6bVfzYN9LnEmTwgFCvbHV5uJzDtLw+0ElMByLcpQHkGpPcqjxhKRWAr2ZybR/ObIKZNkVqVHkUDIzRUQl9Bg3/++PlakV+zgR7sBQJ
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

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@xxxxxxxxxx>
---
 src/xenvif/settings.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/xenvif/settings.c b/src/xenvif/settings.c
index 7483ff3..876dc13 100644
--- a/src/xenvif/settings.c
+++ b/src/xenvif/settings.c
@@ -550,10 +550,10 @@ SettingsSave(
 
     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;
 
@@ -593,7 +593,7 @@ fail2:
     RtlFreeAnsiString(&Ansi);
 
 fail1:
-    Error("fail1\n", status);
+    Error("fail1 (%08x)\n", status);
 
     return status;
 }
@@ -688,7 +688,7 @@ fail2:
     RegistryCloseKey(SubKey);
 
 fail1:
-    Error("fail1\n", status);
+    Error("fail1 (%08x)\n", status);
 
     return status;
 }
-- 
2.32.0.windows.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.