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

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

index 5a6d243869eb670deb92ff05e0bf4da757c874c0..235b04f033882ce418b2235a26d7a9ec1d0fe6ff 100644 (file)
@@ -148,7 +148,7 @@ __DriverGetFdo(
     return IsFdo;
 }
 
-#define MAXNAMELEN  128
+#define MAXNAMELEN  1024
 
 VOID
 DriverRequestReboot(
@@ -176,10 +176,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;