]> xenbits.xensource.com Git - people/pauldu/xenvif.git/commitdiff
Create, rather than open, the RequestKey
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 17 Aug 2016 13:32:52 +0000 (14:32 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Wed, 17 Aug 2016 13:32:52 +0000 (14:32 +0100)
It's possible that, on upgrade, XENVIF is installed before XENBUS and so
the RequestKey may not exist.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenvif/driver.c

index db17f2e148c2a41c97ef10e504c73debc3b06f27..ded713805f9e59ddca044b4f272a78bbb1d49599 100644 (file)
@@ -142,7 +142,7 @@ DriverGetAddressesKey(
     return __DriverGetAddressesKey();
 }
 
-#define MAXNAMELEN  128
+#define MAXNAMELEN  1024
 
 static FORCEINLINE VOID
 __DriverRequestReboot(
@@ -172,10 +172,10 @@ __DriverRequestReboot(
                                 &Ansi[0]);
     ASSERT(NT_SUCCESS(status));
 
-    status = RegistryOpenSubKey(NULL,
-                                RequestKeyName,
-                                KEY_ALL_ACCESS,
-                                &RequestKey);
+    status = RegistryCreateSubKey(NULL,
+                                  RequestKeyName,
+                                  REG_OPTION_NON_VOLATILE,
+                                  &RequestKey);
     if (!NT_SUCCESS(status))
         goto fail2;