From: Paul Durrant Date: Wed, 17 Aug 2016 13:32:52 +0000 (+0100) Subject: Create, rather than open, the RequestKey X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=5ec87e25a7139a8e5e905f2b65026de1d68c7c6f;p=people%2Fpauldu%2Fxenvif.git Create, rather than open, the RequestKey It's possible that, on upgrade, XENVIF is installed before XENBUS and so the RequestKey may not exist. Signed-off-by: Paul Durrant --- diff --git a/src/xenvif/driver.c b/src/xenvif/driver.c index db17f2e..ded7138 100644 --- a/src/xenvif/driver.c +++ b/src/xenvif/driver.c @@ -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;