From win-pv-devel-bounces@lists.xenproject.org Mon Jul 01 09:55:47 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 01 Jul 2024 09:55:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.751441.1159416 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sODlB-0006sa-Rl; Mon, 01 Jul 2024 09:55:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 751441.1159416; Mon, 01 Jul 2024 09:55:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sODlB-0006sT-Og; Mon, 01 Jul 2024 09:55:45 +0000
Received: by outflank-mailman (input) for mailman id 751441;
 Mon, 01 Jul 2024 09:55:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TmLj=OB=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sODl9-0006Qo-Pl
 for win-pv-devel@lists.xenproject.org; Mon, 01 Jul 2024 09:55:43 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 13c35d8a-3790-11ef-90a4-e314d9c70b13;
 Mon, 01 Jul 2024 11:55:42 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-52cd628f21cso2900616e87.3
 for <win-pv-devel@lists.xenproject.org>; Mon, 01 Jul 2024 02:55:41 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 13c35d8a-3790-11ef-90a4-e314d9c70b13
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1719827741; x=1720432541; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=vYg70dn6DuR94TqSz2D9uBxEymCxCM82QmXjVOO/I+U=;
        b=UD7jcIe4KTnck4pSnyaaaPQ2NmWcH+NmOtW4IjqxIYDxn0HDfCs7s1ognCmN9DivhH
         J2KnvrQ/FLs8kTKejeADKaGbcGY82nQR6zk5pMjztN1qqTTdEc67SAaG/niS+WPeS1Ys
         p8eQ+2wIJarweSFY9YwTHlU5i/ch/G+6Fn6mI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1719827741; x=1720432541;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=vYg70dn6DuR94TqSz2D9uBxEymCxCM82QmXjVOO/I+U=;
        b=nPCzA9hIwEFXm6mGPAv+RxghUxVGRHwr2TwnD1MCvzHhVmlYbM9cZXA3Yk+BdCaleG
         BYFF6z2Z4t/ltNfQm1czCOKk7T4GrCYA+VXiFYMh0j4LKfXKw6EDNgeF8ddVHyW4JM7O
         aZ7n/q/GKYr+FILA3FuphL5mbsmr19W0deNHbQLXEkWVbHCJK4vqIxMyl21ElbvqmBw5
         1r38695c2bA0AcISO91QfspD+6eJSirI7dLphAHb6YsxE/NihPOxNzXmNpOpFsAURUSf
         SqCLz8a71ZSFitepqsmI9haNXu/wvofcK8LkR+vTon+kwj0xizfR/kpGps4bvrIAOn3+
         0cKA==
X-Gm-Message-State: AOJu0YwZIbFYZfbglqgkdVGQDjSQ6cAMaovD21WtUxXK6ZYSGG21Yjrw
	lne+n3nZ5WkgsWm506A9BJ8ZvvCqHA7k9vAMnWakNFEeCp32hWRVY7O6ubb4mKDdgBNkOCz3DQL
	MXUXGkn4XdFlnnNGblGSzzWPwv8vjYlRL3wZn
X-Google-Smtp-Source: AGHT+IEvvDdQoY2AJ8NLNuE715qd3QBECGT6+eA94rnfpr797EUIOo+0/BkXco2eV6leeJZ5lIBBuqyxcXsNX6KP+mI=
X-Received: by 2002:a05:6512:2814:b0:52d:b0a5:cf3c with SMTP id
 2adb3069b0e04-52e8268edb5mr3434612e87.40.1719827741168; Mon, 01 Jul 2024
 02:55:41 -0700 (PDT)
MIME-Version: 1.0
References: <20240607071700.1272-1-owen.smith@cloud.com> <20240607071700.1272-2-owen.smith@cloud.com>
 <9d3a92f1-58ec-4976-8d2d-aa17d0353a37@gmail.com>
In-Reply-To: <9d3a92f1-58ec-4976-8d2d-aa17d0353a37@gmail.com>
From: Owen Smith <owen.smith@citrix.com>
Date: Mon, 1 Jul 2024 10:55:30 +0100
Message-ID: <CAC_UY89TYdh=WzbkKgHcSJ3Bsskvb=mGUEJiMTEVUL-H4yoO9w@mail.gmail.com>
Subject: Re: [RFC PATCH 1/5] Add RegistryOpenParametersKey
To: paul@xen.org
Cc: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="00000000000096735d061c2c99a6"

--00000000000096735d061c2c99a6
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

There is an issue with Server 2016... the IoOpenDriverRegistryKey API is
not available, so the driver image does not load. Will probably need a
#define to keep a method that works for Server 2016, and introduces the new
way for Server 2025.

Owen

On Sat, Jun 29, 2024 at 4:40=E2=80=AFPM Durrant, Paul <xadimgnik@gmail.com>=
 wrote:

> On 07/06/2024 08:16, Owen Smith wrote:
> > Use IoOpenDriverRegistryKey to avoid opening an absolute registry path.
> > Driver Verifier can detect registry isolation violations when running
> WHQL
> > tests on Server 2025. The rule states that a driver may not open an
> absolute
> > registry key path. Use the specific API to open the 'Parameters' key wi=
th
> > KEY_READ when querying settings.
> >
> > Signed-off-by: Owen Smith <owen.smith@cloud.com>
> > ---
> >   src/common/registry.c | 22 +++++++++++++++++++++-
> >   src/common/registry.h |  9 ++++++++-
> >   src/xen/driver.c      |  2 +-
> >   src/xenbus/driver.c   | 19 ++-----------------
> >   src/xenfilt/driver.c  | 33 +++------------------------------
> >   5 files changed, 35 insertions(+), 50 deletions(-)
> >
> > diff --git a/src/common/registry.c b/src/common/registry.c
> > index 0d29ddc..73a55d2 100644
> > --- a/src/common/registry.c
> > +++ b/src/common/registry.c
> > @@ -38,6 +38,7 @@
> >
> >   #define REGISTRY_TAG 'GERX'
> >
> > +static PDRIVER_OBJECT   DriverObject;
> >   static UNICODE_STRING   RegistryPath;
> >
> >   static FORCEINLINE PVOID
> > @@ -58,7 +59,8 @@ __RegistryFree(
> >
> >   NTSTATUS
> >   RegistryInitialize(
> > -    IN PUNICODE_STRING  Path
> > +    IN  PDRIVER_OBJECT  DrvObj,
> > +    IN  PUNICODE_STRING Path
>
> Acked-by: Paul Durrant <paul@xen.org>
>
> ... but I don't like the 'DrvObj' thing.... I'll call it 'DriverObject'
> and change the global to 'RegistryDriverObject'.
>
> >       )
> >   {
> >       NTSTATUS            status;
> > @@ -69,6 +71,9 @@ RegistryInitialize(
> >       if (!NT_SUCCESS(status))
> >           goto fail1;
> >
> > +    ASSERT3P(DriverObject, =3D=3D, NULL);
> > +    DriverObject =3D DrvObj;
> > +
> >       return STATUS_SUCCESS;
> >
> >   fail1:
> > @@ -82,11 +87,26 @@ RegistryTeardown(
> >       VOID
> >       )
> >   {
> > +    DriverObject =3D NULL;
> > +
> >       RtlFreeUnicodeString(&RegistryPath);
> >       RegistryPath.Buffer =3D NULL;
> >       RegistryPath.MaximumLength =3D RegistryPath.Length =3D 0;
> >   }
> >
> > +NTSTATUS
> > +RegistryOpenParametersKey(
> > +    IN  ACCESS_MASK     DesiredAccess,
> > +    OUT PHANDLE         Key
> > +    )
> > +{
> > +    return IoOpenDriverRegistryKey(DriverObject,
> > +                                   DriverRegKeyParameters,
> > +                                   DesiredAccess,
> > +                                   0,
> > +                                   Key);
> > +}
> > +
> >   NTSTATUS
> >   RegistryOpenKey(
> >       IN  HANDLE          Parent,
> > diff --git a/src/common/registry.h b/src/common/registry.h
> > index cbe9015..efa96ea 100644
> > --- a/src/common/registry.h
> > +++ b/src/common/registry.h
> > @@ -37,7 +37,8 @@
> >
> >   extern NTSTATUS
> >   RegistryInitialize(
> > -    IN PUNICODE_STRING  Path
> > +    IN  PDRIVER_OBJECT  DrvObj,
> > +    IN  PUNICODE_STRING Path
> >       );
> >
> >   extern VOID
> > @@ -45,6 +46,12 @@ RegistryTeardown(
> >       VOID
> >       );
> >
> > +extern NTSTATUS
> > +RegistryOpenParametersKey(
> > +    IN  ACCESS_MASK     DesiredAccess,
> > +    OUT PHANDLE         Key
> > +    );
> > +
> >   extern NTSTATUS
> >   RegistryOpenKey(
> >       IN  HANDLE          Parent,
> > diff --git a/src/xen/driver.c b/src/xen/driver.c
> > index 8fe6c5c..e04a772 100644
> > --- a/src/xen/driver.c
> > +++ b/src/xen/driver.c
> > @@ -515,7 +515,7 @@ DllInitialize(
> >       if (!NT_SUCCESS(status))
> >           goto fail1;
> >
> > -    status =3D RegistryInitialize(RegistryPath);
> > +    status =3D RegistryInitialize(NULL, RegistryPath);
> >       if (!NT_SUCCESS(status))
> >           goto fail2;
> >
> > diff --git a/src/xenbus/driver.c b/src/xenbus/driver.c
> > index 522acef..d6efe89 100644
> > --- a/src/xenbus/driver.c
> > +++ b/src/xenbus/driver.c
> > @@ -811,7 +811,6 @@ DriverEntry(
> >       IN  PUNICODE_STRING RegistryPath
> >       )
> >   {
> > -    HANDLE              ServiceKey;
> >       HANDLE              ParametersKey;
> >       ULONG               Index;
> >       LOG_LEVEL           LogLevel;
> > @@ -839,21 +838,14 @@ DriverEntry(
> >            MONTH,
> >            YEAR);
> >
> > -    status =3D RegistryInitialize(RegistryPath);
> > +    status =3D RegistryInitialize(DriverObject, RegistryPath);
> >       if (!NT_SUCCESS(status))
> >           goto fail1;
> >
> > -    status =3D RegistryOpenServiceKey(KEY_READ, &ServiceKey);
> > +    status =3D RegistryOpenParametersKey(KEY_READ, &ParametersKey);
> >       if (!NT_SUCCESS(status))
> >           goto fail2;
> >
> > -    status =3D RegistryOpenSubKey(ServiceKey,
> > -                                "Parameters",
> > -                                KEY_READ,
> > -                                &ParametersKey);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail3;
> > -
> >       __DriverSetParametersKey(ParametersKey);
> >
> >       status =3D LogReadLogLevel(ParametersKey,
> > @@ -864,8 +856,6 @@ DriverEntry(
> >
> >       __DriverSetConsoleLogLevel(LogLevel);
> >
> > -    RegistryCloseKey(ServiceKey);
> > -
> >       status =3D XenTouch(__MODULE__,
> >                         MAJOR_VERSION,
> >                         MINOR_VERSION,
> > @@ -900,11 +890,6 @@ done:
> >
> >       return STATUS_SUCCESS;
> >
> > -fail3:
> > -    Error("fail3\n");
> > -
> > -    RegistryCloseKey(ServiceKey);
> > -
> >   fail2:
> >       Error("fail2\n");
> >
> > diff --git a/src/xenfilt/driver.c b/src/xenfilt/driver.c
> > index 724d418..aee663a 100644
> > --- a/src/xenfilt/driver.c
> > +++ b/src/xenfilt/driver.c
> > @@ -113,33 +113,6 @@ DriverGetDriverObject(
> >       return __DriverGetDriverObject();
> >   }
> >
> > -static FORCEINLINE NTSTATUS
> > -__DriverOpenParametersKey(
> > -    OUT PHANDLE     ParametersKey
> > -    )
> > -{
> > -    HANDLE          ServiceKey;
> > -    NTSTATUS        status;
> > -
> > -    status =3D RegistryOpenServiceKey(KEY_READ, &ServiceKey);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail1;
> > -
> > -    status =3D RegistryOpenSubKey(ServiceKey, "Parameters", KEY_READ,
> ParametersKey);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail2;
> > -
> > -    RegistryCloseKey(ServiceKey);
> > -
> > -    return STATUS_SUCCESS;
> > -
> > -fail2:
> > -    RegistryCloseKey(ServiceKey);
> > -
> > -fail1:
> > -    return status;
> > -}
> > -
> >   static FORCEINLINE VOID
> >   __DriverSetEmulatedContext(
> >       IN  PXENFILT_EMULATED_CONTEXT   Context
> > @@ -247,7 +220,7 @@ __DriverGetActive(
> >
> >       ASSERT3U(KeGetCurrentIrql(), =3D=3D, PASSIVE_LEVEL);
> >
> > -    status =3D __DriverOpenParametersKey(&ParametersKey);
> > +    status =3D RegistryOpenParametersKey(KEY_READ, &ParametersKey);
> >       if (!NT_SUCCESS(status))
> >           goto fail1;
> >
> > @@ -752,7 +725,7 @@ DriverGetEmulatedType(
> >       ULONG                           Index;
> >       NTSTATUS                        status;
> >
> > -    status =3D __DriverOpenParametersKey(&ParametersKey);
> > +    status =3D RegistryOpenParametersKey(KEY_READ, &ParametersKey);
> >       if (!NT_SUCCESS(status))
> >           goto fail1;
> >
> > @@ -947,7 +920,7 @@ DriverEntry(
> >       if (!NT_SUCCESS(status))
> >           goto done;
> >
> > -    status =3D RegistryInitialize(RegistryPath);
> > +    status =3D RegistryInitialize(DriverObject, RegistryPath);
> >       if (!NT_SUCCESS(status))
> >           goto fail1;
> >
>
>
>

--00000000000096735d061c2c99a6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e">There is an issue with Server 2016... the IoOpenDriverRegistryKey API is=
 not available, so the driver image does not load. Will probably need a #de=
fine to keep a method that works for Server 2016, and introduces the new wa=
y for Server 2025.</div><div class=3D"gmail_default" style=3D"font-family:m=
onospace"><br></div><div class=3D"gmail_default" style=3D"font-family:monos=
pace">Owen</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=
=3D"gmail_attr">On Sat, Jun 29, 2024 at 4:40=E2=80=AFPM Durrant, Paul &lt;<=
a href=3D"mailto:xadimgnik@gmail.com">xadimgnik@gmail.com</a>&gt; wrote:<br=
></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;=
border-left:1px solid rgb(204,204,204);padding-left:1ex">On 07/06/2024 08:1=
6, Owen Smith wrote:<br>
&gt; Use IoOpenDriverRegistryKey to avoid opening an absolute registry path=
.<br>
&gt; Driver Verifier can detect registry isolation violations when running =
WHQL<br>
&gt; tests on Server 2025. The rule states that a driver may not open an ab=
solute<br>
&gt; registry key path. Use the specific API to open the &#39;Parameters&#3=
9; key with<br>
&gt; KEY_READ when querying settings.<br>
&gt; <br>
&gt; Signed-off-by: Owen Smith &lt;<a href=3D"mailto:owen.smith@cloud.com" =
target=3D"_blank">owen.smith@cloud.com</a>&gt;<br>
&gt; ---<br>
&gt;=C2=A0 =C2=A0src/common/registry.c | 22 +++++++++++++++++++++-<br>
&gt;=C2=A0 =C2=A0src/common/registry.h |=C2=A0 9 ++++++++-<br>
&gt;=C2=A0 =C2=A0src/xen/driver.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 +-<br>
&gt;=C2=A0 =C2=A0src/xenbus/driver.c=C2=A0 =C2=A0| 19 ++-----------------<b=
r>
&gt;=C2=A0 =C2=A0src/xenfilt/driver.c=C2=A0 | 33 +++-----------------------=
-------<br>
&gt;=C2=A0 =C2=A05 files changed, 35 insertions(+), 50 deletions(-)<br>
&gt; <br>
&gt; diff --git a/src/common/registry.c b/src/common/registry.c<br>
&gt; index 0d29ddc..73a55d2 100644<br>
&gt; --- a/src/common/registry.c<br>
&gt; +++ b/src/common/registry.c<br>
&gt; @@ -38,6 +38,7 @@<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0#define REGISTRY_TAG &#39;GERX&#39;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +static PDRIVER_OBJECT=C2=A0 =C2=A0DriverObject;<br>
&gt;=C2=A0 =C2=A0static UNICODE_STRING=C2=A0 =C2=A0RegistryPath;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0static FORCEINLINE PVOID<br>
&gt; @@ -58,7 +59,8 @@ __RegistryFree(<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0NTSTATUS<br>
&gt;=C2=A0 =C2=A0RegistryInitialize(<br>
&gt; -=C2=A0 =C2=A0 IN PUNICODE_STRING=C2=A0 Path<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PDRIVER_OBJECT=C2=A0 DrvObj,<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PUNICODE_STRING Path<br>
<br>
Acked-by: Paul Durrant &lt;<a href=3D"mailto:paul@xen.org" target=3D"_blank=
">paul@xen.org</a>&gt;<br>
<br>
... but I don&#39;t like the &#39;DrvObj&#39; thing.... I&#39;ll call it &#=
39;DriverObject&#39; <br>
and change the global to &#39;RegistryDriverObject&#39;.<br>
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 status;<br>
&gt; @@ -69,6 +71,9 @@ RegistryInitialize(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail1;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +=C2=A0 =C2=A0 ASSERT3P(DriverObject, =3D=3D, NULL);<br>
&gt; +=C2=A0 =C2=A0 DriverObject =3D DrvObj;<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0fail1:<br>
&gt; @@ -82,11 +87,26 @@ RegistryTeardown(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0VOID<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; +=C2=A0 =C2=A0 DriverObject =3D NULL;<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0RtlFreeUnicodeString(&amp;RegistryPath);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0RegistryPath.Buffer =3D NULL;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0RegistryPath.MaximumLength =3D RegistryPath.=
Length =3D 0;<br>
&gt;=C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +NTSTATUS<br>
&gt; +RegistryOpenParametersKey(<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 ACCESS_MASK=C2=A0 =C2=A0 =C2=A0DesiredAccess,<=
br>
&gt; +=C2=A0 =C2=A0 OUT PHANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Key<br>
&gt; +=C2=A0 =C2=A0 )<br>
&gt; +{<br>
&gt; +=C2=A0 =C2=A0 return IoOpenDriverRegistryKey(DriverObject,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DriverRegKeyParamet=
ers,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DesiredAccess,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Key);<br>
&gt; +}<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0NTSTATUS<br>
&gt;=C2=A0 =C2=A0RegistryOpenKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 Parent,<br>
&gt; diff --git a/src/common/registry.h b/src/common/registry.h<br>
&gt; index cbe9015..efa96ea 100644<br>
&gt; --- a/src/common/registry.h<br>
&gt; +++ b/src/common/registry.h<br>
&gt; @@ -37,7 +37,8 @@<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0extern NTSTATUS<br>
&gt;=C2=A0 =C2=A0RegistryInitialize(<br>
&gt; -=C2=A0 =C2=A0 IN PUNICODE_STRING=C2=A0 Path<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PDRIVER_OBJECT=C2=A0 DrvObj,<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PUNICODE_STRING Path<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0);<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0extern VOID<br>
&gt; @@ -45,6 +46,12 @@ RegistryTeardown(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0VOID<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +extern NTSTATUS<br>
&gt; +RegistryOpenParametersKey(<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 ACCESS_MASK=C2=A0 =C2=A0 =C2=A0DesiredAccess,<=
br>
&gt; +=C2=A0 =C2=A0 OUT PHANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Key<br>
&gt; +=C2=A0 =C2=A0 );<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0extern NTSTATUS<br>
&gt;=C2=A0 =C2=A0RegistryOpenKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 Parent,<br>
&gt; diff --git a/src/xen/driver.c b/src/xen/driver.c<br>
&gt; index 8fe6c5c..e04a772 100644<br>
&gt; --- a/src/xen/driver.c<br>
&gt; +++ b/src/xen/driver.c<br>
&gt; @@ -515,7 +515,7 @@ DllInitialize(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail1;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryInitialize(RegistryPath);<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryInitialize(NULL, RegistryPath);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail2;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; diff --git a/src/xenbus/driver.c b/src/xenbus/driver.c<br>
&gt; index 522acef..d6efe89 100644<br>
&gt; --- a/src/xenbus/driver.c<br>
&gt; +++ b/src/xenbus/driver.c<br>
&gt; @@ -811,7 +811,6 @@ DriverEntry(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PUNICODE_STRING RegistryPath<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
ServiceKey;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 ParametersKey;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0Index;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0LOG_LEVEL=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0LogLevel;<br>
&gt; @@ -839,21 +838,14 @@ DriverEntry(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MONTH,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 YEAR);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryInitialize(RegistryPath);<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryInitialize(DriverObject, RegistryPat=
h);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail1;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenServiceKey(KEY_READ, &amp;Servic=
eKey);<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryOpenParametersKey(KEY_READ, &amp;Par=
ametersKey);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail2;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenSubKey(ServiceKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Parameters&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KEY_READ,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;ParametersKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0__DriverSetParametersKey(ParametersKey);<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D LogReadLogLevel(ParametersKey,<br=
>
&gt; @@ -864,8 +856,6 @@ DriverEntry(<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0__DriverSetConsoleLogLevel(LogLevel);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D XenTouch(__MODULE__,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0MAJOR_VERSION,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0MINOR_VERSION,<br>
&gt; @@ -900,11 +890,6 @@ done:<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0fail2:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Error(&quot;fail2\n&quot;);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; diff --git a/src/xenfilt/driver.c b/src/xenfilt/driver.c<br>
&gt; index 724d418..aee663a 100644<br>
&gt; --- a/src/xenfilt/driver.c<br>
&gt; +++ b/src/xenfilt/driver.c<br>
&gt; @@ -113,33 +113,6 @@ DriverGetDriverObject(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return __DriverGetDriverObject();<br>
&gt;=C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -static FORCEINLINE NTSTATUS<br>
&gt; -__DriverOpenParametersKey(<br>
&gt; -=C2=A0 =C2=A0 OUT PHANDLE=C2=A0 =C2=A0 =C2=A0ParametersKey<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ServiceKey;<br=
>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenServiceKey(KEY_READ, &amp;Servic=
eKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenSubKey(ServiceKey, &quot;Paramet=
ers&quot;, KEY_READ, ParametersKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0static FORCEINLINE VOID<br>
&gt;=C2=A0 =C2=A0__DriverSetEmulatedContext(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PXENFILT_EMULATED_CONTEXT=C2=A0 =C2=
=A0Context<br>
&gt; @@ -247,7 +220,7 @@ __DriverGetActive(<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0ASSERT3U(KeGetCurrentIrql(), =3D=3D, PASSIVE=
_LEVEL);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D __DriverOpenParametersKey(&amp;ParametersKey=
);<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryOpenParametersKey(KEY_READ, &amp;Par=
ametersKey);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail1;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; @@ -752,7 +725,7 @@ DriverGetEmulatedType(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Index;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D __DriverOpenParametersKey(&amp;ParametersKey=
);<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryOpenParametersKey(KEY_READ, &amp;Par=
ametersKey);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail1;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; @@ -947,7 +920,7 @@ DriverEntry(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto done;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryInitialize(RegistryPath);<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryInitialize(DriverObject, RegistryPat=
h);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail1;<br>
&gt;=C2=A0 =C2=A0<br>
<br>
<br>
</blockquote></div>

--00000000000096735d061c2c99a6--


From win-pv-devel-bounces@lists.xenproject.org Mon Jul 01 10:32:59 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 01 Jul 2024 10:32:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.751454.1159420 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOELB-000513-Dz; Mon, 01 Jul 2024 10:32:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 751454.1159420; Mon, 01 Jul 2024 10:32:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOELB-00050w-BE; Mon, 01 Jul 2024 10:32:57 +0000
Received: by outflank-mailman (input) for mailman id 751454;
 Mon, 01 Jul 2024 10:32:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TmLj=OB=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sOEL9-00050X-Pq
 for win-pv-devel@lists.xenproject.org; Mon, 01 Jul 2024 10:32:55 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 466708b9-3795-11ef-90a4-e314d9c70b13;
 Mon, 01 Jul 2024 12:32:54 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-57d15b85a34so67989a12.3
 for <win-pv-devel@lists.xenproject.org>; Mon, 01 Jul 2024 03:32:54 -0700 (PDT)
Received: from localhost.localdomain
 (host86-134-151-174.range86-134.btcentralplus.com. [86.134.151.174])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a72aaf633bdsm316947366b.74.2024.07.01.03.32.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 01 Jul 2024 03:32:52 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 466708b9-3795-11ef-90a4-e314d9c70b13
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1719829973; x=1720434773; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=X3BLdgZs9C5HAUkD5fKSDTAxR1oqYCRP8h3O5JSE27E=;
        b=jDLUZ1yugEKkUyw6sPdqriaMPKQrDRv1E/8tzeCibd8XZhdnnqh8tImq0MXQnt6ZjN
         xCat6Pps9FD4iIIUzk6tAD1a35agN2x0bIVC8v7YHaCAHCf+IQOagXlf5lXl7/IzFpj4
         8Ylyej8PFi2+Ar5v7U/C1/GufAAqu/OtohwRE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1719829973; x=1720434773;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=X3BLdgZs9C5HAUkD5fKSDTAxR1oqYCRP8h3O5JSE27E=;
        b=ucZ6zRD6JA9L2QfMOcTWZGD6UnLwKBC+iM17TDOkiYz9c6hhz2COkEs/knwIrQrB4h
         9Qet1Ee9xr3ps1P0ZY2lwI6PEPe3vZpHKkmZ35DOc3HOyFsD5/i0EgdOUokeZWJL+Po9
         EWT53z75GU/+W1Sdyw/snWHZQPyd1X2EIA866gNEli9IPKFWXKahrpK+FANDHusinUXI
         sWumCTw4cagzK2ElrEqb48JIxjtEOHU3NJuL1cboPraba/kKo8NoKa8zQhtw0isBg9yE
         OfImzxK1/K511if2VMTBjBkvLL44IPaLlMGFJYS3yd0QckgOTnYc1YWQlXkFK5V5pooU
         paLQ==
X-Gm-Message-State: AOJu0YxrlPhCkpduhs40hOotGrrSxZwMxzD8waGYoQgByIab0AvQEA/Q
	wtT9WlekeK1r2OvW4gA5Gyo7BUxgU1ROl7JFDiGWwvMCi4ceNsoJndJsiqLS3mgt+G4tyrFT1Mc
	=
X-Google-Smtp-Source: AGHT+IH3bDRSiFI/dP98aXFo705sqtD/fiBa4kkZY32anUKVxYJwHjoNbXzLL1g6u1RnLgD720LllQ==
X-Received: by 2002:a17:907:7ea1:b0:a6f:4f2c:1936 with SMTP id a640c23a62f3a-a7514439caemr452606866b.44.1719829973026;
        Mon, 01 Jul 2024 03:32:53 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [PATCH] Conditionally use IoOpenDriverRegistryKey
Date: Mon,  1 Jul 2024 11:32:41 +0100
Message-ID: <20240701103242.1219-1-owen.smith@cloud.com>
X-Mailer: git-send-email 2.44.0.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

IoOpenDriverRegistryKey is not available in Server 2016 and Windows 10 before 1803.
Use a conditinal to modify the RegistryOpenParametersKey function to use the
correct API to open the parameters key.
Set '#define VERIFIER_REG_ISOLATION' when compiling for Server 2025, and do not
include this definition when compiling to include support for Server 2016.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/common/registry.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/src/common/registry.c b/src/common/registry.c
index 3f45a23..211c177 100644
--- a/src/common/registry.c
+++ b/src/common/registry.c
@@ -100,11 +100,38 @@ RegistryOpenParametersKey(
     OUT PHANDLE         Key
     )
 {
+#ifdef VERIFIER_REG_ISOLATION
     return IoOpenDriverRegistryKey(RegistryDriverObject,
                                    DriverRegKeyParameters,
                                    DesiredAccess,
                                    0,
                                    Key);
+#else
+    HANDLE              ServiceKey;
+    NTSTATUS            status;
+
+    status = RegistryOpenKey(NULL, &RegistryPath, DesiredAccess, &ServiceKey);
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
+    status = RegistryOpenSubKey(ServiceKey, "Parameters", DesiredAccess, Key);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    RegistryCloseKey(ServiceKey);
+
+    return STATUS_SUCCESS;
+
+fail2:
+    Error("fail2\n");
+
+    RegistryCloseKey(ServiceKey);
+
+fail1:
+    Error("fail1 %08x\n", status);
+
+    return status;
+#endif
 }
 
 NTSTATUS
-- 
2.44.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Jul 01 12:52:34 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 01 Jul 2024 12:52:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.751552.1159537 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOGWF-0002f0-TR; Mon, 01 Jul 2024 12:52:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 751552.1159537; Mon, 01 Jul 2024 12:52:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOGWF-0002et-Qi; Mon, 01 Jul 2024 12:52:31 +0000
Received: by outflank-mailman (input) for mailman id 751552;
 Mon, 01 Jul 2024 12:52:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=o32o=OB=cloud.com=kelly.choi@srs-se1.protection.inumbo.net>)
 id 1sOGWF-0002en-ES
 for win-pv-devel@lists.xenproject.org; Mon, 01 Jul 2024 12:52:31 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c6abbc47-37a8-11ef-90a5-e314d9c70b13;
 Mon, 01 Jul 2024 14:52:30 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-584ee8da49aso373184a12.0
 for <win-pv-devel@lists.xenproject.org>; Mon, 01 Jul 2024 05:52:30 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c6abbc47-37a8-11ef-90a5-e314d9c70b13
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1719838349; x=1720443149; darn=lists.xenproject.org;
        h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
         :date:message-id:reply-to;
        bh=KvMDtxuoYzEoGi/cQrwENfZA+woogbswE3sNtcF9euk=;
        b=dgU4z5QAGKTWhj3JGCZSHSvioZ/o5tJdgN9bRFLlhzAddvx5biQfDR9g8jRTeYvjuF
         1CYb1T+i/tMZhbUFND3vjfUP0sZ0rUQCd8l+6hZ+fCyjcymJDrG3BJbMz7gJVWRQU/1u
         ryAucNKtFOhvvDkaJneWUwfqi1RQLnAfYsCWI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1719838349; x=1720443149;
        h=to:subject:message-id:date:from:mime-version:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=KvMDtxuoYzEoGi/cQrwENfZA+woogbswE3sNtcF9euk=;
        b=ag58U1S4mJiXmTmkV3eDjM/ZWtR1zx6rGITi+/Y8oxWX2Tj/NYvA2NBuR5pm/bkFQw
         a6BMg/7RpNlY1vJmjV9/IL4T5ngOtH1zqfpsVi4xOCPnWT/phvPflh1SgrILu4JJEmiI
         DY7APjYnst3hjsE+O3lEJ8+IKvQh3uj5CvT9Rok6EJgaZ6Lmr5OXS8FqMZUGkT+Q+Eed
         0xSb22yGKGNBDMJ5SW93pDF34DOMrhE3AujtvFKZQ2zWAnd+9TNWBwMu7WpNsl0ye4L6
         JyfhvwasdRxcK+2JeI7SKxt1qm6MKC9dQLwjsVoL0teG8qjat2urxtTPZ/vsDWovo+h0
         2L6w==
X-Gm-Message-State: AOJu0YwWGv2Q5TQd8HdEBNXIITPK7d92CrsGda1LRRKaGG+oydJktI7l
	I10O9zeki0Vauzn/QXM9qYervbzwuRtDHSVgSMOCiwlhQ3rnYlkGluwVqBZEmziZA42iIoMhrKW
	59S/xUhgyAnxDGFaOBkd7ERT0sRU3sQVVZ5eHDm03YXt/3GTFY3uEQQ==
X-Google-Smtp-Source: AGHT+IGULfjGGHSuiX6jKlJWEa2InbEqRpOX9sGPJ1vo9w3kAh0ukU8mVYv8aBpeaKLUm4yUMYhYVDXKYQGcpPMKxk8=
X-Received: by 2002:a17:907:6d14:b0:a75:fe6:fe65 with SMTP id
 a640c23a62f3a-a75139546e1mr474790366b.38.1719838348854; Mon, 01 Jul 2024
 05:52:28 -0700 (PDT)
MIME-Version: 1.0
From: Kelly Choi <kelly.choi@cloud.com>
Date: Mon, 1 Jul 2024 13:51:52 +0100
Message-ID: <CAO-mL=yK45Zc4a3gWtZsL4jMjextF9AVtjYezrngt=0TJn_RPg@mail.gmail.com>
Subject: Update maintainers file
To: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000dae648061c2f11f9"

--000000000000dae648061c2f11f9
Content-Type: text/plain; charset="UTF-8"

Hi all,

Please can we update the maintainer's file for Windows PV Drivers?

Ben Chalmers should be removed as he no longer works at Citrix.

https://xenbits.xenproject.org/gitweb/?p=pvdrivers/win/xenbus.git;a=blob;f=MAINTAINERS;h=cc59618fe54b12bd51b56dbb7d09614221d836e6;hb=HEAD

Many thanks,
Kelly Choi

Community Manager
Xen Project

--000000000000dae648061c2f11f9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi all,=C2=A0</div><div><br></div><div>Please can we =
update the maintainer&#39;s file for Windows PV Drivers?</div><div><br></di=
v><div>Ben Chalmers should be removed as he no longer works at Citrix.</div=
><div><br></div><div><a href=3D"https://xenbits.xenproject.org/gitweb/?p=3D=
pvdrivers/win/xenbus.git;a=3Dblob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56=
dbb7d09614221d836e6;hb=3DHEAD">https://xenbits.xenproject.org/gitweb/?p=3Dp=
vdrivers/win/xenbus.git;a=3Dblob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56d=
bb7d09614221d836e6;hb=3DHEAD</a><br></div><div><br></div><div><div dir=3D"l=
tr" class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=
=3D"ltr"><div>Many thanks,</div><div>Kelly Choi</div><div><br></div><div><d=
iv style=3D"color:rgb(136,136,136)">Community Manager</div><div style=3D"co=
lor:rgb(136,136,136)">Xen Project=C2=A0<br></div></div></div></div></div></=
div>

--000000000000dae648061c2f11f9--


From win-pv-devel-bounces@lists.xenproject.org Tue Jul 02 08:24:33 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 02 Jul 2024 08:24:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.752030.1160165 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOYoR-0004PX-Hj; Tue, 02 Jul 2024 08:24:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 752030.1160165; Tue, 02 Jul 2024 08:24:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOYoR-0004PQ-FF; Tue, 02 Jul 2024 08:24:31 +0000
Received: by outflank-mailman (input) for mailman id 752030;
 Tue, 02 Jul 2024 08:24:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=smrb=OC=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sOYoQ-0004Ot-9Z
 for win-pv-devel@lists.xenproject.org; Tue, 02 Jul 2024 08:24:30 +0000
Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com
 [2a00:1450:4864:20::435])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 80097df6-384c-11ef-958a-bbd156597b9e;
 Tue, 02 Jul 2024 10:24:29 +0200 (CEST)
Received: by mail-wr1-x435.google.com with SMTP id
 ffacd0b85a97d-362b32fbb3bso2237836f8f.2
 for <win-pv-devel@lists.xenproject.org>; Tue, 02 Jul 2024 01:24:29 -0700 (PDT)
Received: from [192.168.9.232] (54-240-197-236.amazon.com. [54.240.197.236])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-3678c379cc6sm141572f8f.49.2024.07.02.01.24.27
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 02 Jul 2024 01:24:27 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 80097df6-384c-11ef-958a-bbd156597b9e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1719908668; x=1720513468; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=xa0ES6TyC6BJLB9oVSRSAcHB4uSfME5q4+ZotYmjtRg=;
        b=ZFS5NuQuS3ERMu3G+Qst2/Z0fqRQX9ZArq1TVqzNGr1Sp6FpKKeDt/+aA4ktJCMBcb
         kFEsFkzoWBIoWwnuM68WwtVPLJrBYArKPfCLNwHjfvz6pS9PhTAspum01PeFQCDRsGHp
         oOfCjJ7DusiZsxuIK9wgrnt69UIyzF53882TYLNTM7EkbIzis3BAO5uQesNbD/mfSCZe
         kUrRHF9C26U/J2fDVlqgWQ/KHLmKKAr/GwqdyCE5W0aAo0aWYsTrC7T/hMk2zEbAtcOj
         S7fUS/6LLKP76p8Ynf6DwYnRQ4uwXG6UzqRtvy4CDe2InoPHqsy9vxx0BTe+nVsW/ZCf
         tDhQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1719908668; x=1720513468;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=xa0ES6TyC6BJLB9oVSRSAcHB4uSfME5q4+ZotYmjtRg=;
        b=ImLLiUCniEa5X3qmC0AIgl3QrS95/GNVtOpkz/iWDx4UkE0X6SYN0+u7IDS6ytj2Ub
         NL1d4GxXwT/c2bVTic7ccUkbVUgEYEY4BaOPlN9p9vyTvgyQLrPyg9pwzLrZ9IoZWrIM
         UF5z3xiGVa0Z3Wc3xzqmZBC58gTjsn+VJN9lS+Tv7x+Avu1rtNbGphEtkfpbPxamrl0B
         j0rwPIknkTPFcmMHhmZb+RMFmtA6H3vugHMRCJqGenGO47/02GxGOpsIT928X0HPk/tg
         z/u/s+gQNUFP9Mhqqu1C9cQZbUgzhSU9JNPV14SptF18jSbiJ6CWUBMoAAr7H/RrOVtn
         xrEw==
X-Gm-Message-State: AOJu0YxZ9Ir7Qt1qQQbHzqzvipXoPx7Y+rqXqF8TXPshydN6zrtqr+Xw
	8gCeBzaMsLuI0rJ6rXFseniSaKt+UDYADky29elvZKwnAa96hKn3gjGzOflL
X-Google-Smtp-Source: AGHT+IHcgWrxsUjp41FihTka8+Z7eWEB7lvdYgLv6SbU3OaaPRTqDLE+yoBB4UXXn67gSjyqR8g38A==
X-Received: by 2002:a5d:424c:0:b0:366:de01:541e with SMTP id ffacd0b85a97d-36775728396mr4186449f8f.64.1719908668168;
        Tue, 02 Jul 2024 01:24:28 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <99d03fea-a4e6-4139-964b-354327747deb@xen.org>
Date: Tue, 2 Jul 2024 09:24:26 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Update maintainers file
To: win-pv-devel@lists.xenproject.org
References: <CAO-mL=yK45Zc4a3gWtZsL4jMjextF9AVtjYezrngt=0TJn_RPg@mail.gmail.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <CAO-mL=yK45Zc4a3gWtZsL4jMjextF9AVtjYezrngt=0TJn_RPg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 01/07/2024 13:51, Kelly Choi wrote:
> Hi all,
> 
> Please can we update the maintainer's file for Windows PV Drivers?
> 
> Ben Chalmers should be removed as he no longer works at Citrix.
> 
> https://xenbits.xenproject.org/gitweb/?p=pvdrivers/win/xenbus.git;a=blob;f=MAINTAINERS;h=cc59618fe54b12bd51b56dbb7d09614221d836e6;hb=HEAD <https://xenbits.xenproject.org/gitweb/?p=pvdrivers/win/xenbus.git;a=blob;f=MAINTAINERS;h=cc59618fe54b12bd51b56dbb7d09614221d836e6;hb=HEAD>
> 

Will do.

Owen, is your @citrix.com address still valid or does it need to be 
updated to @cloud.com?


From win-pv-devel-bounces@lists.xenproject.org Tue Jul 02 08:32:29 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 02 Jul 2024 08:32:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.752065.1160198 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOYw8-0007FV-WC; Tue, 02 Jul 2024 08:32:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 752065.1160198; Tue, 02 Jul 2024 08:32:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOYw8-0007FO-Ti; Tue, 02 Jul 2024 08:32:28 +0000
Received: by outflank-mailman (input) for mailman id 752065;
 Tue, 02 Jul 2024 08:32:27 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=smrb=OC=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sOYw7-0007FI-KV
 for win-pv-devel@lists.xenproject.org; Tue, 02 Jul 2024 08:32:27 +0000
Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com
 [2a00:1450:4864:20::331])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9bce5cb1-384d-11ef-a59d-41c015c667e1;
 Tue, 02 Jul 2024 10:32:25 +0200 (CEST)
Received: by mail-wm1-x331.google.com with SMTP id
 5b1f17b1804b1-42562e4b5d1so27505025e9.1
 for <win-pv-devel@lists.xenproject.org>; Tue, 02 Jul 2024 01:32:25 -0700 (PDT)
Received: from [192.168.9.232] (54-240-197-236.amazon.com. [54.240.197.236])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4256b099c72sm186377035e9.37.2024.07.02.01.32.23
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 02 Jul 2024 01:32:24 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9bce5cb1-384d-11ef-a59d-41c015c667e1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1719909144; x=1720513944; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=D4uS6FX8z1FZq/RYHCTxkD+0PmoFYoWW4Cr83yKUbC0=;
        b=W9axdWbZQpdyAxuY7AyktXdtT4EpSpxoyR4yVpgRLOfKeE5Dgu2x3IIgivs7wctA8N
         yw67+YCoLCq5n9u07Q//LchzxN2idXBwD7K7lwqZcaCje5afEXtgW8vx/zsAB4Ed7kR6
         RWY4MsOHb7LephSdu24zMJ4YSKBvThLYWEKev+SoUNGKf+MCOGc7GrhqbillJbDDQFUp
         lpSHQ0yy/YS38T6CgR8zfdKagnCovcUUpDO6jkWA6P6uLFal7VRLHCFJkNS3QltLMb2Z
         XVT1moCRDs9k3DCIEy3ruJnBjMIztoNtMuhltWJ3hvIo3bAWEELZrllG+4/m3FfJr6kb
         X+TQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1719909144; x=1720513944;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=D4uS6FX8z1FZq/RYHCTxkD+0PmoFYoWW4Cr83yKUbC0=;
        b=GdzjHrIRHe6sCNBMQZk2Yl6PiZAKEqTs0B9mtgWnxMHhs+HNKfOw0hWiWb/+jpOWhq
         dN4jm1z3InME+fc1ii1DIHntra9S1RvKKRS/thBOL1L2zuQ3VoyQ/9YCNMHnYvcZxvL9
         TffQ7KsnakOCZQBceN+i4/X+3bVgz9saBn6PABXFKesW3noCTPBcdaNDbdyXne8AfX5j
         HNj1VkQAHwj37etilCHZQiPltSx64qiG1IBziN+k6Fhk5jK5ZnQUnvwAf1u+jQIH8ZkW
         i96K9L+h5gXT1Z39J31dHDUg+H99BX04N/mU4Tn/qZPFFFbOW6GPyd/dD7LcuXCBV9/E
         c8dw==
X-Gm-Message-State: AOJu0YwuZjubxDBHKrSEn7bCp3y3omgvuEShm4RzGsFF3duvq9zyXEYW
	m1MkW5TEDaxvKu62FzKCje0FoPKgt7wg7speBSRvto0CHeHUueXZn56O1Xac
X-Google-Smtp-Source: AGHT+IGKL5p8Y2+hpL688vRwkJF4pPVxhjhlJoBC6yzN0f8c3FqYTfwN8Z+1NBvRVJN4wR9y3BujHw==
X-Received: by 2002:a05:600c:3ba1:b0:425:64c5:5750 with SMTP id 5b1f17b1804b1-4257a00aaa1mr49813975e9.7.1719909144313;
        Tue, 02 Jul 2024 01:32:24 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <23fac5a7-f462-4cb6-a1bc-42ee435bfcdc@xen.org>
Date: Tue, 2 Jul 2024 09:32:23 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] Conditionally use IoOpenDriverRegistryKey
To: win-pv-devel@lists.xenproject.org
References: <20240701103242.1219-1-owen.smith@cloud.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <20240701103242.1219-1-owen.smith@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 01/07/2024 11:32, Owen Smith wrote:
> IoOpenDriverRegistryKey is not available in Server 2016 and Windows 10 before 1803.
> Use a conditinal to modify the RegistryOpenParametersKey function to use the
> correct API to open the parameters key.
> Set '#define VERIFIER_REG_ISOLATION' when compiling for Server 2025, and do not
> include this definition when compiling to include support for Server 2016.
> 
> Signed-off-by: Owen Smith <owen.smith@cloud.com>

To remove breakage...

Acked-by: Paul Durrant <paul@xen.org>

But is there a compat story from M$ on this, as with other 'new' APIs? 
Alternatively could we simply use MmGetSystemRoutineAddress() to see if 
the function is available?

> ---
>   src/common/registry.c | 27 +++++++++++++++++++++++++++
>   1 file changed, 27 insertions(+)
> 
> diff --git a/src/common/registry.c b/src/common/registry.c
> index 3f45a23..211c177 100644
> --- a/src/common/registry.c
> +++ b/src/common/registry.c
> @@ -100,11 +100,38 @@ RegistryOpenParametersKey(
>       OUT PHANDLE         Key
>       )
>   {
> +#ifdef VERIFIER_REG_ISOLATION
>       return IoOpenDriverRegistryKey(RegistryDriverObject,
>                                      DriverRegKeyParameters,
>                                      DesiredAccess,
>                                      0,
>                                      Key);
> +#else
> +    HANDLE              ServiceKey;
> +    NTSTATUS            status;
> +
> +    status = RegistryOpenKey(NULL, &RegistryPath, DesiredAccess, &ServiceKey);
> +    if (!NT_SUCCESS(status))
> +        goto fail1;
> +
> +    status = RegistryOpenSubKey(ServiceKey, "Parameters", DesiredAccess, Key);
> +    if (!NT_SUCCESS(status))
> +        goto fail2;
> +
> +    RegistryCloseKey(ServiceKey);
> +
> +    return STATUS_SUCCESS;
> +
> +fail2:
> +    Error("fail2\n");
> +
> +    RegistryCloseKey(ServiceKey);
> +
> +fail1:
> +    Error("fail1 %08x\n", status);
> +
> +    return status;
> +#endif
>   }
>   
>   NTSTATUS



From win-pv-devel-bounces@lists.xenproject.org Tue Jul 02 08:47:54 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 02 Jul 2024 08:47:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.752103.1160232 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOZB3-00025y-Qh; Tue, 02 Jul 2024 08:47:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 752103.1160232; Tue, 02 Jul 2024 08:47:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOZB3-00025r-OC; Tue, 02 Jul 2024 08:47:53 +0000
Received: by outflank-mailman (input) for mailman id 752103;
 Tue, 02 Jul 2024 08:47:52 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=iiim=OC=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sOZB2-00025l-I7
 for win-pv-devel@lists.xenproject.org; Tue, 02 Jul 2024 08:47:52 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c386cd32-384f-11ef-a59d-41c015c667e1;
 Tue, 02 Jul 2024 10:47:50 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2ee794ec046so1330791fa.2
 for <win-pv-devel@lists.xenproject.org>; Tue, 02 Jul 2024 01:47:50 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c386cd32-384f-11ef-a59d-41c015c667e1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1719910070; x=1720514870; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=oJeHvrKzOzoIzdQgRO3MlNBXSXEDWJudn4zqdWCD4v8=;
        b=Z4/lYh/I3fE4P4KQVgwPZV121uGclHaO4O/Ze0tcnE3qA6dCT4EYRQ6eZA6tFOlFfc
         knr+CX2ANzWlfxPYuhXS80yR7PjsdTRWUDQ6Y04GvPpOsRQeRbM1Dpq4CbVOBQqp7mhm
         KzSSAr3ZZwfayDSbanzdJQqkm+g/JGRiFts6I=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1719910070; x=1720514870;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=oJeHvrKzOzoIzdQgRO3MlNBXSXEDWJudn4zqdWCD4v8=;
        b=qlzcscpAw4R4vc6dSyZYFdqNFxPqpu5ltqQ4neBO2JXWOQQwcRqmvVOKMSehgcoHNs
         pZOTHbTjDrEUXLPrj5mJR7VBnRegdxGIwSiO+1DehkhsmV6aJhqcjHIBHphRTPv3sxuu
         1PdIp+L/CBjnBaRBh719uRdrcBo00scwysN64q6Tcl4FfvBsrqiYfzlLW1yqwhd43cds
         yl+yFG4SeQp75EdTMCRfOYcLkliPFmw8Qw9U00aW94uzHqyfIuyrFJc2dPVPwrvYsJWN
         4KNKb7vo1qmNRUCyfaLcnJS6VCiwtORs1+h/oV7mwYV36WysryWt+8MfNmux+eKA049T
         vZpg==
X-Gm-Message-State: AOJu0YwL4ZGl0ApAYI8ptK5mPTpAoY/8ZTlWgE8XEC0JGmLxkzJ0fh6u
	fWLYdmWNAH00yyaggz98pY0I4F3RaP6NcYkIoUnth4ygmbI445gmfNzwgoCaYgtZ9N9VA5awKfv
	oSPJkZqnOsKAKZG/SdSpnmyE8M29beFgMChET4c81LK9L00I=
X-Google-Smtp-Source: AGHT+IGsNnfEF7UuycFOglVHSVKv6t0Oaw/Y1NzUxSOto2ukGkGRuqUQyB1gDfafOsG7N046fhYOQBjHzoGCRQcTRnU=
X-Received: by 2002:a2e:a7c2:0:b0:2ec:5172:dbc4 with SMTP id
 38308e7fff4ca-2ee5e393c8cmr50051211fa.12.1719910069913; Tue, 02 Jul 2024
 01:47:49 -0700 (PDT)
MIME-Version: 1.0
References: <CAO-mL=yK45Zc4a3gWtZsL4jMjextF9AVtjYezrngt=0TJn_RPg@mail.gmail.com>
 <99d03fea-a4e6-4139-964b-354327747deb@xen.org>
In-Reply-To: <99d03fea-a4e6-4139-964b-354327747deb@xen.org>
From: Owen Smith <owen.smith@citrix.com>
Date: Tue, 2 Jul 2024 09:47:38 +0100
Message-ID: <CAC_UY8_Mo+QOgOT=zFK0+GyWjLOpeaX8A_dZzXpaiz6fB_LPYw@mail.gmail.com>
Subject: Re: Update maintainers file
To: paul@xen.org
Cc: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000c38026061c3fc402"

--000000000000c38026061c3fc402
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

The @citrix.com address is redirected to the @cloud.com address, but
updating to the @cloud.com address will be best.

Owen

On Tue, Jul 2, 2024 at 9:24=E2=80=AFAM Paul Durrant <xadimgnik@gmail.com> w=
rote:

> On 01/07/2024 13:51, Kelly Choi wrote:
> > Hi all,
> >
> > Please can we update the maintainer's file for Windows PV Drivers?
> >
> > Ben Chalmers should be removed as he no longer works at Citrix.
> >
> >
> https://xenbits.xenproject.org/gitweb/?p=3Dpvdrivers/win/xenbus.git;a=3Db=
lob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56dbb7d09614221d836e6;hb=3DHEAD
> <
> https://xenbits.xenproject.org/gitweb/?p=3Dpvdrivers/win/xenbus.git;a=3Db=
lob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56dbb7d09614221d836e6;hb=3DHEAD
> >
> >
>
> Will do.
>
> Owen, is your @citrix.com address still valid or does it need to be
> updated to @cloud.com?
>
>

--000000000000c38026061c3fc402
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e">The=C2=A0@<a href=3D"http://citrix.com">citrix.com</a> address is redire=
cted to the @<a href=3D"http://cloud.com">cloud.com</a> address, but updati=
ng to the=C2=A0@<a href=3D"http://cloud.com">cloud.com</a> address will be =
best.<br><br>Owen</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr=
" class=3D"gmail_attr">On Tue, Jul 2, 2024 at 9:24=E2=80=AFAM Paul Durrant =
&lt;<a href=3D"mailto:xadimgnik@gmail.com">xadimgnik@gmail.com</a>&gt; wrot=
e:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 01/07/2024=
 13:51, Kelly Choi wrote:<br>
&gt; Hi all,<br>
&gt; <br>
&gt; Please can we update the maintainer&#39;s file for Windows PV Drivers?=
<br>
&gt; <br>
&gt; Ben Chalmers should be removed as he no longer works at Citrix.<br>
&gt; <br>
&gt; <a href=3D"https://xenbits.xenproject.org/gitweb/?p=3Dpvdrivers/win/xe=
nbus.git;a=3Dblob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56dbb7d09614221d83=
6e6;hb=3DHEAD" rel=3D"noreferrer" target=3D"_blank">https://xenbits.xenproj=
ect.org/gitweb/?p=3Dpvdrivers/win/xenbus.git;a=3Dblob;f=3DMAINTAINERS;h=3Dc=
c59618fe54b12bd51b56dbb7d09614221d836e6;hb=3DHEAD</a> &lt;<a href=3D"https:=
//xenbits.xenproject.org/gitweb/?p=3Dpvdrivers/win/xenbus.git;a=3Dblob;f=3D=
MAINTAINERS;h=3Dcc59618fe54b12bd51b56dbb7d09614221d836e6;hb=3DHEAD" rel=3D"=
noreferrer" target=3D"_blank">https://xenbits.xenproject.org/gitweb/?p=3Dpv=
drivers/win/xenbus.git;a=3Dblob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56db=
b7d09614221d836e6;hb=3DHEAD</a>&gt;<br>
&gt; <br>
<br>
Will do.<br>
<br>
Owen, is your @<a href=3D"http://citrix.com" rel=3D"noreferrer" target=3D"_=
blank">citrix.com</a> address still valid or does it need to be <br>
updated to @<a href=3D"http://cloud.com" rel=3D"noreferrer" target=3D"_blan=
k">cloud.com</a>?<br>
<br>
</blockquote></div>

--000000000000c38026061c3fc402--


From win-pv-devel-bounces@lists.xenproject.org Tue Jul 02 08:56:10 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 02 Jul 2024 08:56:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.752112.1160236 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOZJ3-0003XA-9P; Tue, 02 Jul 2024 08:56:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 752112.1160236; Tue, 02 Jul 2024 08:56:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOZJ3-0003X3-6t; Tue, 02 Jul 2024 08:56:09 +0000
Received: by outflank-mailman (input) for mailman id 752112;
 Tue, 02 Jul 2024 08:56:08 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=smrb=OC=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sOZJ2-0003Wx-75
 for win-pv-devel@lists.xenproject.org; Tue, 02 Jul 2024 08:56:08 +0000
Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com
 [2a00:1450:4864:20::32a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ea69abfa-3850-11ef-a59d-41c015c667e1;
 Tue, 02 Jul 2024 10:56:05 +0200 (CEST)
Received: by mail-wm1-x32a.google.com with SMTP id
 5b1f17b1804b1-42562e4b5d1so27647895e9.1
 for <win-pv-devel@lists.xenproject.org>; Tue, 02 Jul 2024 01:56:05 -0700 (PDT)
Received: from [192.168.9.232] (54-240-197-236.amazon.com. [54.240.197.236])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4256f55c4b5sm174616725e9.43.2024.07.02.01.56.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 02 Jul 2024 01:56:04 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ea69abfa-3850-11ef-a59d-41c015c667e1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1719910565; x=1720515365; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:content-language
         :references:cc:to:subject:reply-to:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=66409T5wNAgZqwlBatltuS8XF28OfazIahPtTrNgMA4=;
        b=J8svRwU9HojukoiuKV71VxflDIkkRe1jGEbFz6uY4vI/e5RBKD3EUlBX26SiDlq+7y
         lF5hRGRBu35lyOyYtvvbHJKxUR3xRvfcC5nl5E9sXVjgvSDrO+8ZXMFH2cfOH0CBU7Cj
         HsqGy2/cwFU5wR1HKVyBzGWOvGUkAjr9ZqUpQNLMpjdrDJxJ6aqk9t4ovKWaG4QieJAW
         zyhZhEiCxHHQCFmPBEjys2m5ijXRjQc0G4vqtpb3wqKX0bVNFb6VfFhSacb0F3VA9SnC
         nXtsDv5RXE5a2u34W+C544vWCBnUS0/RoJ0GA9axRE/N3C4bQctxfQf98xm90UlpMPia
         4/KA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1719910565; x=1720515365;
        h=content-transfer-encoding:in-reply-to:organization:content-language
         :references:cc:to:subject:reply-to:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=66409T5wNAgZqwlBatltuS8XF28OfazIahPtTrNgMA4=;
        b=F0j+dY8CEwT+25rORqGtNTtUdmDII4hcty5IMnDoBk3QOD6mcSL497QP7ivdQ9YqaQ
         iwme5BizNV+vTLd2A3ZKD3rIYg/AhLz8yaCUSJKJD+/nYdhdKeKd3EfZLTOkbd3fMsBS
         XRqeb2xIfm3PPmzAMPZ+ANjLQpITAm4iZr1elXrnUXOAF0pRfq+PDAOmCMpAM0XGr+wA
         BvNabwJWRBg2+vSIJTcIloLwr5KKK/WQdY7qZsGyjacuZeBB11VNZrOyF2ZdOqdOhfhK
         +MjCrEjp71+wIHImo6SbMfQ3U4qrPd4Wyng5dOMw5cO+Xdcf/TxGWf2A6dfDWtWtLS5e
         Dwng==
X-Gm-Message-State: AOJu0YxxwuJjBpOJLyDXKoYIAICAvbkCeGGnvblk4OCkRH2PPJ/zafgS
	8iVYzpDUR8A6kWj71PGakPsMCiq9upE4u4XvtynGy8KA33eTi5Xm
X-Google-Smtp-Source: AGHT+IFzrnGV3p65c3sXIZkcWz40Svyddxvn2+bS0fxJj4DBOxvD+WrUGNmzR4ptFz7T/71/Feo7rg==
X-Received: by 2002:a05:600c:2e4b:b0:424:8fa1:b2c3 with SMTP id 5b1f17b1804b1-4257a0117a8mr51706085e9.23.1719910564691;
        Tue, 02 Jul 2024 01:56:04 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <3e6c98fb-2a10-4746-a5e5-107ef7d7303a@xen.org>
Date: Tue, 2 Jul 2024 09:56:02 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Reply-To: paul@xen.org
Subject: Re: Update maintainers file
To: Owen Smith <owen.smith@citrix.com>
Cc: win-pv-devel@lists.xenproject.org
References: <CAO-mL=yK45Zc4a3gWtZsL4jMjextF9AVtjYezrngt=0TJn_RPg@mail.gmail.com>
 <99d03fea-a4e6-4139-964b-354327747deb@xen.org>
 <CAC_UY8_Mo+QOgOT=zFK0+GyWjLOpeaX8A_dZzXpaiz6fB_LPYw@mail.gmail.com>
Content-Language: en-US
Organization: Xen Project
In-Reply-To: <CAC_UY8_Mo+QOgOT=zFK0+GyWjLOpeaX8A_dZzXpaiz6fB_LPYw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 02/07/2024 09:47, Owen Smith wrote:
> The @citrix.com <http://citrix.com> address is redirected to the 
> @cloud.com <http://cloud.com> address, but updating to the @cloud.com 
> <http://cloud.com> address will be best.
> 

Ok. I'll send a patch.

Paul

> Owen
> 
> On Tue, Jul 2, 2024 at 9:24 AM Paul Durrant <xadimgnik@gmail.com 
> <mailto:xadimgnik@gmail.com>> wrote:
> 
>     On 01/07/2024 13:51, Kelly Choi wrote:
>      > Hi all,
>      >
>      > Please can we update the maintainer's file for Windows PV Drivers?
>      >
>      > Ben Chalmers should be removed as he no longer works at Citrix.
>      >
>      >
>     https://xenbits.xenproject.org/gitweb/?p=pvdrivers/win/xenbus.git;a=blob;f=MAINTAINERS;h=cc59618fe54b12bd51b56dbb7d09614221d836e6;hb=HEAD <https://xenbits.xenproject.org/gitweb/?p=pvdrivers/win/xenbus.git;a=blob;f=MAINTAINERS;h=cc59618fe54b12bd51b56dbb7d09614221d836e6;hb=HEAD> <https://xenbits.xenproject.org/gitweb/?p=pvdrivers/win/xenbus.git;a=blob;f=MAINTAINERS;h=cc59618fe54b12bd51b56dbb7d09614221d836e6;hb=HEAD <https://xenbits.xenproject.org/gitweb/?p=pvdrivers/win/xenbus.git;a=blob;f=MAINTAINERS;h=cc59618fe54b12bd51b56dbb7d09614221d836e6;hb=HEAD>>
>      >
> 
>     Will do.
> 
>     Owen, is your @citrix.com <http://citrix.com> address still valid or
>     does it need to be
>     updated to @cloud.com <http://cloud.com>?
> 



From win-pv-devel-bounces@lists.xenproject.org Tue Jul 02 08:58:53 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 02 Jul 2024 08:58:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.752128.1160251 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOZLg-0004YH-OY; Tue, 02 Jul 2024 08:58:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 752128.1160251; Tue, 02 Jul 2024 08:58:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOZLg-0004Y9-LQ; Tue, 02 Jul 2024 08:58:52 +0000
Received: by outflank-mailman (input) for mailman id 752128;
 Tue, 02 Jul 2024 08:58:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1sOZLf-0004Y3-74
 for win-pv-devel@lists.xenproject.org; Tue, 02 Jul 2024 08:58:51 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1sOZLf-00031n-4L; Tue, 02 Jul 2024 08:58:51 +0000
Received: from 54-240-197-236.amazon.com ([54.240.197.236]
 helo=REM-PW02S00X.ant.amazon.com)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1sOZLe-00021F-Rl; Tue, 02 Jul 2024 08:58:51 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:
	Subject:Cc:To:From; bh=pKXtL2Xybo8JgrB/kKfWxXRZ6bkDonRE8n/tOvA4xDo=; b=0M1k0Q
	3nKL/E/gBAvwrb+AYC8xVXj5ak/fRtj0H5bk4NgLJhVKWx1/9BwokoExNqDJ/hRMYX63G12pETzu+
	WYAwvd0tPJs9lB5KCEreNitVCRgtMk//JPAenhGAwaHWeoRbW2rIHcB/jpTY6uGFp1tfo20cOU1UX
	qJwhvKDUl7s=;
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH] Update MAINTAINERS
Date: Tue,  2 Jul 2024 09:58:42 +0100
Message-Id: <20240702085842.618-1-paul@xen.org>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Paul Durrant <pdurrant@amazon.com>

Remove Ben as he is no longer involved in the project, and update Owen's
email address.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 MAINTAINERS | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index cc59618fe54b..6cbbb5661da3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -45,6 +45,4 @@ Maintainers List
 
 * Paul Durrant <paul@xen.org>
 
-* Ben Chalmers <ben.chalmers@citrix.com>
-
-* Owen Smith <owen.smith@citrix.com>
+* Owen Smith <owen.smith@cloud.com>
-- 
2.25.1



From win-pv-devel-bounces@lists.xenproject.org Tue Jul 02 14:10:25 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 02 Jul 2024 14:10:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.752491.1160708 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOeD9-0003Q5-JK; Tue, 02 Jul 2024 14:10:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 752491.1160708; Tue, 02 Jul 2024 14:10:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOeD9-0003Py-GU; Tue, 02 Jul 2024 14:10:23 +0000
Received: by outflank-mailman (input) for mailman id 752491;
 Tue, 02 Jul 2024 14:10:22 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=iiim=OC=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sOeD8-0003Od-1T
 for win-pv-devel@lists.xenproject.org; Tue, 02 Jul 2024 14:10:22 +0000
Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com
 [2a00:1450:4864:20::22d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cfbc88cc-387c-11ef-aaf1-7f3abd7486c0;
 Tue, 02 Jul 2024 16:10:19 +0200 (CEST)
Received: by mail-lj1-x22d.google.com with SMTP id
 38308e7fff4ca-2eaae2a6dc1so56164101fa.0
 for <win-pv-devel@lists.xenproject.org>; Tue, 02 Jul 2024 07:10:18 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cfbc88cc-387c-11ef-aaf1-7f3abd7486c0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1719929418; x=1720534218; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=h/iZ3YqtUAhGMZ8m45914PRf4D4qBUH1cPUdFzZ4u5U=;
        b=HOQHW8caY74Pw6YP2r3ionW1JZF6O6zVKV2qZQPXwpmVgjxgOeSluAzPiARm0PkOm9
         Om3/4GcIxqxEQzWHiPuaR5d6V6o2Ug4TjiIXua9PBYw1rinIxYEhW5q/QxPYJgXHyT/2
         YwHPFcqCTzpSVb6JvzxcAE7fZ7lkmNJUE+1Yk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1719929418; x=1720534218;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=h/iZ3YqtUAhGMZ8m45914PRf4D4qBUH1cPUdFzZ4u5U=;
        b=cSDSbSyVAufH6qdUrs31i60MOkX397DjbqHRUh07eoHVZfhQYDXZbsSTwPoVgP4GH9
         iipnYW5rUsiCz2r6+AajdwCRcUhnhgszoW1wVEq8WmRjjeJU5Hb6o1V1Xgk0GfB3cBYV
         Xz6GMzmfhQpM/g74oDzPjB4WV9+C6QCp9DxFuKOBUCmSg32K+Sq2APZn4lruRtPjsZxn
         9a1EXsi3VpVBrWoZcklQXmkCfvrsFqLZLBKBJD2psIXQgvqL52P35CNcgcqp9VlkSjOd
         lGrE6oeCQRO5k3Q9FH/lcOuXIbw/yHRoJ5TZ40Rctz07kG6/350zcLbeGLaR8Wf1xzF+
         37WQ==
X-Gm-Message-State: AOJu0YwrUkiRAA3IK6Dtchk969uhpiYqEKOtG3vquhvDOXZFhrAA+XVf
	+IFHnDJQtY5pLsK/3VeH/H7e/cfwhGKJRs7pM/TLLvSyaxmhpPCvpvdnjqAjquwStEjRgUeGath
	/XINIDi5+QEbJ7HCJw/yG5AXmStsCYrZetUdWuaCnH2FGGSQ=
X-Google-Smtp-Source: AGHT+IFkGpu0EvhPesX9StMfPZDDMum1vsytxqAqzZkyDIFl7oDPE4dzMvADg9Oi84PG94qv2KGUuJmkAv7WvOof/I4=
X-Received: by 2002:a05:651c:225:b0:2ee:4a67:3d82 with SMTP id
 38308e7fff4ca-2ee5e3bedf3mr74239341fa.28.1719929417893; Tue, 02 Jul 2024
 07:10:17 -0700 (PDT)
MIME-Version: 1.0
References: <20240701103242.1219-1-owen.smith@cloud.com> <23fac5a7-f462-4cb6-a1bc-42ee435bfcdc@xen.org>
In-Reply-To: <23fac5a7-f462-4cb6-a1bc-42ee435bfcdc@xen.org>
From: Owen Smith <owen.smith@citrix.com>
Date: Tue, 2 Jul 2024 15:10:06 +0100
Message-ID: <CAC_UY89bNsH9P3nZfNcQdPsSh90yjPmA_=A7CHVug+cruKuS-Q@mail.gmail.com>
Subject: Re: [PATCH] Conditionally use IoOpenDriverRegistryKey
To: paul@xen.org
Cc: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000fe29cd061c44457c"

--000000000000fe29cd061c44457c
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Using MmGetSystemRoutineAddress seems to be a sensible solution. I'm still
running some tests, but using this allows Server2016 to load and work,
while allowing Server2025 to run with the appropriate verifier flags that
catch the registry isolation violations. ("verifier.exe /onecheck /rc 33 36
/driver xenbus.sys xenfilt.sys")
I will post a patch with MmGetSystemRoutineAddress(), and include it in
patches for the other drivers.

Owen

On Tue, Jul 2, 2024 at 9:32=E2=80=AFAM Paul Durrant <xadimgnik@gmail.com> w=
rote:

> On 01/07/2024 11:32, Owen Smith wrote:
> > IoOpenDriverRegistryKey is not available in Server 2016 and Windows 10
> before 1803.
> > Use a conditinal to modify the RegistryOpenParametersKey function to us=
e
> the
> > correct API to open the parameters key.
> > Set '#define VERIFIER_REG_ISOLATION' when compiling for Server 2025, an=
d
> do not
> > include this definition when compiling to include support for Server
> 2016.
> >
> > Signed-off-by: Owen Smith <owen.smith@cloud.com>
>
> To remove breakage...
>
> Acked-by: Paul Durrant <paul@xen.org>
>
> But is there a compat story from M$ on this, as with other 'new' APIs?
> Alternatively could we simply use MmGetSystemRoutineAddress() to see if
> the function is available?
>
> > ---
> >   src/common/registry.c | 27 +++++++++++++++++++++++++++
> >   1 file changed, 27 insertions(+)
> >
> > diff --git a/src/common/registry.c b/src/common/registry.c
> > index 3f45a23..211c177 100644
> > --- a/src/common/registry.c
> > +++ b/src/common/registry.c
> > @@ -100,11 +100,38 @@ RegistryOpenParametersKey(
> >       OUT PHANDLE         Key
> >       )
> >   {
> > +#ifdef VERIFIER_REG_ISOLATION
> >       return IoOpenDriverRegistryKey(RegistryDriverObject,
> >                                      DriverRegKeyParameters,
> >                                      DesiredAccess,
> >                                      0,
> >                                      Key);
> > +#else
> > +    HANDLE              ServiceKey;
> > +    NTSTATUS            status;
> > +
> > +    status =3D RegistryOpenKey(NULL, &RegistryPath, DesiredAccess,
> &ServiceKey);
> > +    if (!NT_SUCCESS(status))
> > +        goto fail1;
> > +
> > +    status =3D RegistryOpenSubKey(ServiceKey, "Parameters",
> DesiredAccess, Key);
> > +    if (!NT_SUCCESS(status))
> > +        goto fail2;
> > +
> > +    RegistryCloseKey(ServiceKey);
> > +
> > +    return STATUS_SUCCESS;
> > +
> > +fail2:
> > +    Error("fail2\n");
> > +
> > +    RegistryCloseKey(ServiceKey);
> > +
> > +fail1:
> > +    Error("fail1 %08x\n", status);
> > +
> > +    return status;
> > +#endif
> >   }
> >
> >   NTSTATUS
>
>
>

--000000000000fe29cd061c44457c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e">Using MmGetSystemRoutineAddress seems to be a sensible solution. I&#39;m=
 still running some tests, but using this allows Server2016 to load and wor=
k, while allowing Server2025 to run with the appropriate verifier flags tha=
t catch the registry isolation violations. (&quot;verifier.exe /onecheck /r=
c 33 36 /driver xenbus.sys xenfilt.sys&quot;)<br>I will post a patch with M=
mGetSystemRoutineAddress(), and include it in patches for the other drivers=
.</div><div class=3D"gmail_default" style=3D"font-family:monospace"><br></d=
iv><div class=3D"gmail_default" style=3D"font-family:monospace">Owen=C2=A0<=
/div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_a=
ttr">On Tue, Jul 2, 2024 at 9:32=E2=80=AFAM Paul Durrant &lt;<a href=3D"mai=
lto:xadimgnik@gmail.com">xadimgnik@gmail.com</a>&gt; wrote:<br></div><block=
quote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1=
px solid rgb(204,204,204);padding-left:1ex">On 01/07/2024 11:32, Owen Smith=
 wrote:<br>
&gt; IoOpenDriverRegistryKey is not available in Server 2016 and Windows 10=
 before 1803.<br>
&gt; Use a conditinal to modify the RegistryOpenParametersKey function to u=
se the<br>
&gt; correct API to open the parameters key.<br>
&gt; Set &#39;#define VERIFIER_REG_ISOLATION&#39; when compiling for Server=
 2025, and do not<br>
&gt; include this definition when compiling to include support for Server 2=
016.<br>
&gt; <br>
&gt; Signed-off-by: Owen Smith &lt;<a href=3D"mailto:owen.smith@cloud.com" =
target=3D"_blank">owen.smith@cloud.com</a>&gt;<br>
<br>
To remove breakage...<br>
<br>
Acked-by: Paul Durrant &lt;<a href=3D"mailto:paul@xen.org" target=3D"_blank=
">paul@xen.org</a>&gt;<br>
<br>
But is there a compat story from M$ on this, as with other &#39;new&#39; AP=
Is? <br>
Alternatively could we simply use MmGetSystemRoutineAddress() to see if <br=
>
the function is available?<br>
<br>
&gt; ---<br>
&gt;=C2=A0 =C2=A0src/common/registry.c | 27 +++++++++++++++++++++++++++<br>
&gt;=C2=A0 =C2=A01 file changed, 27 insertions(+)<br>
&gt; <br>
&gt; diff --git a/src/common/registry.c b/src/common/registry.c<br>
&gt; index 3f45a23..211c177 100644<br>
&gt; --- a/src/common/registry.c<br>
&gt; +++ b/src/common/registry.c<br>
&gt; @@ -100,11 +100,38 @@ RegistryOpenParametersKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0OUT PHANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0Key<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; +#ifdef VERIFIER_REG_ISOLATION<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return IoOpenDriverRegistryKey(RegistryDrive=
rObject,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DriverRegKey=
Parameters,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DesiredAcces=
s,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Key);<br>
&gt; +#else<br>
&gt; +=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
ServiceKey;<br>
&gt; +=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 statu=
s;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryOpenKey(NULL, &amp;RegistryPath, Des=
iredAccess, &amp;ServiceKey);<br>
&gt; +=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryOpenSubKey(ServiceKey, &quot;Paramet=
ers&quot;, DesiredAccess, Key);<br>
&gt; +=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; +<br>
&gt; +fail2:<br>
&gt; +=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; +<br>
&gt; +fail1:<br>
&gt; +=C2=A0 =C2=A0 Error(&quot;fail1 %08x\n&quot;, status);<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 return status;<br>
&gt; +#endif<br>
&gt;=C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0NTSTATUS<br>
<br>
<br>
</blockquote></div>

--000000000000fe29cd061c44457c--


From win-pv-devel-bounces@lists.xenproject.org Tue Jul 02 14:25:16 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 02 Jul 2024 14:25:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.752529.1160751 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOeRX-0007En-GR; Tue, 02 Jul 2024 14:25:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 752529.1160751; Tue, 02 Jul 2024 14:25:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sOeRX-0007Eg-Dm; Tue, 02 Jul 2024 14:25:15 +0000
Received: by outflank-mailman (input) for mailman id 752529;
 Tue, 02 Jul 2024 14:25:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=smrb=OC=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sOeRW-0007EH-2t
 for win-pv-devel@lists.xenproject.org; Tue, 02 Jul 2024 14:25:14 +0000
Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com
 [2a00:1450:4864:20::333])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e4212c79-387e-11ef-92e8-0d9d20120eaa;
 Tue, 02 Jul 2024 16:25:13 +0200 (CEST)
Received: by mail-wm1-x333.google.com with SMTP id
 5b1f17b1804b1-42578fe58a6so21634145e9.3
 for <win-pv-devel@lists.xenproject.org>; Tue, 02 Jul 2024 07:25:11 -0700 (PDT)
Received: from [192.168.9.232] (54-240-197-236.amazon.com. [54.240.197.236])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4256b0c1018sm199128915e9.40.2024.07.02.07.25.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 02 Jul 2024 07:25:10 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e4212c79-387e-11ef-92e8-0d9d20120eaa
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1719930311; x=1720535111; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:content-language
         :references:cc:to:subject:reply-to:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=zUFZYMdg3FMKcwR4eCu/v9bFhXvFz/fhSQjGAqD6/ys=;
        b=VOEtEgdkHFTmj/UgOctl2KSP1XvUY+oBaWJqeXyUfDj8Kn9ww0l0sd2+HEjyCv+z2o
         LLVwWMjS9meryA9r0dK/29jm+46EYN8NxJuoTLIaIKPictUljGhgm10LM/eHU85GaMTE
         mbuSL5Grqb/+D2OWVf0FN4Xqs6fiH2QSXuCQJ0zi5UsvUIv8PlTvn8tWOYRd6C12yRW9
         iT9oyWnfrxIhJMcrFeSzEwZ0HnWhFxZAUCqgBeafQV2D6Rm7U/jiOn+3ZY1d71SetuTD
         5Drbd7CXHC/m24VbILgo/mNGhbKNygGDEIK5OqqVIyUM94KZOtD0QqiYEdyW0iUKtrOw
         Xazw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1719930311; x=1720535111;
        h=content-transfer-encoding:in-reply-to:organization:content-language
         :references:cc:to:subject:reply-to:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=zUFZYMdg3FMKcwR4eCu/v9bFhXvFz/fhSQjGAqD6/ys=;
        b=KX1Df3faAIR4Pw1a5a9St9vb48LUPaGsC098MGB3CIk+gycjoGSQDnXFvQHWNBjSt6
         gE0Z6rimhYkVXfHqvRnr+RjjLy6dF73g00oEc44xGznXjLCgllScZ35o/21TXjzTNjrS
         PvY6IAajtx+p4sAc1KfmhnUqSt4BeQ5Mc5kLXh5omOwdSAcsmd0MSPYP/qJxkZfprCNb
         Y7gqtMPhXKfBEFF3ahF2SWZFQPlD1RFiGsMJdrNBhrUeHTL0LJda1evIcyN/8ywjeLCm
         CD8ImnOqjYNYnIusc0oJvQD8UTKPbiFRQkaP68c+BQ8DP1/+HoFQBnI7t/+k+V4y8X7U
         K6cA==
X-Gm-Message-State: AOJu0Yx3pPjZhGMu3FEGyrBZqx/PL/m3K4HyYV98FqkO3ag+25XWylyB
	QcggE4kvqzMzkcrH2mKPHuBmydkiw1rgW4TmCEtBQyJG+cl7m2KG
X-Google-Smtp-Source: AGHT+IEFihUsdDwLVIIBonuzT1MevEYEjqU97xfvcKbgmTHWS184n8NswmGRaUc/b8mRfxGrQ4uNeA==
X-Received: by 2002:a05:600c:1989:b0:425:6bc4:977b with SMTP id 5b1f17b1804b1-4257a06df09mr75723335e9.26.1719930310899;
        Tue, 02 Jul 2024 07:25:10 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <15e15706-cd65-4378-a74e-78eb49f27b56@xen.org>
Date: Tue, 2 Jul 2024 15:25:09 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Reply-To: paul@xen.org
Subject: Re: [PATCH] Conditionally use IoOpenDriverRegistryKey
To: Owen Smith <owen.smith@citrix.com>
Cc: win-pv-devel@lists.xenproject.org
References: <20240701103242.1219-1-owen.smith@cloud.com>
 <23fac5a7-f462-4cb6-a1bc-42ee435bfcdc@xen.org>
 <CAC_UY89bNsH9P3nZfNcQdPsSh90yjPmA_=A7CHVug+cruKuS-Q@mail.gmail.com>
Content-Language: en-US
Organization: Xen Project
In-Reply-To: <CAC_UY89bNsH9P3nZfNcQdPsSh90yjPmA_=A7CHVug+cruKuS-Q@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 02/07/2024 15:10, Owen Smith wrote:
> Using MmGetSystemRoutineAddress seems to be a sensible solution. I'm 
> still running some tests, but using this allows Server2016 to load and 
> work, while allowing Server2025 to run with the appropriate verifier 
> flags that catch the registry isolation violations. ("verifier.exe 
> /onecheck /rc 33 36 /driver xenbus.sys xenfilt.sys")
> I will post a patch with MmGetSystemRoutineAddress(), and include it in 
> patches for the other drivers.
> 

Great. Thanks,

   Paul



From win-pv-devel-bounces@lists.xenproject.org Fri Jul 05 07:32:41 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 05 Jul 2024 07:32:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.754153.1162490 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sPdQt-0005uW-FW; Fri, 05 Jul 2024 07:32:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 754153.1162490; Fri, 05 Jul 2024 07:32:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sPdQt-0005uP-CZ; Fri, 05 Jul 2024 07:32:39 +0000
Received: by outflank-mailman (input) for mailman id 754153;
 Fri, 05 Jul 2024 07:32:38 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=JG9v=OF=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sPdQs-0005uF-KO
 for win-pv-devel@lists.xenproject.org; Fri, 05 Jul 2024 07:32:38 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bf6cd06c-3aa0-11ef-8776-851b0ebba9a2;
 Fri, 05 Jul 2024 09:32:36 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-52e97e5a84bso1889170e87.2
 for <win-pv-devel@lists.xenproject.org>; Fri, 05 Jul 2024 00:32:35 -0700 (PDT)
Received: from localhost.localdomain
 (host86-134-151-174.range86-134.btcentralplus.com. [86.134.151.174])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a77c30d7c3fsm78028666b.42.2024.07.05.00.32.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 05 Jul 2024 00:32:33 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bf6cd06c-3aa0-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720164754; x=1720769554; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=t6oa0rh37DG98uUCuafcK/DBsM+9g6Krtjz/ELQGvnE=;
        b=OtTEL1tZWRBJALcYvF3HD3goQuNNvE29xoA+JvqPgpqTaD2KY+epUwcCndXL78Svpe
         nt2txiAFtYASkbuYmg7lm50qnc2zC9SazLF16nGvU5++LNPs9N6wQwdGVN59W4djW//6
         r3qgjukiLcszCxHs0XATTxOoN2xgJ/W18NGao=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720164754; x=1720769554;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=t6oa0rh37DG98uUCuafcK/DBsM+9g6Krtjz/ELQGvnE=;
        b=QTUXbh+5keNtuhWvb+mthNYQp5c7WcvKSkPifFe9tDPrSurKOqLh01mVMnhi3bDGNA
         NRe4tTV9CvQcHFKgS4IVR87zNH0BAv6tCxpqgyDrOcCOhyB//63xx/n6flbyKzXi/8JJ
         tb47PVl+FMA0chsS967bUKH0zsQ077CuK/dkEgGl7ZxKjllRlfk5I5iqv9mJKSrtLs90
         V2bD2gcD8JfVRkwotz3a1nvX5dgxGV2SC++v9VOVUfBVKDMKysb2WoCeUIRp6IhGJ6vP
         +NzY5Znn2X8jnHFQMrvz8PW5D3v7zoUqzPHEg5Ut7Z+GZ6Q3ad03t9/nKq9g8gMEJxbI
         UMfQ==
X-Gm-Message-State: AOJu0YxtXm74xGEDWO4FpMMtAEkhlMGHFFTE0w8w2AEs3/eGVuR/Wuno
	YLq2fjLkUCfu/C/aPX1aUFo7CEr5CvFSObK6zkLl8asHc18H+nsvI89DelZpK646+up0B2ZisgM
	=
X-Google-Smtp-Source: AGHT+IGpWiwzAqTVc7WLm9sC1UtUSjyUtngWMSePHeKQmgDIkTcJYydkL4/Ifg0z4cUU6I+zyXyemg==
X-Received: by 2002:ac2:5332:0:b0:52e:8071:e89d with SMTP id 2adb3069b0e04-52ea063c361mr3231800e87.40.1720164753956;
        Fri, 05 Jul 2024 00:32:33 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [PATCH 1/2] Use MmGetSystemRoutineAddress to test for IoOpenDriverRegistryKey
Date: Fri,  5 Jul 2024 08:32:20 +0100
Message-ID: <20240705073221.305-1-owen.smith@cloud.com>
X-Mailer: git-send-email 2.44.0.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Server 2016 does not define the function IoOpenDriverRegistryKey, use
MmGetSystemRoutineAddress to dynamically find the function so that a
single binary can be used on Server 2016 (and Win10-1607) and Server 2025.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/common/registry.c | 47 ++++++++++++++++++++++++++++++++-----------
 1 file changed, 35 insertions(+), 12 deletions(-)

diff --git a/src/common/registry.c b/src/common/registry.c
index 211c177..fc68941 100644
--- a/src/common/registry.c
+++ b/src/common/registry.c
@@ -41,6 +41,10 @@
 static PDRIVER_OBJECT   RegistryDriverObject;
 static UNICODE_STRING   RegistryPath;
 
+typedef NTSTATUS(*IOOPENDRIVERREGISTRYKEY)(PDRIVER_OBJECT, DRIVER_REGKEY_TYPE, ACCESS_MASK, ULONG, PHANDLE);
+
+static IOOPENDRIVERREGISTRYKEY __IoOpenDriverRegistryKey;
+
 static FORCEINLINE PVOID
 __RegistryAllocate(
     IN  ULONG   Length
@@ -63,6 +67,8 @@ RegistryInitialize(
     IN  PUNICODE_STRING Path
     )
 {
+    UNICODE_STRING      Unicode;
+    PVOID               Func;
     NTSTATUS            status;
 
     ASSERT3P(RegistryPath.Buffer, ==, NULL);
@@ -74,6 +80,13 @@ RegistryInitialize(
     ASSERT3P(RegistryDriverObject, ==, NULL);
     RegistryDriverObject = DriverObject;
 
+    ASSERT3P(__IoOpenDriverRegistryKey, ==, NULL);
+    RtlInitUnicodeString(&Unicode, L"IoOpenDriverRegistryKey");
+
+    Func = MmGetSystemRoutineAddress(&Unicode);
+    if (Func != NULL)
+        __IoOpenDriverRegistryKey = (IOOPENDRIVERREGISTRYKEY)Func;
+
     return STATUS_SUCCESS;
 
 fail1:
@@ -87,6 +100,8 @@ RegistryTeardown(
     VOID
     )
 {
+    __IoOpenDriverRegistryKey = NULL;
+
     RegistryDriverObject = NULL;
 
     RtlFreeUnicodeString(&RegistryPath);
@@ -100,38 +115,46 @@ RegistryOpenParametersKey(
     OUT PHANDLE         Key
     )
 {
-#ifdef VERIFIER_REG_ISOLATION
-    return IoOpenDriverRegistryKey(RegistryDriverObject,
-                                   DriverRegKeyParameters,
-                                   DesiredAccess,
-                                   0,
-                                   Key);
-#else
     HANDLE              ServiceKey;
     NTSTATUS            status;
 
+    if (__IoOpenDriverRegistryKey != NULL) {
+        status = __IoOpenDriverRegistryKey(RegistryDriverObject,
+                                           DriverRegKeyParameters,
+                                           DesiredAccess,
+                                           0,
+                                           Key);
+        if (!NT_SUCCESS(status))
+            goto fail1;
+
+        goto done;
+    }
+
     status = RegistryOpenKey(NULL, &RegistryPath, DesiredAccess, &ServiceKey);
     if (!NT_SUCCESS(status))
-        goto fail1;
+        goto fail2;
 
     status = RegistryOpenSubKey(ServiceKey, "Parameters", DesiredAccess, Key);
     if (!NT_SUCCESS(status))
-        goto fail2;
+        goto fail3;
 
     RegistryCloseKey(ServiceKey);
 
+done:
     return STATUS_SUCCESS;
 
-fail2:
-    Error("fail2\n");
+fail3:
+    Error("fail3\n");
 
     RegistryCloseKey(ServiceKey);
 
+fail2:
+    Error("fail2\n");
+
 fail1:
     Error("fail1 %08x\n", status);
 
     return status;
-#endif
 }
 
 NTSTATUS
-- 
2.44.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Fri Jul 05 07:32:41 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 05 Jul 2024 07:32:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.754154.1162494 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sPdQu-0005w7-Gd; Fri, 05 Jul 2024 07:32:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 754154.1162494; Fri, 05 Jul 2024 07:32:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sPdQu-0005w0-Dw; Fri, 05 Jul 2024 07:32:40 +0000
Received: by outflank-mailman (input) for mailman id 754154;
 Fri, 05 Jul 2024 07:32:39 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=JG9v=OF=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sPdQt-0005uF-AA
 for win-pv-devel@lists.xenproject.org; Fri, 05 Jul 2024 07:32:39 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c03e0011-3aa0-11ef-8776-851b0ebba9a2;
 Fri, 05 Jul 2024 09:32:36 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a77cb7c106dso46416266b.1
 for <win-pv-devel@lists.xenproject.org>; Fri, 05 Jul 2024 00:32:36 -0700 (PDT)
Received: from localhost.localdomain
 (host86-134-151-174.range86-134.btcentralplus.com. [86.134.151.174])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a77c30d7c3fsm78028666b.42.2024.07.05.00.32.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 05 Jul 2024 00:32:34 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c03e0011-3aa0-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720164755; x=1720769555; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=1tnj8KELpi0xjywJu4tSxbtty1EGGbmMKcULfuiQGeg=;
        b=E8U3wde5WJ5WvNcvHHoZZJr9bJJawFE8rdLckn7GRfnTWrB44yYlE1ztsKmBZKgtxo
         kbb1J6sli0Jk/3PlrQTds3G2fyrUyiNrmxAiOOzTB8VOZy3YdT++9BZzjiKEcmFY8ZdO
         mYheVkM9A8eAPQM0AUUxMexHg0eJtvS1AcpA8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720164755; x=1720769555;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=1tnj8KELpi0xjywJu4tSxbtty1EGGbmMKcULfuiQGeg=;
        b=kS/IzcMtwXtTJ1NiicLthDs2946IItVhyfxJWP67pacwq46etl6xJvv+ZIEyC2AKdR
         QLcs0iNBJW2QHWFiORCN0+IXB774fCF9l6EajGYeCz/JKFgRbKzSWQqpgwSylzb5KeDQ
         uOwURh2IzJlDvVspW8/gihfpKmoiEAE/PkjwWRQ2ALlGT2pBPYNNW6laHLQZdsYlo29e
         gnCaoD64uYwS1ihL3a4Qeog6QbK6gPy8AqIsKC0S4fI4DbhmBJ4ZS67AX4kdx25A7Fl+
         4GAF8oTBrIK6i1gCrWBzaArRpOPfZqBFmvw1CjifjnE4YQMRqmC16t6QS5zGcSGfgbeR
         WZLw==
X-Gm-Message-State: AOJu0YwEyvlBG2IWPvYaiQLrGLkjTLBFv+EPgypA7a1l1VAySy6KvGRV
	WmBSOlplEL7K+nXlEZa9OuJQeZaKCw4pjSDY8fHP9ef0+JImdepJpZX7RRsm+oHNsVX0zb7Iu9k
	=
X-Google-Smtp-Source: AGHT+IH9sKilcLzHMQtY4E6a94ucoI5FepVVP0CE4Rq7p9vI8sq16n//u6c0OZpH+puHJsD5XDOcew==
X-Received: by 2002:a17:906:3404:b0:a77:ae4b:7bf6 with SMTP id a640c23a62f3a-a77ba70bd55mr239798566b.54.1720164755354;
        Fri, 05 Jul 2024 00:32:35 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [PATCH 2/2] Add safety check to Unplug
Date: Fri,  5 Jul 2024 08:32:21 +0100
Message-ID: <20240705073221.305-2-owen.smith@cloud.com>
X-Mailer: git-send-email 2.44.0.windows.1
In-Reply-To: <20240705073221.305-1-owen.smith@cloud.com>
References: <20240705073221.305-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

If a driver does not have the matching Enum keys to trigger an AddDevice,
then block the Unplug of any emulated device.
When a boot start driver is removed, the Enum keys are removed, but the
driver is not unloaded. Since there is no CoInstaller to remove the Unplug
value, there needs to be a check to prevent emulated devices from being
unplugged while there is no driver bindings for the child device, so the
child device will not create the PV device.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/xen/unplug.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)

diff --git a/src/xen/unplug.c b/src/xen/unplug.c
index 7ace2ab..3121005 100644
--- a/src/xen/unplug.c
+++ b/src/xen/unplug.c
@@ -49,6 +49,11 @@
 
 #define UNPLUG_TAG  'LPNU'
 
+typedef struct _UNPLUG_DATA {
+    PCHAR       Name;
+    BOOLEAN     Found;
+} UNPLUG_DATA, *PUNPLUG_DATA;
+
 typedef struct _UNPLUG_CONTEXT {
     LONG        References;
     HIGH_LOCK   Lock;
@@ -186,6 +191,74 @@ fail1:
     return status;
 }
 
+static NTSTATUS
+UnplugCheckEnumKeyCallback(
+    IN  PVOID           Context,
+    IN  HANDLE          Key,
+    IN  PANSI_STRING    Name
+    )
+{
+    PUNPLUG_DATA        Data = Context;
+
+    UNREFERENCED_PARAMETER(Key);
+
+    if (strstr(Name->Buffer, Data->Name) != NULL)
+        Data->Found = TRUE;
+
+    return STATUS_SUCCESS;
+}
+
+static NTSTATUS
+UnplugCheckEnumKey(
+    IN  PCHAR           EnumName,
+    OUT PULONG          Value
+    )
+{
+    UNICODE_STRING      Unicode;
+    UNPLUG_DATA         Data;
+    HANDLE              Key;
+    NTSTATUS            status;
+
+    RtlInitUnicodeString(&Unicode, L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Enum\\XENBUS");
+
+    status = RegistryOpenKey(NULL,
+                             &Unicode,
+                             KEY_READ,
+                             &Key);
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
+    Data.Found = FALSE;
+    Data.Name = EnumName;
+
+    status = RegistryEnumerateSubKeys(Key,
+                                      UnplugCheckEnumKeyCallback,
+                                      &Data);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    if (!Data.Found) {
+        Info("VETO Unplug %s\n", EnumName);
+        *Value = 0;
+    }
+
+    RegistryCloseKey(Key);
+
+    return STATUS_SUCCESS;
+
+fail2:
+    Error("fail2\n");
+
+    RegistryCloseKey(Key);
+
+fail1:
+    Error("fail1 %08x\n", status);
+
+    *Value = 0;
+
+    return status;
+}
+
 static VOID
 UnplugSetRequest(
     IN  UNPLUG_TYPE     Type
@@ -194,6 +267,7 @@ UnplugSetRequest(
     PUNPLUG_CONTEXT     Context = &UnplugContext;
     HANDLE              UnplugKey;
     PCHAR               ValueName;
+    PCHAR               EnumName;
     ULONG               Value;
     KIRQL               Irql;
     NTSTATUS            status;
@@ -207,12 +281,15 @@ UnplugSetRequest(
     switch (Type) {
     case UNPLUG_DISKS:
         ValueName = "DISKS";
+        EnumName = "VBD";
         break;
     case UNPLUG_NICS:
         ValueName = "NICS";
+        EnumName = "VIF";
         break;
     default:
         ValueName = NULL;
+        EnumName = NULL;
         ASSERT(FALSE);
     }
 
@@ -224,6 +301,9 @@ UnplugSetRequest(
 
     (VOID) RegistryDeleteValue(UnplugKey, ValueName);
 
+    if (Value != 0)
+        (VOID) UnplugCheckEnumKey(EnumName, &Value);
+
     Info("%s (%u)\n", ValueName, Value);
 
     AcquireHighLock(&Context->Lock, &Irql);
-- 
2.44.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Jul 08 07:02:18 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 08 Jul 2024 07:02:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.755038.1163317 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sQiO8-0006NX-AJ; Mon, 08 Jul 2024 07:02:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 755038.1163317; Mon, 08 Jul 2024 07:02:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sQiO8-0006NL-6w; Mon, 08 Jul 2024 07:02:16 +0000
Received: by outflank-mailman (input) for mailman id 755038;
 Mon, 08 Jul 2024 07:02:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=iX0w=OI=cloud.com=kelly.choi@srs-se1.protection.inumbo.net>)
 id 1sQiO7-00066r-Ic
 for win-pv-devel@lists.xenproject.org; Mon, 08 Jul 2024 07:02:15 +0000
Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com
 [2607:f8b0:4864:20::102d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0017f959-3cf8-11ef-bbfb-fd08da9f4363;
 Mon, 08 Jul 2024 09:02:14 +0200 (CEST)
Received: by mail-pj1-x102d.google.com with SMTP id
 98e67ed59e1d1-2c98a97d1ccso2790474a91.0
 for <win-pv-devel@lists.xenproject.org>; Mon, 08 Jul 2024 00:02:13 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0017f959-3cf8-11ef-bbfb-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720422131; x=1721026931; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject
         :date:message-id:reply-to;
        bh=GlmUL91vpGYV8kIApe/neR3dKN+D50bYXKKcwSeCD2w=;
        b=bw9RHX+qgUUYto2rMNHi9tyowD7hk5kC42uOz3Cy6PawVCE1KmQMNT6/TOCoYMdwci
         AmH2TAwMkvp115hU/STCQAkHD7w7zysHzQq8Sn4HUAdeK9UxtGN1kLaA05nVjLzQfnSP
         mVDSF7//rkosIkUIAIdcL1++ewZ+fi3XAyxjI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720422131; x=1721026931;
        h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=GlmUL91vpGYV8kIApe/neR3dKN+D50bYXKKcwSeCD2w=;
        b=tANbC/jAwDwdRNFEeEAdEj0x8luaGmEkDBFXOrHZGR92gqFxRtxl5jxp0bVg/bBuLY
         qp4z2OHjLljLrc6VsRAhx5h7pvF9LFZDSkGE5Lak8YoMLJh3f+1ZMnHUf25eSCgwvuDr
         K1icOnanBDl0m7uYVCRc/3PtTW+M21COiLlwGr8Zv+UVXDP5nBIDps3c3wr+QnBIZ9RU
         F91lF5Jnrv1J2gNP9e+4LxCTklLOZldnpCCXjKf+GxcRi139BSN8RWL1r1AK32it5JjI
         ekMGj0hEYYy8ZsnlD8vPlk2YpAAz5xhu0mWTViptx8RqZUZ21SdJZ8noSIys6aKREamy
         30CQ==
X-Forwarded-Encrypted: i=1; AJvYcCU0fEgQLoVDokRbJE4i7Ffz/Dq2yeBp36MhMgiKwn2bawWUpYzOvaXC/nlRdak/UQ+PQdAbkOYieQXh7BrWFS1ohx6QSFYWHAVOyHfz9wADr5c=
X-Gm-Message-State: AOJu0YxdanTCCssHb0cHO5v2C7ZCRhHHt79jyZS/feo379p/WX/HpC++
	thNWIrW0dNfHXfLZhwEDBO6xlIcBhtc5Fn5AnnCrfleou1SY2eraHHfY1FRkJ0h6vYWvHuInNjt
	1W0xKonCHHbqsWw2nr1RQtYPa2KJ5Wcjh+DZ8iQ==
X-Google-Smtp-Source: AGHT+IG4oLgN0uuHrW6brQ5w/Svh+9g8TVl946X53n95/diA8Hc0wX8bpFGUqmG2FMzI6c4QmLT6vO8PyljN4ZPNeWg=
X-Received: by 2002:a17:90a:c381:b0:2c9:75a7:5c25 with SMTP id
 98e67ed59e1d1-2c99f3ac56cmr16051365a91.15.1720422131432; Mon, 08 Jul 2024
 00:02:11 -0700 (PDT)
MIME-Version: 1.0
From: Kelly Choi <kelly.choi@cloud.com>
Date: Mon, 8 Jul 2024 08:00:00 +0100
Message-ID: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
Subject: [Vote] Xen Project Code of Conduct Team Member
To: xen-devel <xen-devel@lists.xenproject.org>, 
	"xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>, win-pv-devel@lists.xenproject.org
Cc: committers@xenproject.org, minios-devel@lists.xenproject.org, 
	mirageos-devel@lists.xenproject.org, Roger Pau Monne <roger.pau@cloud.com>
Content-Type: multipart/alternative; boundary="000000000000021b64061cb6fe20"

--000000000000021b64061cb6fe20
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi all,

As you are aware, George Dunlap has recently stepped down from the Xen
Project as a committer, but he was also a part of the Code of Conduct team.

As a result, Stefano will be the only member remaining on the CoC team. @Ro=
ger
Pau Monne <roger.pau@cloud.com> has volunteered to join the team, so that
there are at least two members.

In accordance with https://xenproject.org/developers/governance/, I need
the leadership teams of the three mature projects: the Hypervisor, the XAPI
project, and the Windows PV Driver project to vote on this proposal.

The specific voting rules, in this case, are outlined in the section:
https://www.xenproject.org/governance.html#project-decisions

I propose to tally the votes after July 31st, 2024. You can reply via email
in public or private:
+1: for proposal
-1: against proposal

Based upon previous communication and rules for voting:
The vote needs to achieve a 2/3 majority to pass.

Sub-project needs to achieve the following quorum of votes in favour for
the sub-project=E2=80=99s vote to count:
Hypervisor: 3 + votes
XAPI: 2 + votes
Windows PV Drivers: 1 + votes

Many thanks,
Kelly Choi

Community Manager
Xen Project

--000000000000021b64061cb6fe20
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi all,=C2=A0<div><br></div><div>As you are aware, George =
Dunlap has recently stepped down from the Xen Project as a committer, but h=
e was also a part of the Code of Conduct team.</div><div><br></div><div>As =
a result, Stefano will be the only member remaining on the CoC team.=C2=A0<=
a class=3D"gmail_plusreply" id=3D"m_-6110525638451986579m_52176897574306858=
12m_2021811972426709313plusReplyChip-0" href=3D"mailto:roger.pau@cloud.com"=
 target=3D"_blank">@Roger Pau Monne</a>=C2=A0has volunteered to join the te=
am, so that there are at least two members.</div><div><br></div>In accordan=
ce with <a href=3D"https://xenproject.org/developers/governance/" target=3D=
"_blank">https://xenproject.org/developers/governance/</a>, I need the lead=
ership teams of the three mature projects: the Hypervisor, the XAPI project=
, and the Windows PV Driver project to vote on this proposal.<br><br>The sp=
ecific voting rules, in this case, are outlined in the section: <a href=3D"=
https://www.xenproject.org/governance.html#project-decisions" target=3D"_bl=
ank">https://www.xenproject.org/governance.html#project-decisions</a><div><=
br></div><div>I propose to tally the votes after July 31st, 2024. You can r=
eply via email in public or private:<br>+1: for proposal<br>-1: against pro=
posal</div><div><br></div><div>Based upon previous communication and rules =
for voting:</div><div>The vote needs to achieve a 2/3 majority to pass.<br>=
</div><div><br>Sub-project needs to achieve the following quorum of votes i=
n favour for the sub-project=E2=80=99s vote to count:<br>Hypervisor: 3 + vo=
tes<br>XAPI: 2 + votes<br>Windows PV Drivers: 1 + votes</div><div><br></div=
><div><div>Many thanks,<br></div><div><div dir=3D"ltr" class=3D"gmail_signa=
ture" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div>Kelly Choi</=
div><div><br></div><div><div style=3D"color:rgb(136,136,136)">Community Man=
ager</div><div style=3D"color:rgb(136,136,136)">Xen Project=C2=A0<br></div>=
</div></div></div></div></div></div>

--000000000000021b64061cb6fe20--


From win-pv-devel-bounces@lists.xenproject.org Mon Jul 08 07:22:27 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 08 Jul 2024 07:22:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.755075.1163339 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sQihf-00020u-6S; Mon, 08 Jul 2024 07:22:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 755075.1163339; Mon, 08 Jul 2024 07:22:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sQihf-00020n-3k; Mon, 08 Jul 2024 07:22:27 +0000
Received: by outflank-mailman (input) for mailman id 755075;
 Mon, 08 Jul 2024 07:22:25 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ZbOq=OI=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sQihd-00020b-Fr
 for win-pv-devel@lists.xenproject.org; Mon, 08 Jul 2024 07:22:25 +0000
Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com
 [2607:f8b0:4864:20::d2d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d18ba7a8-3cfa-11ef-8776-851b0ebba9a2;
 Mon, 08 Jul 2024 09:22:23 +0200 (CEST)
Received: by mail-io1-xd2d.google.com with SMTP id
 ca18e2360f4ac-7f684710ff5so72953339f.1
 for <win-pv-devel@lists.xenproject.org>; Mon, 08 Jul 2024 00:22:23 -0700 (PDT)
Received: from [192.168.10.46] (54-240-197-238.amazon.com. [54.240.197.238])
 by smtp.gmail.com with ESMTPSA id
 8926c6da1cb9f-4bb73fa125fsm5957850173.113.2024.07.08.00.22.21
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 08 Jul 2024 00:22:21 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d18ba7a8-3cfa-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1720423342; x=1721028142; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:to:subject:reply-to:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=IcbRuzInckEAfvJ/riMqNTqHiSTdiC21KjaW5Kxc4jY=;
        b=bjS3Wyvbh0D4KhA6Idb02OhDsX8HRBSQ10Knfvbvxk1mLIG5hOSZu3fmtRdGX4UB0n
         lOdydY8ZlHD4klHg/XVIJjdCIvv33/dUZ0m6CmiGpOKADf0vKCXVYg1MoDW9h95gxd0+
         Q/UJ0QZPw+rbnSjW94h1fz4570kjCPX4oyq5sH7BxKXeuaQ8F+gQ4DwCIIzwbW26UbGX
         upYCiZVrbdoePj2y+JJmi8ZOBUfAudmc+UqSjsCG/8ErqftkVUFwGeSNAdN0h3n0Xn+b
         QewY2cmqqczpY3IX+DkejhaZWmBr65Mcy3aIG5XGAx9FZe1MSPqZPTAvmfJeekjbaHcl
         gF7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720423342; x=1721028142;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:to:subject:reply-to:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=IcbRuzInckEAfvJ/riMqNTqHiSTdiC21KjaW5Kxc4jY=;
        b=jfZjW7weSUr6NtCkcBGIyvT4F7QEHwp7CIq0R5KTs4V+QmaqxbByu/FHGaboqVoQmd
         BWZn5xX9pD2cOSKe388UvzygwMsFEYTRDKJaPjeZRuDyXFQYCThFlxv7wZCxGmEnxxC0
         sg+5C3VGtNwf0P5dHwk1HjNN81JrtiX5XDTAt9KG7aAkwRYRM4RSX9YetcTEZBS02M3h
         dSZqkvYNsAs+qpB1irs2USAsnuP9toH41gplm1AI7PCUDPpPXVJu7lLp+mLxdSqZkVyR
         IUFQnpNzrOIPJJXlzeiKuq/OoKL9Kl6flDFaz2eu8yV6tMM6dVadVbOYiDhXz4T1fPix
         QdIQ==
X-Gm-Message-State: AOJu0Yx0PQlnJeStr8g2B24dQnp05phat80/9Z1b5UDbnPOb95kVsSHL
	MtKSD7KsyU4ERa8aHl+8F0JxmfbNB9j2OSof/qKKx8GOMdQz95lItFh8GpPX
X-Google-Smtp-Source: AGHT+IGgaw0plh/ZTDdibhWtE/yGnTvzcvDqcL8eX+6DBc7jlbrCe5TNlCUNUlq+7X+mhG7mfLKz+Q==
X-Received: by 2002:a05:6602:3311:b0:7f8:c131:3be6 with SMTP id ca18e2360f4ac-7f8c131412cmr246577239f.0.1720423341963;
        Mon, 08 Jul 2024 00:22:21 -0700 (PDT)
Message-ID: <991c32bd-0474-4184-98f1-ffb9a7811e97@gmail.com>
Date: Mon, 8 Jul 2024 08:22:19 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Reply-To: paul@xen.org
Subject: Re: [Vote] Xen Project Code of Conduct Team Member
To: win-pv-devel@lists.xenproject.org, kelly.choi@cloud.com
References: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
Content-Language: en-US
From: "Durrant, Paul" <xadimgnik@gmail.com>
In-Reply-To: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 08/07/2024 08:00, Kelly Choi wrote:
> Hi all,
> 
> As you are aware, George Dunlap has recently stepped down from the Xen 
> Project as a committer, but he was also a part of the Code of Conduct team.
> 
> As a result, Stefano will be the only member remaining on the CoC team. 
> @Roger Pau Monne <mailto:roger.pau@cloud.com> has volunteered to join 
> the team, so that there are at least two members.
> 
> In accordance with https://xenproject.org/developers/governance/ 
> <https://xenproject.org/developers/governance/>, I need the leadership 
> teams of the three mature projects: the Hypervisor, the XAPI project, 
> and the Windows PV Driver project to vote on this proposal.
> 
> The specific voting rules, in this case, are outlined in the section: 
> https://www.xenproject.org/governance.html#project-decisions 
> <https://www.xenproject.org/governance.html#project-decisions>
> 
> I propose to tally the votes after July 31st, 2024. You can reply via 
> email in public or private:
> +1: for proposal
> -1: against proposal
> 
> Based upon previous communication and rules for voting:
> The vote needs to achieve a 2/3 majority to pass.
> 

+1



From win-pv-devel-bounces@lists.xenproject.org Mon Jul 08 07:23:31 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 08 Jul 2024 07:23:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.755084.1163344 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sQiih-000289-Ch; Mon, 08 Jul 2024 07:23:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 755084.1163344; Mon, 08 Jul 2024 07:23:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sQiih-00027w-8X; Mon, 08 Jul 2024 07:23:31 +0000
Received: by outflank-mailman (input) for mailman id 755084;
 Mon, 08 Jul 2024 07:23:30 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sWbT=OI=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sQiig-000278-G2
 for win-pv-devel@lists.xenproject.org; Mon, 08 Jul 2024 07:23:30 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f8c0c57a-3cfa-11ef-8776-851b0ebba9a2;
 Mon, 08 Jul 2024 09:23:28 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-52e9fe05354so5214145e87.1
 for <win-pv-devel@lists.xenproject.org>; Mon, 08 Jul 2024 00:23:28 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f8c0c57a-3cfa-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720423408; x=1721028208; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=QA5XKySHBbQyTCaAwDrcN0EPTjdnFOPBEWnC3CbkYW0=;
        b=FnZrnRYm5+CLrE5a+v75zdg+ecqfB37DxYRsAC4wB2RF7kLy+ykJ7bDsv3BQDbp6eC
         kITzBJjbE/rlcKlH7P9lpMPgiqaBY81FgILuQJGOaTM6y6/ts8i3hq8sQkFK/iBNC6wN
         6LZBAmboJgbQhaFpnZ8IO0XlvWyVqv3r2qThU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720423408; x=1721028208;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=QA5XKySHBbQyTCaAwDrcN0EPTjdnFOPBEWnC3CbkYW0=;
        b=T/qyebalMmHpv5tC4cBVy5syyoQMT3ZnEuDTBtQYuLQnCGFECfJpUbnUI1ruz+IhFT
         rVUQiBIiG5XFynDjwIQgrm18sD+rS5AnCDk4H9L7wl1oskXqt5fcwwBXfxDyXZ4Cqqtu
         WmMr47tTrbuJ4RsXODjpvQyPVmy+BiUcA46qrspuZ8LQESYlvE4bU/Do5GKbT6Izpq8q
         xKnGPPacZm4dUb3bLGzkzGXCl85EYbeicPR45JFyS9f7wnRex+3M310CgPD3zLuWPT1r
         arLog9bR8cl+x7EaFsNeGvtKBBLZz/lrryetslX2VpoCGykicO0QiGMow4LGUXONm35V
         oPig==
X-Forwarded-Encrypted: i=1; AJvYcCV1QiE3IptZYa84ku7YHUW3ONe2YCjSo74UGF5/3x3pS5uPRscGSJe8ywrw25A8zjamB55Xo1c7GXGGHeEcmK8A4O+G6Je8VDxBUkrzq2rO9A0=
X-Gm-Message-State: AOJu0YwFcy5Vu6Tqfmgl70fwt9moPXyNiAD0FJ3WBqCzkPXK+O0+XeLf
	LfsHL1k2PQkVHDbaCBMi8lCcOoQaV3tgrJdNiTNKHUGOQi8LcXg9rlILtTDhq18E23r72tNrnwF
	cLbWQENNSBTAAWbONEDUzWhfSq29B2oQxkb2g
X-Google-Smtp-Source: AGHT+IFccTZJINWUE5iwTO3jg+NpURSgSFe3gLg8I1IMugGEqoLZMNPVbq7mLwVoWuCNOvk/e5rLlHTjh2WNsaY/ypk=
X-Received: by 2002:ac2:5050:0:b0:52e:747f:46d9 with SMTP id
 2adb3069b0e04-52ea0629af0mr8702168e87.17.1720423407795; Mon, 08 Jul 2024
 00:23:27 -0700 (PDT)
MIME-Version: 1.0
References: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
In-Reply-To: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
From: Owen Smith <owen.smith@cloud.com>
Date: Mon, 8 Jul 2024 08:23:15 +0100
Message-ID: <CAC_UY88mKye2Ti5pmOuFZqP1nR5WQdYXWeqGR7fdukjoFS2BmA@mail.gmail.com>
Subject: Re: [Vote] Xen Project Code of Conduct Team Member
To: Kelly Choi <kelly.choi@cloud.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, 
	"xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>, win-pv-devel@lists.xenproject.org, 
	committers@xenproject.org, minios-devel@lists.xenproject.org, 
	mirageos-devel@lists.xenproject.org, Roger Pau Monne <roger.pau@cloud.com>
Content-Type: multipart/alternative; boundary="00000000000015e34b061cb74a0a"

--00000000000015e34b061cb74a0a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

+1

On Mon, Jul 8, 2024 at 8:02=E2=80=AFAM Kelly Choi <kelly.choi@cloud.com> wr=
ote:

> Hi all,
>
> As you are aware, George Dunlap has recently stepped down from the Xen
> Project as a committer, but he was also a part of the Code of Conduct tea=
m.
>
> As a result, Stefano will be the only member remaining on the CoC team. @=
Roger
> Pau Monne <roger.pau@cloud.com> has volunteered to join the team, so that
> there are at least two members.
>
> In accordance with https://xenproject.org/developers/governance/, I need
> the leadership teams of the three mature projects: the Hypervisor, the XA=
PI
> project, and the Windows PV Driver project to vote on this proposal.
>
> The specific voting rules, in this case, are outlined in the section:
> https://www.xenproject.org/governance.html#project-decisions
>
> I propose to tally the votes after July 31st, 2024. You can reply via
> email in public or private:
> +1: for proposal
> -1: against proposal
>
> Based upon previous communication and rules for voting:
> The vote needs to achieve a 2/3 majority to pass.
>
> Sub-project needs to achieve the following quorum of votes in favour for
> the sub-project=E2=80=99s vote to count:
> Hypervisor: 3 + votes
> XAPI: 2 + votes
> Windows PV Drivers: 1 + votes
>
> Many thanks,
> Kelly Choi
>
> Community Manager
> Xen Project
>

--00000000000015e34b061cb74a0a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e">+1<br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=
=3D"gmail_attr">On Mon, Jul 8, 2024 at 8:02=E2=80=AFAM Kelly Choi &lt;<a hr=
ef=3D"mailto:kelly.choi@cloud.com">kelly.choi@cloud.com</a>&gt; wrote:<br><=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo=
rder-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">Hi =
all,=C2=A0<div><br></div><div>As you are aware, George Dunlap has recently =
stepped down from the Xen Project as a committer, but he was also a part of=
 the Code of Conduct team.</div><div><br></div><div>As a result, Stefano wi=
ll be the only member remaining on the CoC team.=C2=A0<a class=3D"gmail_plu=
sreply" id=3D"m_4169227896029523200m_-6110525638451986579m_5217689757430685=
812m_2021811972426709313plusReplyChip-0" href=3D"mailto:roger.pau@cloud.com=
" target=3D"_blank">@Roger Pau Monne</a>=C2=A0has volunteered to join the t=
eam, so that there are at least two members.</div><div><br></div>In accorda=
nce with <a href=3D"https://xenproject.org/developers/governance/" target=
=3D"_blank">https://xenproject.org/developers/governance/</a>, I need the l=
eadership teams of the three mature projects: the Hypervisor, the XAPI proj=
ect, and the Windows PV Driver project to vote on this proposal.<br><br>The=
 specific voting rules, in this case, are outlined in the section: <a href=
=3D"https://www.xenproject.org/governance.html#project-decisions" target=3D=
"_blank">https://www.xenproject.org/governance.html#project-decisions</a><d=
iv><br></div><div>I propose to tally the votes after July 31st, 2024. You c=
an reply via email in public or private:<br>+1: for proposal<br>-1: against=
 proposal</div><div><br></div><div>Based upon previous communication and ru=
les for voting:</div><div>The vote needs to achieve a 2/3 majority to pass.=
<br></div><div><br>Sub-project needs to achieve the following quorum of vot=
es in favour for the sub-project=E2=80=99s vote to count:<br>Hypervisor: 3 =
+ votes<br>XAPI: 2 + votes<br>Windows PV Drivers: 1 + votes</div><div><br><=
/div><div><div>Many thanks,<br></div><div><div dir=3D"ltr" class=3D"gmail_s=
ignature"><div dir=3D"ltr"><div>Kelly Choi</div><div><br></div><div><div st=
yle=3D"color:rgb(136,136,136)">Community Manager</div><div style=3D"color:r=
gb(136,136,136)">Xen Project=C2=A0<br></div></div></div></div></div></div><=
/div>
</blockquote></div>

--00000000000015e34b061cb74a0a--


From win-pv-devel-bounces@lists.xenproject.org Mon Jul 08 08:02:07 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 08 Jul 2024 08:02:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.755112.1163369 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sQjK2-0000og-Qk; Mon, 08 Jul 2024 08:02:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 755112.1163369; Mon, 08 Jul 2024 08:02:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sQjK2-0000nX-JP; Mon, 08 Jul 2024 08:02:06 +0000
Received: by outflank-mailman (input) for mailman id 755112;
 Mon, 08 Jul 2024 08:02:05 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=suqh=OI=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sQjK1-0000l8-Bg
 for win-pv-devel@lists.xenproject.org; Mon, 08 Jul 2024 08:02:05 +0000
Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com
 [2a00:1450:4864:20::22b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5c5a13ae-3d00-11ef-8776-851b0ebba9a2;
 Mon, 08 Jul 2024 10:02:03 +0200 (CEST)
Received: by mail-lj1-x22b.google.com with SMTP id
 38308e7fff4ca-2ee7885aa5fso38857831fa.1
 for <win-pv-devel@lists.xenproject.org>; Mon, 08 Jul 2024 01:02:03 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-70b2eb78584sm1830354b3a.169.2024.07.08.01.01.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 08 Jul 2024 01:02:02 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c5a13ae-3d00-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1720425722; x=1721030522; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=BBGmLq09nC37TEnoNtj+D0NCHJwn049BW+yNaxMy4mw=;
        b=PdN+qiO07XAx+TaOgtsSeMs/jq1x384sqf6vyE44p6/K/84M/4KbJdnwQXq8vmmG2g
         iiTYmnH8aPuo8SYxazRd9TFuneLoWiqY4mObgdGbl/UJw079f9vndQNNWJeykuqk8wvu
         2UgUHDomsi7lEHvemJcAYyVTe49bIBLNv6QIp2G8AYDXWXpP78g2iyo1s2Q0mavaU/ka
         Zw/0sR3ijFwxHsoTmoJVfzzuNFhbk3m5icgNCT198yVZDsgTGHYRWU1aDUj9MONM9IG0
         RQP4m6/znyTgtn3eB6Svbd55AmyJlKdq4h29avT06hszewkl33FVsq6y0X7PsKaiGHb9
         SARQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720425722; x=1721030522;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=BBGmLq09nC37TEnoNtj+D0NCHJwn049BW+yNaxMy4mw=;
        b=BM1pXjYlB3EIYyXIs9WGuQDqyEqP4NE17tRWkpb5PrcIYR8DMXzXz6r+7AmJ3P6Teu
         ZQxoBRDD/QSv4v33PHFMvn9LFv9ac3uVbXUOeI0YF0Fm/3DxfnjJVQ8dGSZxpVu8xg44
         D71Vy+EgoBfPtKLZQqR6J30rUkh+FBpH601aQaZJDBfh69ODf8lTanYCq1wjkMDhVOJx
         sDTOu1X3GbNm+s0cfzXqqJxvPI7Uu//soy9ggCMLyiL1YM4jP3sLhuwBluyDM8R0fxuc
         D7z+rmJus+iWN4eMI/YVASEuUGt2uta4eUUoQa9ahjGxotmnfoPLy/TyJrDwDaIMb+3H
         o4pg==
X-Forwarded-Encrypted: i=1; AJvYcCV1F9ltLdUMae02I2hgIJtSLAjqWy4kyhin7mhV530qkjly/KLwtyJn53ZvkjNHsmbyC4S41FGjfU5Yu+7f9KlVLCcpHIHFhUyV6dKpCA27+AU=
X-Gm-Message-State: AOJu0YyGyZCGP6CfzNLN/nWJgbLqcCQi83U6kPgibw+gj1UmI3dd8IcN
	n83kclECEpSqKsgiPSLTQnTJMZnIafipSpobGvRe3N5gTuLgyr/taT365VWrJw==
X-Google-Smtp-Source: AGHT+IHaxxfSCswIcatlh8blJpZdH4N5a8/iFUAWnfzl1Tszlq3RsbZTCd6VWncmnl577Dj13Zybvw==
X-Received: by 2002:a2e:8889:0:b0:2ec:3d2e:2408 with SMTP id 38308e7fff4ca-2ee8ee00250mr71357251fa.33.1720425722514;
        Mon, 08 Jul 2024 01:02:02 -0700 (PDT)
Message-ID: <2e9226a1-4196-4ff3-bea6-f8a2cf249dff@suse.com>
Date: Mon, 8 Jul 2024 10:01:57 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [Vote] Xen Project Code of Conduct Team Member
To: Kelly Choi <kelly.choi@cloud.com>
Cc: committers@xenproject.org, minios-devel@lists.xenproject.org,
 mirageos-devel@lists.xenproject.org, Roger Pau Monne <roger.pau@cloud.com>,
 xen-devel <xen-devel@lists.xenproject.org>,
 "xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>,
 win-pv-devel@lists.xenproject.org
References: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 08.07.2024 09:00, Kelly Choi wrote:
> Hi all,
> 
> As you are aware, George Dunlap has recently stepped down from the Xen
> Project as a committer, but he was also a part of the Code of Conduct team.
> 
> As a result, Stefano will be the only member remaining on the CoC team. @Roger
> Pau Monne <roger.pau@cloud.com> has volunteered to join the team, so that
> there are at least two members.

+1

Jan

> In accordance with https://xenproject.org/developers/governance/, I need
> the leadership teams of the three mature projects: the Hypervisor, the XAPI
> project, and the Windows PV Driver project to vote on this proposal.
> 
> The specific voting rules, in this case, are outlined in the section:
> https://www.xenproject.org/governance.html#project-decisions
> 
> I propose to tally the votes after July 31st, 2024. You can reply via email
> in public or private:
> +1: for proposal
> -1: against proposal
> 
> Based upon previous communication and rules for voting:
> The vote needs to achieve a 2/3 majority to pass.
> 
> Sub-project needs to achieve the following quorum of votes in favour for
> the sub-project’s vote to count:
> Hypervisor: 3 + votes
> XAPI: 2 + votes
> Windows PV Drivers: 1 + votes
> 
> Many thanks,
> Kelly Choi
> 
> Community Manager
> Xen Project
> 



From win-pv-devel-bounces@lists.xenproject.org Mon Jul 08 14:00:44 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 08 Jul 2024 14:00:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.755433.1163790 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sQov3-0000RE-FW; Mon, 08 Jul 2024 14:00:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 755433.1163790; Mon, 08 Jul 2024 14:00:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sQov3-0000R7-C9; Mon, 08 Jul 2024 14:00:41 +0000
Received: by outflank-mailman (input) for mailman id 755433;
 Mon, 08 Jul 2024 14:00:39 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=cS7R=OI=invisiblethingslab.com=omeg@srs-se1.protection.inumbo.net>)
 id 1sQov1-0000R1-AI
 for win-pv-devel@lists.xenproject.org; Mon, 08 Jul 2024 14:00:39 +0000
Received: from fhigh6-smtp.messagingengine.com
 (fhigh6-smtp.messagingengine.com [103.168.172.157])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 71898d18-3d32-11ef-8776-851b0ebba9a2;
 Mon, 08 Jul 2024 16:00:34 +0200 (CEST)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailfhigh.nyi.internal (Postfix) with ESMTP id C3B3411402CC
 for <win-pv-devel@lists.xenproject.org>; Mon,  8 Jul 2024 10:00:32 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute4.internal (MEProxy); Mon, 08 Jul 2024 10:00:32 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA for
 <win-pv-devel@lists.xenproject.org>; Mon,
 8 Jul 2024 10:00:30 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 71898d18-3d32-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:content-type:content-type:date:date
	:from:from:in-reply-to:message-id:mime-version:reply-to:subject
	:subject:to:to; s=fm2; t=1720447232; x=1720533632; bh=UzIVomobTN
	vE5YlSXoMo8ZWDaAnJjFbDTCWL2f4UoYg=; b=mB1Fat+A9WGg7KxGTYtcSP5naQ
	qHUnc1KzpZNBRhwp0+9nmbHF9KsI+eqb6ZKVzXNCvJqb5Mtuc0J59kHwQ8daTCNE
	Vd5FknmxQlafFYgQpJzsTttThwtng+aogz6sZoNdn9sdRCxH2az5/UJ4yDu9coSY
	omPbu4XXHaCkMhffRUx3LRDKuLf+tgEahEl3AMBFMm9DZawUpfNFDJQn1mSJr/in
	wT77xeC9UGSF6WRPiUyKtcbR15f3/lYJE7fepT9OlLLMRoEQgW/mMTMR1XrUgmAZ
	DOgnskADgUhGS6kTJGacXXLSbLoYCZl7opvJt9It7e5TFMSfPa3isnoEv5+Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:message-id
	:mime-version:reply-to:subject:subject:to:to:x-me-proxy
	:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1720447232; x=1720533632; bh=UzIVomobTNvE5YlSXoMo8ZWDaAnJjFbDTCW
	L2f4UoYg=; b=ls8FVtRNDA6p5o0KQRzX79XdPRw5Ek8z9RbJ3x5gYiFOkSBssfO
	JupuqnNsspLqoYuqXIm0DsjzElmI89UrRxinEQQMAEVOVsieBJKypS+RffJ6zDNr
	9sBqX4vzyRawf1BmSwR8kPqiLkSLZueWxSlluCaQ9//j6x8ZgLT6PJcizx62IUm8
	RDKLnjZ3MejN3/3KSq62g1QgkafKsC2acBSFwoLNHVnngmp1JsryLX94kI08riwb
	lwKfrcHTGSrZxNRgDllA5qR2NOmVTtiMbn4LV8kpyLE0d3Nx+908tFeg4CSK5kn2
	khTM1i/yE7YvcfG41vvUYvONXYymRzVBngw==
X-ME-Sender: <xms:__CLZhfnBTdz-wk0Ouh2uSDoeWpzO4YmWoOTDT_2LJ7R1XmGHNdqEg>
    <xme:__CLZvMqTP7gVrF_8w1_0II6lTgaNbRynilIY69-aT2PIVn_Zv3Wvrheuxlc2131k
    vNU4LU9qlXw2uE>
X-ME-Received: <xmr:__CLZqjzaP5O8mEXht3CcJydCpdrDLyqtVHjzyaUJP5fu_DiwLBSQqYYQ0ci5OYZmgmn-6h9TnIVBW7nl99fzvTRCpISxw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdejgdejudcutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfvffhufgtsehgtderredtvd
    ejnecuhfhrohhmpeftrghfrghlucghohhjugihlhgruceoohhmvghgsehinhhvihhsihgs
    lhgvthhhihhnghhslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepiefggedttdelhf
    ffteduleeuvdegfeeludeiheffkedufffhteejtdekueffhfelnecuffhomhgrihhnpeig
    vghnrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh
    homhepohhmvghgsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh
X-ME-Proxy: <xmx:__CLZq8aXDGum4X52VeSZL_aZsgL29DI2ZIfebf9UOPV2Bqtg9AJgg>
    <xmx:__CLZttayFvDuVTKTFzn5jPaoocty8jJytV4Mw_6d-Jo3Ijjo0K3DA>
    <xmx:__CLZpENukJ7Twqemr9PpcxOaJNxuxsXbyz4xoXCT4JX-cyJDs5EbA>
    <xmx:__CLZkOesUMB-7nQNWGtKzd5rBUpOASGpP7Vk02-rpH_RTbJjoMYlw>
    <xmx:APGLZr3dcbL3IaEzDC2L3ZcNfx2LHVso1bcwUqKpBc0n2IZ3zY019fX8>
Feedback-ID: i409c4082:Fastmail
Message-ID: <942f1752-a860-4422-b37e-f8e9a71e1db8@invisiblethingslab.com>
Date: Mon, 8 Jul 2024 16:00:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: win-pv-devel@lists.xenproject.org
From: =?UTF-8?B?UmFmYcWCIFdvamR5xYJh?= <omeg@invisiblethingslab.com>
Autocrypt: addr=omeg@invisiblethingslab.com;
 keydata= xsBNBFH+JQwBCAC0ym1Jtm5HM2p32Nw8NDNdkhwJR1For9txOKqeYMJWBTPzGJQG9HVHdYY/
 PZNfzvJkl26q1CB7JbAXVq2rSt1hn7cc4qL4BIDackJ4SEAAYbSLK82pQYUHhj18nNzZgxnn
 DBHpppRUA76DhSRKxEOZ+7GQAHd6H8RA0zBW+5ut0iOmglia3sOlim2yqeBRj6XaRn3RGmT9
 LXQu/UrJDY52LwJGE9on1wTvw+tN4QmCipFUk6YToVbkHiyDSnNN6aRqclH0vJBZquagQ/wn
 aOohowIyyzbY2+GJspKEPD3J9Ov5aKe/jN13WjBYwcy+NUG9SWT+VTIi6th43mh/L3dNABEB
 AAHNLVJhZmHFgiBXb2pkecWCYSA8b21lZ0BpbnZpc2libGV0aGluZ3NsYWIuY29tPsLAeQQT
 AQIAIwUCUkHE5wIbAwcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEIWi9rB2GrW7hasI
 AK5DFMRDqARqlOIncq0bDJbbPnScXozcVjrU2jHaA736d9eoXNixSxX+D1+4QGjgEIUJWaa6
 yqGTlqgHdOMKWYoDpUsm56Utj16E/ln1hSxXxEeHL30Fyqfqfmi0mlJv4ijasfxqwoHSt+Yy
 cACIhm563cwCaAdaO++lrcF2O/g+KIUXo0uEx+n6c8M25gu2TC3Cxn1ZeWH+5y9rUB6ph6JV
 eVKAYBSdK4qDEpDwz124YcpBloh5S4Jt6pVBSbJodbP+LQyet3Gb3IMYzFa+M6SMO/6EQX8k
 Q0zv1axlFCFs/Wf19A+nh40fZRRL+Q/v3lY9/v7u2mY4jGvKYao+sKXOwE0EUf4lDAEIALD5
 ungRVF1VnOKpNBS6xcpXw7jGX5Lh+r9fOZ9pSyqQRfD5t6yF3bjwgJBzfIJO2t/WhxlNTwZA
 Y3ZYA/+UBOyi9Y0axEp1L6bR42iC1tCt4kawpm+Lye4aRXdbKo/EBP6wSUiOqQ3+LLLmnaSj
 saAiYQWUZ3at1hOHrZZRIy3vk38rsheWURu6FQWc4VK2odEFtKD2gvw0s93Q6xbMahcWRP3M
 1TWzBSlO4pbV64nXBJVtqDOOs/jQwYjkdotNWb70a2uYasPz+btS0YvW31m94zedXdKZnJN+
 kP314z1q7Gv8CPfgRTqU3JonIkw69ylk2AGzeRv5oFVhRKgFlv0AEQEAAcLAXwQYAQIACQUC
 Uf4lDAIbDAAKCRCFovawdhq1u8wYB/9kZRnMX5gm0Yq7zdqu/K6o3EfAfYI/ZBOXSgYcb58s
 L1Jy+b3inq5PZQrLn7D9V5DFBBjKwthhKVK/eKCALqYuVvaiBmhHjE02xZoi1g7pvV2kj0z6
 OFtF2IXO4vwtaHQhhIutVd+jjDmnSl0kYCBurOjVFmD2ZCTDQ5/JqEDU26V5i9Dwp9sImDm7
 r3lBgLOKu5uWKoQRHbdxPN8FzoFfxDH+xZKubqGgvEvCsX1CjFRP7/kcGW5TrAb/rNEOG1Ik
 25Qj7mjWFa6sv2jYvV1aIpCK8sKKTPeS0mRfhnqQDYqluBsOQIrSHSHbjCTkuIdSutzJyxpG
 xLY7n9TPT2ug
Subject: Some release signing questions
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------DYWF8TQqO41HB80i7cqqXnT0"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------DYWF8TQqO41HB80i7cqqXnT0
Content-Type: multipart/mixed; boundary="------------jA7AMdoMw2XjM6JtYX009D50";
 protected-headers="v1"
From: =?UTF-8?B?UmFmYcWCIFdvamR5xYJh?= <omeg@invisiblethingslab.com>
To: win-pv-devel@lists.xenproject.org
Message-ID: <942f1752-a860-4422-b37e-f8e9a71e1db8@invisiblethingslab.com>
Subject: Some release signing questions

--------------jA7AMdoMw2XjM6JtYX009D50
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

SGksDQoNCkknbSB3b25kZXJpbmcgd2hhdCdzIHRoZSBiZXN0IHdheSB0byBoYXZlIHRoZSBj
dXJyZW50IHB2ZHJpdmVyIHBhY2thZ2VzIA0KcmVsZWFzZS1zaWduZWQuIEkgdW5kZXJzdGFu
ZCB3ZSdkIG5lZWQgdG8gc3VibWl0IG91ciBvd24gc2lnbmVkIGRyaXZlcnMgDQp0byBNUywg
YnV0IEkgaGF2ZSB0d28gdGVjaG5pY2FsIHF1ZXN0aW9uczoNCg0KMS4gVG8gYXZvaWQgY29u
ZmxpY3RzIHdpdGggb3RoZXIgY2VydGlmaWVkIGRyaXZlcnMgd2UnZCBuZWVkIHRvIGJpbmQg
dG8gDQpkaWZmZXJlbnQgUENJIGRldmljZSBJRHMsIGNvcnJlY3Q/IFNob3VsZCB3ZSByZXF1
ZXN0IG91ciBvd24gcmFuZ2UgYXMgDQpkZXNjcmliZWQgaGVyZSANCmh0dHBzOi8veGVuYml0
cy54ZW4ub3JnL2RvY3MvdW5zdGFibGUvbWFuL3hlbi1wY2ktZGV2aWNlLXJlc2VydmF0aW9u
cy43Lmh0bWwgDQo/DQoNCjIuIElzIHRoZXJlIGEgbGlzdCBvZiBITEsgdGVzdHMgdGhhdCB3
ZXJlIHJ1biBmb3IgdGhlIHByZXZpb3VzIA0KWGVuLXByb3ZpZGVkIHJlbGVhc2UgYnVpbGRz
PyBJJ3ZlIG5ldmVyIHdlbnQgdGhyb3VnaCB0aGUgZnVsbCBIQ0sgDQpjZXJ0aWZpY2F0aW9u
IHByb2Nlc3MgYmVmb3JlLCBidXQgSSBkaWQgcnVuIHNvbWUgdGVzdHMgd2l0aCBITEsgDQoo
YWx0aG91Z2ggbm90IGluIGEgcmVhbCBYZW4gZW52aXJvbm1lbnQpLg0KDQotLSANClJhZmHF
giBXb2pkecWCYQ0KSW52aXNpYmxlIFRoaW5ncyBMYWINCg==

--------------jA7AMdoMw2XjM6JtYX009D50--

--------------DYWF8TQqO41HB80i7cqqXnT0
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature.asc"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEVwOm02mHaIsSbeWChaL2sHYatbsFAmaL8PwFAwAAAAAACgkQhaL2sHYatbsj
5gf/VirdKiMKsafXiqGhTnODr/PHrsRtei1vqTEJ2vJyCc9BKxihVGb5JwUnjzpee/tA899OZs2g
gqds1SyP0fsBiVnLK7GdF/iI2x/y3aOXR3QpIQRf7QcGbYTyUXI2/f84MhWQIRgJpGfhDQFIA14E
yIrc862e8ZIzLEI5/kWABM6FQOMpP8Ice9t68Mah9F5ptmX39L3ANmeyOlO5yBeVH8SV7H7lY603
vAM3umQJBQmPZ+vPvXLvbpmqGRgeSQQkbQsSCZNOmxPNAgDIUFSntWsF9SHL3kNCAQrzXmvyy8f5
3oBOeP+VUT7WtGGtepasew1Jxdi73fz6MUFc8IDE7w==
=5fs1
-----END PGP SIGNATURE-----

--------------DYWF8TQqO41HB80i7cqqXnT0--


From win-pv-devel-bounces@lists.xenproject.org Mon Jul 08 19:57:32 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 08 Jul 2024 19:57:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.755597.1164009 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sQuUN-0004gJ-20; Mon, 08 Jul 2024 19:57:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 755597.1164009; Mon, 08 Jul 2024 19:57:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sQuUM-0004gC-VX; Mon, 08 Jul 2024 19:57:30 +0000
Received: by outflank-mailman (input) for mailman id 755597;
 Mon, 08 Jul 2024 19:57:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=EgpN=OI=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sQuUL-0004ZL-LO
 for win-pv-devel@lists.xenproject.org; Mon, 08 Jul 2024 19:57:29 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4b491391-3d64-11ef-bbfb-fd08da9f4363;
 Mon, 08 Jul 2024 21:57:27 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 476D0CE0F08;
 Mon,  8 Jul 2024 19:57:21 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90549C116B1;
 Mon,  8 Jul 2024 19:57:19 +0000 (UTC)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4b491391-3d64-11ef-bbfb-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1720468640;
	bh=vk8qUoPKpAVrK7exPxJCI1y8r71oNkMKkVp76PWQMx0=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=jV/AuaB9sTgRCAKIQsFGqYS9JR8M6uNgYI9Z2k8hB7gbmPG8dTSythUFXEkhvM1Qi
	 cNu/5dPe7B6cwh91IXo38J2f8dZtVoJWK3kOISRJyEg2Xv82ypXlKMZDHOSaKB44ow
	 OJR/pikdr2KmtheovIKJ+qjyYi5AnFTlNGZJ4QutdN46yDYebM2JjcaiR1XNap0Fea
	 QQuo1Op0xVLI5XraR1MBwPufYjqGRwC8qq8XJknKYDrLmdi88ZLLGb8ZvDhbuseut1
	 2cICXiWdzYAIh77GANBuikDo96rSTbljDdp/dm+vl3peKuKrRlClooMFAkUt2uHBRw
	 u5zoqJiVpN0Og==
Date: Mon, 8 Jul 2024 12:57:18 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Kelly Choi <kelly.choi@cloud.com>
cc: xen-devel <xen-devel@lists.xenproject.org>, 
    "xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>, 
    win-pv-devel@lists.xenproject.org, committers@xenproject.org, 
    minios-devel@lists.xenproject.org, mirageos-devel@lists.xenproject.org, 
    Roger Pau Monne <roger.pau@cloud.com>
Subject: Re: [Vote] Xen Project Code of Conduct Team Member
In-Reply-To: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
Message-ID: <alpine.DEB.2.22.394.2407081257020.3635@ubuntu-linux-20-04-desktop>
References: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-1861991062-1720468640=:3635"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-1861991062-1720468640=:3635
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Mon, 8 Jul 2024, Kelly Choi wrote:
> Hi all, 
> As you are aware, George Dunlap has recently stepped down from the Xen Project as a committer, but he was also a part of the Code of
> Conduct team.
> 
> As a result, Stefano will be the only member remaining on the CoC team. @Roger Pau Monne has volunteered to join the team, so that there
> are at least two members.
> 
> In accordance with https://xenproject.org/developers/governance/, I need the leadership teams of the three mature projects: the Hypervisor,
> the XAPI project, and the Windows PV Driver project to vote on this proposal.
> 
> The specific voting rules, in this case, are outlined in the section: https://www.xenproject.org/governance.html#project-decisions
> I propose to tally the votes after July 31st, 2024. You can reply via email in public or private:
> +1: for proposal
> -1: against proposal

+1
--8323329-1861991062-1720468640=:3635--


From win-pv-devel-bounces@lists.xenproject.org Tue Jul 09 05:43:00 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 09 Jul 2024 05:43:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.755703.1164139 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR3cw-0005Az-FG; Tue, 09 Jul 2024 05:42:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 755703.1164139; Tue, 09 Jul 2024 05:42:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR3cw-0005AF-A1; Tue, 09 Jul 2024 05:42:58 +0000
Received: by outflank-mailman (input) for mailman id 755703;
 Tue, 09 Jul 2024 05:42:57 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sR3cv-00058H-EX; Tue, 09 Jul 2024 05:42:57 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sR3cs-00033e-VZ; Tue, 09 Jul 2024 05:42:54 +0000
Received: from buscust21-202.static.cytanet.com.cy ([87.228.190.202]
 helo=[10.10.49.222]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sR3cs-0008No-LT; Tue, 09 Jul 2024 05:42:54 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=gY3HaePMaabOigPfAFjjtMH3zQ3Cfhd/KFBFRw1r2MU=; b=acUmgCqipKcHBnC/ZZAeGNLaaE
	1CKeHnCvWf6TSqL3z1v6tc1d9TYEYwDnhMSmIzyUSou+y0WbmpeDbjwLdvRYTrtHqXXRiLji9vaLC
	ekqKCz1Id4qyjYQEQ3JG9tiban7vZJ7n7uaXVfWeqG39QFIs7XTl9v2g0N+hW6QgwTDA=;
Message-ID: <925ec9b8-83b3-473c-aa7c-dd825cdc3b9a@xen.org>
Date: Tue, 9 Jul 2024 08:42:50 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [Vote] Xen Project Code of Conduct Team Member
Content-Language: en-GB
To: Kelly Choi <kelly.choi@cloud.com>,
 xen-devel <xen-devel@lists.xenproject.org>,
 "xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>,
 win-pv-devel@lists.xenproject.org
Cc: committers@xenproject.org, minios-devel@lists.xenproject.org,
 mirageos-devel@lists.xenproject.org, Roger Pau Monne <roger.pau@cloud.com>
References: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 08/07/2024 10:00, Kelly Choi wrote:
> Hi all,
> 
> As you are aware, George Dunlap has recently stepped down from the Xen
> Project as a committer, but he was also a part of the Code of Conduct team.
> 
> As a result, Stefano will be the only member remaining on the CoC team. @Roger
> Pau Monne <roger.pau@cloud.com> has volunteered to join the team, so that
> there are at least two members.
> 
> In accordance with https://xenproject.org/developers/governance/, I need
> the leadership teams of the three mature projects: the Hypervisor, the XAPI
> project, and the Windows PV Driver project to vote on this proposal.
> 
> The specific voting rules, in this case, are outlined in the section:
> https://www.xenproject.org/governance.html#project-decisions
> 
> I propose to tally the votes after July 31st, 2024. You can reply via email
> in public or private:
> +1: for proposal
> -1: against proposal

+1

Cheers,

-- 
Julien Grall


From win-pv-devel-bounces@lists.xenproject.org Tue Jul 09 06:19:54 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 09 Jul 2024 06:19:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.755835.1164327 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR4Cd-0004aG-Ve; Tue, 09 Jul 2024 06:19:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 755835.1164327; Tue, 09 Jul 2024 06:19:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR4Cd-0004a9-T9; Tue, 09 Jul 2024 06:19:51 +0000
Received: by outflank-mailman (input) for mailman id 755835;
 Tue, 09 Jul 2024 06:19:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KswS=OJ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sR4Cc-0004Yk-Bs
 for win-pv-devel@lists.xenproject.org; Tue, 09 Jul 2024 06:19:50 +0000
Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com
 [2a00:1450:4864:20::22e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3ec5866f-3dbb-11ef-bbfb-fd08da9f4363;
 Tue, 09 Jul 2024 08:19:49 +0200 (CEST)
Received: by mail-lj1-x22e.google.com with SMTP id
 38308e7fff4ca-2ee9b1b422fso21390301fa.0
 for <win-pv-devel@lists.xenproject.org>; Mon, 08 Jul 2024 23:19:49 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3ec5866f-3dbb-11ef-bbfb-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1720505989; x=1721110789; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=YG0zml1xVmBrxeISQvJj8JehqA59yqis9xX8Czb0FZA=;
        b=NG5p08NfSgcECt6AYepGy88qSEnSPOiV3GvdmexjVb5OPEXQfIOFbKJWN2FPvEXyx/
         Vy83rDGyI27BuWya4hO0UIkgzhfpE3s7l2VhDaRxc7WHUU0v37WEt56O/TDmRtH8pezQ
         MXeQFaEktSGPkOm0RxIAvkbo6bkrBP7uPJM0o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720505989; x=1721110789;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=YG0zml1xVmBrxeISQvJj8JehqA59yqis9xX8Czb0FZA=;
        b=TmqmpoS0WlypEWkOslAK0m2GSQ+5QDdoUBUUP+WsA3726ENLuWRShx9vkMyfjKCIWA
         9DQr3OTKN8uVjEDrzI19zm3eSU0g20EP1Vk4r3NACyGRh4H/OeqolWkiAJsOIrkO6Ew9
         WBMwIgmKyFI5QX+a6z5wJ1q0FRZ81WUtrLNyTggw3FWcofCQAXh0I/j00tYKJe2YYKMb
         T8XW1DG8zeunIUigfwDOR/wzyMG1RTPhQ1RpQ9H1fdu2VE4CXV9UpyeKNRVAssjkJLDd
         tJ6t8TXYYhdAAzjQlrSQzd4M9jsxxtRx5FnPbJh3tDkZ8kfoKn3WW9xFDAHoLpxPO55B
         VrJg==
X-Gm-Message-State: AOJu0YxEtlHVOk+dE/bsZNf1DifEXzEJxfwQKEQYQmf/lA0U0ioOS6aG
	rdEXV9MMFf33MBlfGEUvzllNnWLz3o65/1rSMkqs3MSIx3vFWB0IUGoAVUDKS6lOkdLKzMwf+59
	3c+I7zUnej+2Hie4DWpDVLrNHxaNpMrohppgqlW0b7U5tdFE=
X-Google-Smtp-Source: AGHT+IH7Z3vda23z5+ZPGVZlPFN+QqTal5W0U/u5SN8OnJcciX9m0JqFKaqVq8u76z2qAznhZMq2zv3oP/c8JIFf+4I=
X-Received: by 2002:a2e:2417:0:b0:2ee:7ad1:a0b2 with SMTP id
 38308e7fff4ca-2eeb469c6acmr3555031fa.10.1720505988411; Mon, 08 Jul 2024
 23:19:48 -0700 (PDT)
MIME-Version: 1.0
References: <942f1752-a860-4422-b37e-f8e9a71e1db8@invisiblethingslab.com>
In-Reply-To: <942f1752-a860-4422-b37e-f8e9a71e1db8@invisiblethingslab.com>
From: Owen Smith <owen.smith@citrix.com>
Date: Tue, 9 Jul 2024 07:19:36 +0100
Message-ID: <CAC_UY89Rj3f0Z17HKpyBoTdepm83XKLyUGAoqs43cimWXnjrLA@mail.gmail.com>
Subject: Re: Some release signing questions
To: =?UTF-8?B?UmFmYcWCIFdvamR5xYJh?= <omeg@invisiblethingslab.com>
Cc: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000460b1c061cca84ad"

--000000000000460b1c061cca84ad
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi,

1. You need a reserved range if you ever intend to release via Windows
Update, and only the reserved ID can be released via Windows Update.

2. I haven't run HLK tests on pure Xen driver builds, but have for
XenServer patched builds (our patches are mainly XenServer specific
modifications and those pending submission/approval). The process is
relatively simple for the most part, though network and storage do require
additional configuration and tests. The HLK has a downloadable playlist
that limits the tests to only those required for submission.

After a submission is accepted, there is an option to download the complete
signed package - this is MS signed and will install into non-testsigned
OSs, and is all that is required if your distributing drivers yourself -
there is an additional option to distribute via Windows Update, which needs
to be restricted to your reserved device IDs.

Owen

On Mon, Jul 8, 2024 at 3:00=E2=80=AFPM Rafa=C5=82 Wojdy=C5=82a <omeg@invisi=
blethingslab.com>
wrote:

> Hi,
>
> I'm wondering what's the best way to have the current pvdriver packages
> release-signed. I understand we'd need to submit our own signed drivers
> to MS, but I have two technical questions:
>
> 1. To avoid conflicts with other certified drivers we'd need to bind to
> different PCI device IDs, correct? Should we request our own range as
> described here
>
> https://xenbits.xen.org/docs/unstable/man/xen-pci-device-reservations.7.h=
tml
> ?
>
> 2. Is there a list of HLK tests that were run for the previous
> Xen-provided release builds? I've never went through the full HCK
> certification process before, but I did run some tests with HLK
> (although not in a real Xen environment).
>
> --
> Rafa=C5=82 Wojdy=C5=82a
> Invisible Things Lab
>

--000000000000460b1c061cca84ad
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e">Hi,</div><div class=3D"gmail_default" style=3D"font-family:monospace"><b=
r></div><div class=3D"gmail_default" style=3D"font-family:monospace">1. You=
 need a reserved range if you ever intend to release via Windows Update,=C2=
=A0and only the reserved ID can be released via Windows Update.</div><div c=
lass=3D"gmail_default" style=3D"font-family:monospace"><br></div><div class=
=3D"gmail_default" style=3D"font-family:monospace">2. I haven&#39;t=C2=A0ru=
n HLK tests on pure Xen driver builds, but have for XenServer patched build=
s (our patches are mainly XenServer specific modifications and those pendin=
g submission/approval). The process is relatively simple for the most part,=
 though network and storage do require additional configuration and tests. =
The HLK has a downloadable playlist that limits the tests to only those req=
uired for submission.</div><div class=3D"gmail_default" style=3D"font-famil=
y:monospace"><br></div><div class=3D"gmail_default" style=3D"font-family:mo=
nospace">After a submission is accepted, there is=C2=A0an option to downloa=
d the complete signed package - this is MS signed and will install into non=
-testsigned OSs, and is all that is required if your distributing drivers y=
ourself - there is an additional option to distribute via Windows Update, w=
hich needs to be restricted to your reserved device IDs.</div><div class=3D=
"gmail_default" style=3D"font-family:monospace"><br></div><div class=3D"gma=
il_default" style=3D"font-family:monospace">Owen</div></div><br><div class=
=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Jul 8, 2024 =
at 3:00=E2=80=AFPM Rafa=C5=82 Wojdy=C5=82a &lt;<a href=3D"mailto:omeg@invis=
iblethingslab.com">omeg@invisiblethingslab.com</a>&gt; wrote:<br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left=
:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I&#39;m wondering what&#39;s the best way to have the current pvdriver pack=
ages <br>
release-signed. I understand we&#39;d need to submit our own signed drivers=
 <br>
to MS, but I have two technical questions:<br>
<br>
1. To avoid conflicts with other certified drivers we&#39;d need to bind to=
 <br>
different PCI device IDs, correct? Should we request our own range as <br>
described here <br>
<a href=3D"https://xenbits.xen.org/docs/unstable/man/xen-pci-device-reserva=
tions.7.html" rel=3D"noreferrer" target=3D"_blank">https://xenbits.xen.org/=
docs/unstable/man/xen-pci-device-reservations.7.html</a> <br>
?<br>
<br>
2. Is there a list of HLK tests that were run for the previous <br>
Xen-provided release builds? I&#39;ve never went through the full HCK <br>
certification process before, but I did run some tests with HLK <br>
(although not in a real Xen environment).<br>
<br>
-- <br>
Rafa=C5=82 Wojdy=C5=82a<br>
Invisible Things Lab<br>
</blockquote></div>

--000000000000460b1c061cca84ad--


From win-pv-devel-bounces@lists.xenproject.org Tue Jul 09 10:41:42 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 09 Jul 2024 10:41:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.756074.1164641 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8I0-0001Cw-OZ; Tue, 09 Jul 2024 10:41:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 756074.1164641; Tue, 09 Jul 2024 10:41:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8I0-0001Cp-LU; Tue, 09 Jul 2024 10:41:40 +0000
Received: by outflank-mailman (input) for mailman id 756074;
 Tue, 09 Jul 2024 10:41:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KswS=OJ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sR8Hz-0001Ce-99
 for win-pv-devel@lists.xenproject.org; Tue, 09 Jul 2024 10:41:39 +0000
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com
 [2a00:1450:4864:20::634])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d0f93972-3ddf-11ef-bbfb-fd08da9f4363;
 Tue, 09 Jul 2024 12:41:37 +0200 (CEST)
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-a689ad8d1f6so535169266b.2
 for <win-pv-devel@lists.xenproject.org>; Tue, 09 Jul 2024 03:41:36 -0700 (PDT)
Received: from localhost.localdomain
 (host109-158-229-15.range109-158.btcentralplus.com. [109.158.229.15])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a780a7fefd8sm65626966b.112.2024.07.09.03.41.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 09 Jul 2024 03:41:34 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d0f93972-3ddf-11ef-bbfb-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720521696; x=1721126496; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=zVj3c49igDH3zQA5YSeHrdmtWaEptNkaQZs9o3A3H8k=;
        b=ZOk8rVjGq+/OptpLBSiPiEtvu7d8l3mnufNUFN2UpfkrcltGX5MXLdYpqTlIdU0SmJ
         OH2cqA0zQnK/0xKqfYlvEl2YmtQMNRrwz/JAv7ZsUCBrwhu4ahvxZmoqb5AA1OZXdiwE
         fDCUZUoTjdU3ULqkmzYU6DuekL9bya23IdAYQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720521696; x=1721126496;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=zVj3c49igDH3zQA5YSeHrdmtWaEptNkaQZs9o3A3H8k=;
        b=mvXxQQGMEGgSN1yEKOXKqywz9OiAuwzAwIR/oE4Lnor2EvQ2nXiWC5uYaebgwD3cv0
         YV/hyd1U3vmekHn6mhW44Y85tXT2pDMpTmfLKyj9R9UtGRx18pXEMI/5SO4SjXqIw8wY
         I1WZiPXoiHqw4qqvNj+8E57RuCPSsnsaEKiPxfXn7ni1cBzQ7gZuCzKo15uIMzP+hI66
         o8MAYTWf5t+GRgeTbdQ2cl6WAnzanhPQhh0G1Tyft99OeOe119+n4+YaGw+BOJkheSY1
         iUeYUkNpNiId4hOzZnj8A1uadmgopA6W3UkWxOsxa1f8fi69QB1YgHB0gblQFvSE6jRV
         bgtw==
X-Gm-Message-State: AOJu0YykNXm3o78Ac3tuRSPR4a+7LoCAlzOrgnuPsQFohx/V0Zt/gNiF
	uOv3wcWUe+3+nxnwaGKLxoR7t2vO+DGatI0MjJ8d84AaIKc4hBN4iuH3QTrOkzk4DSimkQOK+r0
	=
X-Google-Smtp-Source: AGHT+IEOF5oiZYif5TSxxwg7+zUlYiCVyy53patdH/VsbY6ggdxmCdp+Mc2YPMi97Pb3k7qlVK4+Ww==
X-Received: by 2002:a17:906:2b57:b0:a77:cca9:b212 with SMTP id a640c23a62f3a-a780b7050dfmr152697266b.45.1720521694604;
        Tue, 09 Jul 2024 03:41:34 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [XENIFACE PATCH 1/2] Fix Registry Isolation issues with Server 2025
Date: Tue,  9 Jul 2024 11:41:21 +0100
Message-ID: <20240709104123.1415-1-owen.smith@cloud.com>
X-Mailer: git-send-email 2.44.0.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use MmGetSystemRoutineAddress to dynamically get IoOpenDriverRegistryKey,
which is not present on Server 2016.
Where possible, use IoOpenDriverRegistryKey to avoid opening absolute registry
paths, which is a driver verifier violation on Server 2025 WHQL testing.

Also refactors all registry access to use functions in registry.h and cleans up
driver.c to be more inline with other drivers.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/xeniface/driver.c   | 146 +++++++++++++++++++++++++++++++---------
 src/xeniface/driver.h   |  17 ++---
 src/xeniface/fdo.c      |  94 ++++++++++----------------
 src/xeniface/registry.c |  81 +++++++++++++++++++++-
 src/xeniface/registry.h |  14 +++-
 src/xeniface/wmi.c      |   7 +-
 6 files changed, 258 insertions(+), 101 deletions(-)

diff --git a/src/xeniface/driver.c b/src/xeniface/driver.c
index 6c3032b..3b5b16d 100644
--- a/src/xeniface/driver.c
+++ b/src/xeniface/driver.c
@@ -36,32 +36,99 @@
 
 #include "fdo.h"
 #include "driver.h"
+#include "registry.h"
 
 #include "assert.h"
 #include "wmi.h"
 #include "util.h"
 
-PDRIVER_OBJECT      DriverObject;
+typedef struct _XENIFACE_DRIVER {
+    PDRIVER_OBJECT      DriverObject;
+    HANDLE              ParametersKey;
+} XENIFACE_DRIVER, *PXENIFACE_DRIVER;
 
-DRIVER_UNLOAD       DriverUnload;
+static XENIFACE_DRIVER  Driver;
+
+static FORCEINLINE VOID
+__DriverSetDriverObject(
+    IN  PDRIVER_OBJECT  DriverObject
+    )
+{
+    Driver.DriverObject = DriverObject;
+}
+
+static FORCEINLINE PDRIVER_OBJECT
+__DriverGetDriverObject(
+    VOID
+    )
+{
+    return Driver.DriverObject;
+}
+
+PDRIVER_OBJECT
+DriverGetDriverObject(
+    VOID
+    )
+{
+    return __DriverGetDriverObject();
+}
+
+static FORCEINLINE VOID
+__DriverSetParametersKey(
+    IN  HANDLE  Key
+    )
+{
+    Driver.ParametersKey = Key;
+}
+
+static FORCEINLINE HANDLE
+__DriverGetParametersKey(
+    VOID
+    )
+{
+    return Driver.ParametersKey;
+}
+
+HANDLE
+DriverGetParametersKey(
+    VOID
+    )
+{
+    return __DriverGetParametersKey();
+}
 
-XENIFACE_PARAMETERS DriverParameters;
+DRIVER_UNLOAD       DriverUnload;
 
 VOID
 DriverUnload(
-    IN  PDRIVER_OBJECT  _DriverObject
+    IN  PDRIVER_OBJECT  DriverObject
     )
 {
-    ASSERT3P(_DriverObject, ==, DriverObject);
+    HANDLE              ParametersKey;
+
+    ASSERT3P(DriverObject, ==, __DriverGetDriverObject());
 
     Trace("====>\n");
 
-    if (DriverParameters.RegistryPath.Buffer != NULL) {
-        __FreePoolWithTag(DriverParameters.RegistryPath.Buffer,
-                          XENIFACE_POOL_TAG);
-    }
+    ParametersKey = __DriverGetParametersKey();
+    __DriverSetParametersKey(NULL);
+
+    RegistryCloseKey(ParametersKey);
+
+    RegistryTeardown();
+
+    Info("XENIFACE %d.%d.%d (%d) (%02d.%02d.%04d)\n",
+         MAJOR_VERSION,
+         MINOR_VERSION,
+         MICRO_VERSION,
+         BUILD_NUMBER,
+         DAY,
+         MONTH,
+         YEAR);
+
+    __DriverSetDriverObject(NULL);
 
-    DriverObject = NULL;
+    ASSERT(IsZeroMemory(&Driver, sizeof (XENIFACE_DRIVER)));
 
     Trace("<====\n");
 }
@@ -70,13 +137,13 @@ DRIVER_ADD_DEVICE   AddDevice;
 
 NTSTATUS
 AddDevice(
-    IN  PDRIVER_OBJECT  _DriverObject,
+    IN  PDRIVER_OBJECT  DriverObject,
     IN  PDEVICE_OBJECT  DeviceObject
     )
 {
     NTSTATUS            status;
 
-    ASSERT3P(_DriverObject, ==, DriverObject);
+    ASSERT3P(DriverObject, ==, __DriverGetDriverObject());
 
     status = FdoCreate(DeviceObject);
     if (!NT_SUCCESS(status))
@@ -147,40 +214,45 @@ done:
 
 DRIVER_INITIALIZE   DriverEntry;
 
-
 NTSTATUS
 DriverEntry(
-    IN  PDRIVER_OBJECT  _DriverObject,
+    IN  PDRIVER_OBJECT  DriverObject,
     IN  PUNICODE_STRING RegistryPath
     )
 {
+    HANDLE              ParametersKey;
     ULONG               Index;
-    NTSTATUS status = STATUS_UNSUCCESSFUL;
-    ASSERT3P(DriverObject, ==, NULL);
+    NTSTATUS            status;
+
+    ASSERT3P(__DriverGetDriverObject(), ==, NULL);
 
     ExInitializeDriverRuntime(DrvRtPoolNxOptIn);
     WdmlibProcgrpInitialize();
 
     Trace("====>\n");
 
-    Info("%s (%s)\n",
-         MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR,
-         DAY_STR "/" MONTH_STR "/" YEAR_STR);
-
-    DriverParameters.RegistryPath.MaximumLength = RegistryPath->Length + sizeof(UNICODE_NULL);
-    DriverParameters.RegistryPath.Length = RegistryPath->Length;
-    DriverParameters.RegistryPath.Buffer = __AllocatePoolWithTag(PagedPool,
-                                                DriverParameters.RegistryPath.MaximumLength,
-                                                XENIFACE_POOL_TAG);
-    if (NULL == DriverParameters.RegistryPath.Buffer) {
-        status = STATUS_INSUFFICIENT_RESOURCES;
+    __DriverSetDriverObject(DriverObject);
+
+    DriverObject->DriverUnload = DriverUnload;
+
+    Info("XENIFACE %d.%d.%d (%d) (%02d.%02d.%04d)\n",
+         MAJOR_VERSION,
+         MINOR_VERSION,
+         MICRO_VERSION,
+         BUILD_NUMBER,
+         DAY,
+         MONTH,
+         YEAR);
+
+    status = RegistryInitialize(DriverObject, RegistryPath);
+    if (!NT_SUCCESS(status))
         goto fail1;
-    }
-    RtlCopyUnicodeString(&DriverParameters.RegistryPath, RegistryPath);
 
+    status = RegistryOpenParametersKey(KEY_READ, &ParametersKey);
+    if (!NT_SUCCESS(status))
+        goto fail2;
 
-    DriverObject = _DriverObject;
-    DriverObject->DriverUnload = DriverUnload;
+    __DriverSetParametersKey(ParametersKey);
 
     DriverObject->DriverExtension->AddDevice = AddDevice;
 
@@ -193,7 +265,19 @@ DriverEntry(
     Trace("<====\n");
 
     return STATUS_SUCCESS;
+
+
+fail2:
+    Error("fail2\n");
+
+    RegistryTeardown();
+
 fail1:
     Error("fail1 (%08x)\n", status);
+
+    __DriverSetDriverObject(NULL);
+
+    ASSERT(IsZeroMemory(&Driver, sizeof (XENIFACE_DRIVER)));
+
     return status;
 }
diff --git a/src/xeniface/driver.h b/src/xeniface/driver.h
index 27cd453..9007d97 100644
--- a/src/xeniface/driver.h
+++ b/src/xeniface/driver.h
@@ -46,19 +46,20 @@
 
 #include <wmilib.h>
 #include <ntifs.h>
-extern PDRIVER_OBJECT   DriverObject;
-
 
 #define MAX_DEVICE_ID_LEN   200
 
-typedef struct _XENIFACE_PARAMETERS {
-    UNICODE_STRING RegistryPath;
-
-} XENIFACE_PARAMETERS, *PXENIFACE_PARAMETERS;
-
 #define XENIFACE_POOL_TAG (ULONG) 'XIfc'
 
-extern XENIFACE_PARAMETERS DriverParameters;
+extern PDRIVER_OBJECT
+DriverGetDriverObject(
+    VOID
+    );
+
+extern HANDLE
+DriverGetParametersKey(
+    VOID
+    );
 
 typedef struct _XENIFACE_DX {
     PDEVICE_OBJECT      DeviceObject;
diff --git a/src/xeniface/fdo.c b/src/xeniface/fdo.c
index 29f8338..a2cb713 100644
--- a/src/xeniface/fdo.c
+++ b/src/xeniface/fdo.c
@@ -61,85 +61,63 @@
 
 #define MAXNAMELEN  128
 
-
-static void
+static NTSTATUS
 FdoInitialiseXSRegistryEntries(
     IN PXENIFACE_FDO        Fdo
     )
 {
-    OBJECT_ATTRIBUTES Attributes;
-    HANDLE RegHandle;
-    UNICODE_STRING UnicodeValueName;
-    UNICODE_STRING UnicodeValue;
-    ANSI_STRING AnsiValue;
-    char *value;
-    NTSTATUS status;
+    ANSI_STRING             Ansi[2];
+    HANDLE                  Key;
+    PCHAR                   Value;
+    NTSTATUS                status;
+
     NT_ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL);
+
     status = XENBUS_STORE(Read,
                           &Fdo->StoreInterface,
                           NULL,
                           NULL,
                           "/mh/boot-time/management-mac-address",
-                          &value);
-    if (!NT_SUCCESS(status)){
-        Error("no such xenstore key\n");
-        goto failXS;
-    }
-
-    InitializeObjectAttributes(&Attributes, &DriverParameters.RegistryPath,
-                                OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
-                                NULL,
-                                NULL);
-
-    status = ZwOpenKey(&RegHandle, KEY_WRITE, &Attributes);
+                          &Value);
+    if (!NT_SUCCESS(status))
+        goto fail1;
 
-    if (!NT_SUCCESS(status)) {
-        Error("no such registry key %s\n", DriverParameters.RegistryPath);
-        goto failReg;
-    }
+    status = RegistryOpenParametersKey(KEY_WRITE, &Key);
+    if (!NT_SUCCESS(status))
+        goto fail2;
 
-    RtlInitUnicodeString(&UnicodeValueName, L"MgmtMacAddr");
-    RtlInitUnicodeString(&UnicodeValue, NULL);
-    RtlInitAnsiString(&AnsiValue, value);
+    RtlInitAnsiString(&Ansi[0], Value);
+    RtlZeroMemory(&Ansi[1], sizeof(ANSI_STRING));
 
-    Info("About to convert unicode string\n");
-    status = RtlAnsiStringToUnicodeString(&UnicodeValue, &AnsiValue, TRUE);
-    if (!NT_SUCCESS(status)) {
-        Error("Can't convert string\n");
-        goto failReg;
-    }
+    status = RegistryUpdateSzValue(Key,
+                                   "MgmtMacAddr",
+                                   REG_SZ,
+                                   &Ansi[0]);
+    if (!NT_SUCCESS(status))
+        goto fail3;
 
-    Info("About to write unicode string\n");
-    status = ZwSetValueKey(RegHandle, &UnicodeValueName, 0, REG_SZ, UnicodeValue.Buffer, UnicodeValue.Length+sizeof(WCHAR));
-    if (!NT_SUCCESS(status)) {
-        Error("Can't write key\n");
-        goto failWrite;
-    }
+    RegistryCloseKey(Key);
 
-    ZwClose(RegHandle);
+    XENBUS_STORE(Free, &Fdo->StoreInterface, Value);
 
-    RtlFreeUnicodeString(&UnicodeValue);
-    XENBUS_STORE(Free, &Fdo->StoreInterface, value);
+    return STATUS_SUCCESS;
 
-    return;
+fail3:
+    Error("fail3\n");
 
-failWrite:
+    RegistryCloseKey(Key);
 
-    Error("Fail : Write\n");
-    ZwClose(RegHandle);
-    RtlFreeUnicodeString(&UnicodeValue);
+fail2:
+    Error("fail2\n");
 
-failReg:
+    XENBUS_STORE(Free, &Fdo->StoreInterface, Value);
 
-    Error("Fail : Reg\n");
-    XENBUS_STORE(Free, &Fdo->StoreInterface, value);
+fail1:
+    Error("fail1 %08x\n", status);
 
-failXS:
-    Error("Failed to initialise registry (%08x)\n", status);
-    return;
+    return status;
 }
 
-
 #define REGISTRY_WRITE_EVENT 0
 #define REGISTRY_THREAD_END_EVENT 1
 #define REGISTRY_EVENTS 2
@@ -163,7 +141,7 @@ static NTSTATUS FdoRegistryThreadHandler(IN  PXENIFACE_THREAD  Self,
         if ((status>=STATUS_WAIT_0) && (status < STATUS_WAIT_0+REGISTRY_EVENTS)) {
             if (status == STATUS_WAIT_0+REGISTRY_WRITE_EVENT) {
                 Info("WriteRegistry\n");
-                FdoInitialiseXSRegistryEntries(Fdo);
+                (VOID) FdoInitialiseXSRegistryEntries(Fdo);
                 KeClearEvent(threadevents[REGISTRY_WRITE_EVENT]);
             }
             if (status == STATUS_WAIT_0+REGISTRY_THREAD_END_EVENT) {
@@ -2475,7 +2453,7 @@ FdoCreate(
     NTSTATUS            status;
 
 #pragma prefast(suppress:28197) // Possibly leaking memory 'FunctionDeviceObject'
-    status = IoCreateDevice(DriverObject,
+    status = IoCreateDevice(DriverGetDriverObject(),
                             sizeof (XENIFACE_DX),
                             NULL,
                             FILE_DEVICE_UNKNOWN,
@@ -2585,7 +2563,7 @@ FdoCreate(
     InitializeListHead(&Dx->ListEntry);
     Fdo->References = 1;
 
-    FdoInitialiseXSRegistryEntries(Fdo);
+    (VOID) FdoInitialiseXSRegistryEntries(Fdo);
 
     KeInitializeEvent(&Fdo->registryWriteEvent, NotificationEvent, FALSE);
 
diff --git a/src/xeniface/registry.c b/src/xeniface/registry.c
index 8f84818..1ab85c9 100644
--- a/src/xeniface/registry.c
+++ b/src/xeniface/registry.c
@@ -38,8 +38,13 @@
 
 #define REGISTRY_TAG 'GERX'
 
+static PDRIVER_OBJECT   RegistryDriverObject;
 static UNICODE_STRING   RegistryPath;
 
+typedef NTSTATUS(*IOOPENDRIVERREGISTRYKEY)(PDRIVER_OBJECT, DRIVER_REGKEY_TYPE, ACCESS_MASK, ULONG, PHANDLE);
+
+static IOOPENDRIVERREGISTRYKEY __IoOpenDriverRegistryKey;
+
 static FORCEINLINE PVOID
 __RegistryAllocate(
     IN  ULONG   Length
@@ -58,9 +63,12 @@ __RegistryFree(
 
 NTSTATUS
 RegistryInitialize(
-    IN PUNICODE_STRING  Path
+    IN  PDRIVER_OBJECT  DriverObject,
+    IN  PUNICODE_STRING Path
     )
 {
+    UNICODE_STRING      Unicode;
+    PVOID               Func;
     NTSTATUS            status;
 
     ASSERT3P(RegistryPath.Buffer, ==, NULL);
@@ -69,6 +77,16 @@ RegistryInitialize(
     if (!NT_SUCCESS(status))
         goto fail1;
 
+    ASSERT3P(RegistryDriverObject, ==, NULL);
+    RegistryDriverObject = DriverObject;
+
+    ASSERT3P(__IoOpenDriverRegistryKey, ==, NULL);
+    RtlInitUnicodeString(&Unicode, L"IoOpenDriverRegistryKey");
+
+    Func = MmGetSystemRoutineAddress(&Unicode);
+    if (Func != NULL)
+        __IoOpenDriverRegistryKey = (IOOPENDRIVERREGISTRYKEY)Func;
+
     return STATUS_SUCCESS;
 
 fail1:
@@ -82,11 +100,24 @@ RegistryTeardown(
     VOID
     )
 {
+    __IoOpenDriverRegistryKey = NULL;
+
+    RegistryDriverObject = NULL;
+
     RtlFreeUnicodeString(&RegistryPath);
     RegistryPath.Buffer = NULL;
     RegistryPath.MaximumLength = RegistryPath.Length = 0;
 }
 
+PUNICODE_STRING
+RegistryGetPath(
+    VOID
+    )
+{
+    return &RegistryPath;
+}
+
+
 NTSTATUS
 RegistryOpenKey(
     IN  HANDLE          Parent,
@@ -266,6 +297,54 @@ RegistryCreateServiceKey(
     return RegistryCreateKey(NULL, &RegistryPath, REG_OPTION_NON_VOLATILE, Key);
 }
 
+NTSTATUS
+RegistryOpenParametersKey(
+    IN  ACCESS_MASK     DesiredAccess,
+    OUT PHANDLE         Key
+    )
+{
+    HANDLE              ServiceKey;
+    NTSTATUS            status;
+
+    if (__IoOpenDriverRegistryKey != NULL) {
+        status = __IoOpenDriverRegistryKey(RegistryDriverObject,
+                                           DriverRegKeyParameters,
+                                           DesiredAccess,
+                                           0,
+                                           Key);
+        if (!NT_SUCCESS(status))
+            goto fail1;
+
+        goto done;
+    }
+
+    status = RegistryOpenKey(NULL, &RegistryPath, DesiredAccess, &ServiceKey);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    status = RegistryOpenSubKey(ServiceKey, "Parameters", DesiredAccess, Key);
+    if (!NT_SUCCESS(status))
+        goto fail3;
+
+    RegistryCloseKey(ServiceKey);
+
+done:
+    return STATUS_SUCCESS;
+
+fail3:
+    Error("fail3\n");
+
+    RegistryCloseKey(ServiceKey);
+
+fail2:
+    Error("fail2\n");
+
+fail1:
+    Error("fail1 %08x\n", status);
+
+    return status;
+}
+
 NTSTATUS
 RegistryOpenSoftwareKey(
     IN  PDEVICE_OBJECT  DeviceObject,
diff --git a/src/xeniface/registry.h b/src/xeniface/registry.h
index 1cf8671..42ee9c8 100644
--- a/src/xeniface/registry.h
+++ b/src/xeniface/registry.h
@@ -37,7 +37,8 @@
 
 extern NTSTATUS
 RegistryInitialize(
-    IN PUNICODE_STRING  Path
+    IN  PDRIVER_OBJECT  DriverObject,
+    IN  PUNICODE_STRING Path
     );
 
 extern VOID
@@ -45,6 +46,11 @@ RegistryTeardown(
     VOID
     );
 
+extern PUNICODE_STRING
+RegistryGetPath(
+    VOID
+    );
+
 extern NTSTATUS
 RegistryOpenKey(
     IN  HANDLE          Parent,
@@ -72,6 +78,12 @@ RegistryCreateServiceKey(
     OUT PHANDLE     Key
     );
 
+extern NTSTATUS
+RegistryOpenParametersKey(
+    IN  ACCESS_MASK     DesiredAccess,
+    OUT PHANDLE         Key
+    );
+
 extern NTSTATUS
 RegistryOpenSoftwareKey(
     IN  PDEVICE_OBJECT  DeviceObject,
diff --git a/src/xeniface/wmi.c b/src/xeniface/wmi.c
index 97ef2c3..95b4bb1 100644
--- a/src/xeniface/wmi.c
+++ b/src/xeniface/wmi.c
@@ -41,6 +41,7 @@
 #include <ntstrsafe.h>
 #include "wmi.h"
 #include "driver.h"
+#include "registry.h"
 #include "store_interface.h"
 #include "suspend_interface.h"
 #include "log.h"
@@ -2999,6 +3000,7 @@ WmiRegInfo(
     UCHAR*                  mofnameptr;
     UCHAR*                  regpath;
     ULONG                   RequiredSize;
+    PUNICODE_STRING         RegistryPath;
 
     const int entries = 4;
     const static UNICODE_STRING mofname = RTL_CONSTANT_STRING(L"XENIFACEMOF");
@@ -3010,13 +3012,14 @@ WmiRegInfo(
     else
         mofnamesz = 0;
 
+    RegistryPath = RegistryGetPath();
     if (!AccessWmiBuffer(Stack->Parameters.WMI.Buffer, FALSE,
                          &RequiredSize,
                          Stack->Parameters.WMI.BufferSize,
                          WMI_BUFFER, sizeof(WMIREGINFO), (UCHAR **)&reginfo,
                          WMI_BUFFER, entries * sizeof(WMIREGGUID), (UCHAR **)&guiddata,
                          WMI_STRING, mofnamesz, &mofnameptr,
-                         WMI_STRING, DriverParameters.RegistryPath.Length + sizeof(USHORT), &regpath,
+                         WMI_STRING, RegistryPath->Length + sizeof(USHORT), &regpath,
                          WMI_DONE)) {
         reginfo->BufferSize = RequiredSize;
         *BytesWritten = sizeof(ULONG);
@@ -3027,7 +3030,7 @@ WmiRegInfo(
         reginfo->MofResourceName = (ULONG)((ULONG_PTR)mofnameptr - (ULONG_PTR)reginfo);
         WriteCountedUnicodeString(&mofname, mofnameptr);
         reginfo->RegistryPath = (ULONG)((ULONG_PTR)regpath - (ULONG_PTR)reginfo);
-        WriteCountedUnicodeString(&DriverParameters.RegistryPath, regpath);
+        WriteCountedUnicodeString(RegistryPath, regpath);
     }
 
     reginfo->BufferSize = RequiredSize;
-- 
2.44.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Jul 09 10:41:42 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 09 Jul 2024 10:41:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.756075.1164648 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8I0-0001DF-SP; Tue, 09 Jul 2024 10:41:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 756075.1164648; Tue, 09 Jul 2024 10:41:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8I0-0001D0-Mx; Tue, 09 Jul 2024 10:41:40 +0000
Received: by outflank-mailman (input) for mailman id 756075;
 Tue, 09 Jul 2024 10:41:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KswS=OJ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sR8I0-0001Ce-0q
 for win-pv-devel@lists.xenproject.org; Tue, 09 Jul 2024 10:41:40 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d2acc311-3ddf-11ef-bbfb-fd08da9f4363;
 Tue, 09 Jul 2024 12:41:39 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-58bac81f40bso6479336a12.1
 for <win-pv-devel@lists.xenproject.org>; Tue, 09 Jul 2024 03:41:39 -0700 (PDT)
Received: from localhost.localdomain
 (host109-158-229-15.range109-158.btcentralplus.com. [109.158.229.15])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a780a7fefd8sm65626966b.112.2024.07.09.03.41.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 09 Jul 2024 03:41:38 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d2acc311-3ddf-11ef-bbfb-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720521699; x=1721126499; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=46KCmOhZlqdAESJzMOHttmB2nfijGIAWKQit6aigvgI=;
        b=a8W9ehuqL85OpdmOy6iCr/FDUY0zEhmb4lnlVmdgDPII7Zzoin1fNNQvBr9o4HQXgc
         GKtGPJatgGuVYnv/F40NeaihYqwDqATYa17Aoy7g5nyrOIH4Tw2GhLgMcgo1kuMfZyof
         nqGwHxZMLxFo+Y0lQ4d/J5sPEhN9moq5BSEIM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720521699; x=1721126499;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=46KCmOhZlqdAESJzMOHttmB2nfijGIAWKQit6aigvgI=;
        b=ijNugUU6H9eIgHNHktHMpOfOeQnA4uqatsRH0/HoaWVcX4uw6PV3xCEapLBlTx+VpD
         KDXHBIrK2KM2YNCvD6NiUARWRkjsHMlIh2mHHvGXc2SVemtfJygyXAmBh08xT2XaUUUj
         1F+3HMEKNgT9jPaeNcFX4avQdQrB3s9fRS5OVC362O1G+gAX7j7JDSP5L4Ji3OBmfIA8
         vqzIUwDvF9xq1JTS5kYVANzgnznIvl6PksS/zXjKiERWzVcAtrVSTj2zwaG3/dlKOTIL
         KA5j0+elpG3J4yq0VJqw84sGCQxWe+lMnTCmIHSak60jsvFxdGORET4h3UNfz85PqdEK
         tx2g==
X-Gm-Message-State: AOJu0YzQaRC/4Cp616FuvWG/DQOIyKPjNcrDBOFOjx1XBZiN9z8Axr1C
	ipoJRAq1dfvbP+lqhIutVsR+0ePCx0it8ul5uaf1QpucqGqT8XrQMkVFwh8EvElPpJ1+R/1wgT0
	=
X-Google-Smtp-Source: AGHT+IEGzA0RkGosfzLBhbafJe74HPEBSGPPuckdMlyDfkap4mNK+iDi1ecDLtPzY21Dc49+/Yvkng==
X-Received: by 2002:a17:907:944d:b0:a6f:1c81:e220 with SMTP id a640c23a62f3a-a780b68aab4mr172216466b.13.1720521698641;
        Tue, 09 Jul 2024 03:41:38 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [XENIFACE PATCH 2/2] Bump binding to 0x0900000B
Date: Tue,  9 Jul 2024 11:41:22 +0100
Message-ID: <20240709104123.1415-2-owen.smith@cloud.com>
X-Mailer: git-send-email 2.44.0.windows.1
In-Reply-To: <20240709104123.1415-1-owen.smith@cloud.com>
References: <20240709104123.1415-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Require UNPLUGv3 be present, so that drivers are all using the same binding
revision number.
Also refactors the INF file to match other drivers

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/xeniface.inf | 123 ++++++++++++++++++++++++++---------------------
 1 file changed, 67 insertions(+), 56 deletions(-)

diff --git a/src/xeniface.inf b/src/xeniface.inf
index fdb78ea..fe5ea75 100644
--- a/src/xeniface.inf
+++ b/src/xeniface.inf
@@ -30,83 +30,94 @@
 ; SUCH DAMAGE.
 
 [Version]
-Signature="$WINDOWS NT$"
+Signature="$Windows NT$"
 Class=System
-ClassGUID={4d36e97d-e325-11ce-bfc1-08002be10318} 
+ClassGUID={4d36e97d-e325-11ce-bfc1-08002be10318}
 Provider=%Vendor%
-DriverVer=@INF_DATE@,@MAJOR_VERSION@.@MINOR_VERSION@.@MICRO_VERSION@.@BUILD_NUMBER@
 CatalogFile=xeniface.cat
-DriverPackageDisplayName=%DiskId1%
+DriverVer=@INF_DATE@,@MAJOR_VERSION@.@MINOR_VERSION@.@MICRO_VERSION@.@BUILD_NUMBER@
+DriverPackageDisplayName=%DiskDesc%
 PnpLockdown=1
 
 [DestinationDirs]
 DefaultDestDir = 12
-ServiceDestDir.Copy = 11
-
-[Manufacturer]
-%Vendor%=Inst,NT@INF_ARCH@
+XenAgent_CopyFiles = 11
 
-[Inst.NT@INF_ARCH@]
-; DisplayName		    Section	      DeviceID
-; -----------		    -------	      --------
-
-%XenIfaceDevice.DeviceDesc% =XenIface_Device, XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_IFACE&REV_0900000A
-%XenIfaceDevice.DeviceDesc% =XenIface_Device, XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_IFACE&REV_0900000A
-%XenIfaceDevice.DeviceDesc% =XenIface_Device, XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_IFACE&REV_0900000A
+[SourceDisksNames]
+0=%DiskDesc%
 
-[XenIface_Device]
-CopyFiles=XenIface_Device.Copy
-CopyFiles=ServiceDestDir.Copy
+[SourceDisksFiles]
+xeniface.sys=0,,
+xenagent.exe=0,,
+xenagent.dll=0,,
 
-[XenIFace_Device.Copy]
+[XenIface_CopyFiles]
 xeniface.sys
 
-[ServiceDestDir.Copy]
+[XenAgent_CopyFiles]
 xenagent_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.exe,xenagent.exe
 xenagent_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll,xenagent.dll
 
-[Xeniface_Device.Services]
-AddService = xeniface, %SPSVCINST_ASSOCSERVICE%, xeniface_Service_Inst
-AddService = xenagent, %XENAGENT_FLAGS%, xenagent_Service_Inst,xenagent_EventLog
-
-[xeniface_Service_Inst]
-DisplayName    = %XenIfaceDevice.DeviceDesc%
-ServiceType    = 1               ; SERVICE_KERNEL_DRIVER
-StartType      = 3               ; SERVICE_DEMAND_START 
-ErrorControl   = 1               ; SERVICE_ERROR_NORMAL
-ServiceBinary  = %12%\xeniface.sys
-LoadOrderGroup = Extended Base
-AddReg = Xeniface_Parameters
+[Manufacturer]
+%Vendor%=Inst,NT@INF_ARCH@
 
-[Xeniface_Parameters]
+[Inst.NT@INF_ARCH@]
+; DisplayName       Section        DeviceID
+; -----------       -------        --------
+%XenIfaceName% =    XenIface_Inst, XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_IFACE&REV_0900000B
+%XenIfaceName% =    XenIface_Inst, XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_IFACE&REV_0900000B
+%XenIfaceName% =    XenIface_Inst, XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_IFACE&REV_0900000B
+
+[XenIface_Inst]
+CopyFiles=XenIface_CopyFiles
+CopyFiles=XenAgent_CopyFiles
+
+[Xeniface_Inst.Services]
+AddService = xeniface, 0x0002, XenIface_Service
+AddService = xenagent, 0x0800, XenAgent_Service,XenAgent_EventLog
+
+[XenIface_Service]
+DisplayName=%XenIfaceName%
+ServiceType=%SERVICE_KERNEL_DRIVER%
+StartType=%SERVICE_DEMAND_START%
+ErrorControl=%SERVICE_ERROR_NORMAL%
+ServiceBinary=%12%\xeniface.sys
+LoadOrderGroup=Extended Base
+AddReg=XenIface_Parameters
+
+[XenIface_Parameters]
 HKR,"Parameters",,0x00000010
 
-[xenagent_Service_Inst]
-DisplayName    = %xenagent.SVCDESC%
-ServiceType    = 16              ; SERVICE_WIN32_OWN_PROCESS
-StartType      = 2               ; SERVICE_AUTO_START 
-ErrorControl   = 1               ; SERVICE_ERROR_NORMAL
-ServiceBinary  = %11%\xenagent_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.exe
+[XenAgent_Service]
+DisplayName=%XenAgentName%
+ServiceType=%SERVICE_WIN32_OWN_PROCESS%
+StartType=%SERVICE_AUTO_START%
+ErrorControl=%SERVICE_ERROR_NORMAL%
+ServiceBinary=%11%\xenagent_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.exe
 
-[xenagent_EventLog]
-AddReg=xenagent_EventLog_AddReg
+[XenAgent_EventLog]
+AddReg=XenAgent_AddReg
 
-[xenagent_EventLog_AddReg]
+[XenAgent_AddReg]
 HKR,,EventMessageFile,0x00020000,"%%SystemRoot%%\System32\xenagent_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll"
 HKR,,TypesSupported,0x00010001,7
 
-[SourceDisksNames]
-1 = %DiskId1%,,,""
-
-[SourceDisksFiles]
-xeniface.sys  = 1,,
-xenagent.exe = 1,,
-xenagent.dll = 1,,
-
 [Strings]
-SPSVCINST_ASSOCSERVICE= 0x00000002
-Vendor= "@VENDOR_NAME@" 
-DiskId1 = "@PRODUCT_NAME@ Interface Package"
-XenIfaceDevice.DeviceDesc = "@PRODUCT_NAME@ Interface"
-XENAGENT_FLAGS= 0x00000800
-xenagent.SVCDESC= "@PRODUCT_NAME@ Agent"
+Vendor="@VENDOR_NAME@"
+DiskDesc="@PRODUCT_NAME@ Interface Package"
+XenIfaceName="@PRODUCT_NAME@ Interface"
+XenAgentName="@PRODUCT_NAME@ Agent"
+
+SERVICE_BOOT_START=0x0
+SERVICE_SYSTEM_START=0x1
+SERVICE_AUTO_START=0x2
+SERVICE_DEMAND_START=0x3
+SERVICE_DISABLED=0x4
+
+SERVICE_KERNEL_DRIVER=0x1
+SERVICE_WIN32_OWN_PROCESS=0x10
+
+SERVICE_ERROR_IGNORE=0x0
+SERVICE_ERROR_NORMAL=0x1
+SERVICE_ERROR_SEVERE=0x2
+SERVICE_ERROR_CRITICAL=0x3
-- 
2.44.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Jul 09 10:43:34 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 09 Jul 2024 10:43:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.756094.1164650 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8Jp-0001Ol-Ve; Tue, 09 Jul 2024 10:43:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 756094.1164650; Tue, 09 Jul 2024 10:43:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8Jp-0001Oe-T6; Tue, 09 Jul 2024 10:43:33 +0000
Received: by outflank-mailman (input) for mailman id 756094;
 Tue, 09 Jul 2024 10:43:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KswS=OJ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sR8Jo-0001OY-M2
 for win-pv-devel@lists.xenproject.org; Tue, 09 Jul 2024 10:43:32 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1596756b-3de0-11ef-bbfb-fd08da9f4363;
 Tue, 09 Jul 2024 12:43:31 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2eeb1051360so14985231fa.0
 for <win-pv-devel@lists.xenproject.org>; Tue, 09 Jul 2024 03:43:31 -0700 (PDT)
Received: from localhost.localdomain
 (host109-158-229-15.range109-158.btcentralplus.com. [109.158.229.15])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-594bba548bcsm909572a12.17.2024.07.09.03.43.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 09 Jul 2024 03:43:30 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1596756b-3de0-11ef-bbfb-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720521811; x=1721126611; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=ZXZ4tOuEMK48damaUTznkR87pzW9+3MNmLt1FqUy2LU=;
        b=iEAp9i71UPLtDSrbtHPZkcPi2bkYQLnh6VkrHisjQsx04gjve3bPmslQjQtv6A7BJ7
         JjsazyAjlodzscBC93qq9Zb6qG1QNRIJmn6GW5YLL+7gg6OujaIXd/eKalgEj2Ts+Jc1
         zMvX4jZ3kZ9mP3KQK0LPeq0ClPP1U/7+bMEQw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720521811; x=1721126611;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=ZXZ4tOuEMK48damaUTznkR87pzW9+3MNmLt1FqUy2LU=;
        b=hYpoCFQ7I6pikVLIon6FcnMYKwiq4rwIqABiZbLh9QVQlisvzOjycnVWNJNRBlIFGy
         O1KtmAqDUpLLZ9ILs1keRcW7NeNkbgUdPjdzJkBP3hq95ihnWsy0TrhnOV6Q+6ALXfKv
         Z4vHlSUuk7xqCTikHHvLiEXgVF1ahbnYGIJ6D4oahZmIqWPQBFw0d13/aM20Gjx59m3T
         TayBwjhvZrdBe3Sr+VGu0TRCZIUeEUfS1jnm6qQ6O+S2mCUz+oswtlkLxhqg+83U9/JB
         fgPAllXIlbfa16e5UggHxFIfk7VyK0ag8F+IJsOoVQpcmzR6l01F36xzS2CGjzadjeqT
         St6w==
X-Gm-Message-State: AOJu0YyJDPYIhlsqj3lYWmYJvXw19GV4/JZzaNl4ZZcXUWYi2y5yAwWS
	t6CV3b0+kvkFp/IFLFgH78Bg1m5RnjdsCEAOHkXq7pV4Snn4+oBfE+b7kuOw9KmHrX+bUoK8wZk
	=
X-Google-Smtp-Source: AGHT+IGr0HHqnFO2eXSTRuwPndQPVBk8SSMvwJuZa7tCcFiRdrcHx37LaofE++hlYs79xxQDbN9Q8g==
X-Received: by 2002:a2e:7016:0:b0:2ee:8555:473e with SMTP id 38308e7fff4ca-2eeb31979c8mr15390601fa.46.1720521810712;
        Tue, 09 Jul 2024 03:43:30 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [XENVBD PATCH 1/2] Add RegistryOpenParametersKey
Date: Tue,  9 Jul 2024 11:43:18 +0100
Message-ID: <20240709104319.1273-1-owen.smith@cloud.com>
X-Mailer: git-send-email 2.44.0.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Server 2025 WHQL tests enables "verifier.exe /onecheck /rc 33 36" on some drivers
under test, which will detect a violation if drivers attempt to access absolute
registry paths.
IoOpenDriverRegistryKey will open the parameters key for a driver, but its not
defined for Server 2016. Use MmGetSystemRoutineAddress to dynamically find the
function so that a single binary can be used on Server 2016 and Server 2025.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/xendisk/driver.c   | 19 ++---------
 src/xendisk/registry.c | 72 ++++++++++++++++++++++++++++++++++++++++-
 src/xendisk/registry.h |  9 +++++-
 src/xenvbd/driver.c    | 27 +++-------------
 src/xenvbd/registry.c  | 73 +++++++++++++++++++++++++++++++++++++++++-
 src/xenvbd/registry.h  | 10 +++++-
 6 files changed, 167 insertions(+), 43 deletions(-)

diff --git a/src/xendisk/driver.c b/src/xendisk/driver.c
index e24a1a4..e30b75c 100644
--- a/src/xendisk/driver.c
+++ b/src/xendisk/driver.c
@@ -221,7 +221,6 @@ DriverEntry(
     IN  PUNICODE_STRING RegistryPath
     )
 {
-    HANDLE              ServiceKey;
     HANDLE              ParametersKey;
     ULONG               Index;
     NTSTATUS            status;
@@ -246,25 +245,16 @@ DriverEntry(
             MONTH,
             YEAR);
 
-    status = RegistryInitialize(RegistryPath);
+    status = RegistryInitialize(DriverObject, RegistryPath);
     if (!NT_SUCCESS(status))
         goto fail1;
 
-    status = RegistryOpenServiceKey(KEY_ALL_ACCESS, &ServiceKey);
+    status = RegistryOpenParametersKey(KEY_READ, &ParametersKey);
     if (!NT_SUCCESS(status))
         goto fail2;
 
-    status = RegistryOpenSubKey(ServiceKey,
-                                "Parameters",
-                                KEY_READ,
-                                &ParametersKey);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
     __DriverSetParametersKey(ParametersKey);
 
-    RegistryCloseKey(ServiceKey);
-
     DriverObject->DriverExtension->AddDevice = AddDevice;
 
     for (Index = 0; Index <= IRP_MJ_MAXIMUM_FUNCTION; Index++) {
@@ -277,11 +267,6 @@ DriverEntry(
 
     return STATUS_SUCCESS;
 
-fail3:
-    Error("fail3\n");
-
-    RegistryCloseKey(ServiceKey);
-
 fail2:
     Error("fail2\n");
 
diff --git a/src/xendisk/registry.c b/src/xendisk/registry.c
index 173b6b2..9773d7d 100644
--- a/src/xendisk/registry.c
+++ b/src/xendisk/registry.c
@@ -38,8 +38,13 @@
 
 #define REGISTRY_TAG 'GERX'
 
+static PDRIVER_OBJECT   RegistryDriverObject;
 static UNICODE_STRING   RegistryPath;
 
+typedef NTSTATUS(*IOOPENDRIVERREGISTRYKEY)(PDRIVER_OBJECT, DRIVER_REGKEY_TYPE, ACCESS_MASK, ULONG, PHANDLE);
+
+static IOOPENDRIVERREGISTRYKEY __IoOpenDriverRegistryKey;
+
 static FORCEINLINE PVOID
 __RegistryAllocate(
     IN  ULONG   Length
@@ -58,9 +63,12 @@ __RegistryFree(
 
 NTSTATUS
 RegistryInitialize(
-    IN PUNICODE_STRING  Path
+    IN  PDRIVER_OBJECT  DriverObject,
+    IN  PUNICODE_STRING Path
     )
 {
+    UNICODE_STRING      Unicode;
+    PVOID               Func;
     NTSTATUS            status;
 
     ASSERT3P(RegistryPath.Buffer, ==, NULL);
@@ -69,6 +77,16 @@ RegistryInitialize(
     if (!NT_SUCCESS(status))
         goto fail1;
 
+    ASSERT3P(RegistryDriverObject, ==, NULL);
+    RegistryDriverObject = DriverObject;
+
+    ASSERT3P(__IoOpenDriverRegistryKey, ==, NULL);
+    RtlInitUnicodeString(&Unicode, L"IoOpenDriverRegistryKey");
+
+    Func = MmGetSystemRoutineAddress(&Unicode);
+    if (Func != NULL)
+        __IoOpenDriverRegistryKey = (IOOPENDRIVERREGISTRYKEY)Func;
+
     return STATUS_SUCCESS;
 
 fail1:
@@ -82,6 +100,10 @@ RegistryTeardown(
     VOID
     )
 {
+    __IoOpenDriverRegistryKey = NULL;
+
+    RegistryDriverObject = NULL;
+
     RtlFreeUnicodeString(&RegistryPath);
     RegistryPath.Buffer = NULL;
     RegistryPath.MaximumLength = RegistryPath.Length = 0;
@@ -266,6 +288,54 @@ RegistryCreateServiceKey(
     return RegistryCreateKey(NULL, &RegistryPath, REG_OPTION_NON_VOLATILE, Key);
 }
 
+NTSTATUS
+RegistryOpenParametersKey(
+    IN  ACCESS_MASK DesiredAccess,
+    OUT PHANDLE     Key
+    )
+{
+    HANDLE              ServiceKey;
+    NTSTATUS            status;
+
+    if (__IoOpenDriverRegistryKey != NULL) {
+        status = __IoOpenDriverRegistryKey(RegistryDriverObject,
+                                           DriverRegKeyParameters,
+                                           DesiredAccess,
+                                           0,
+                                           Key);
+        if (!NT_SUCCESS(status))
+            goto fail1;
+
+        goto done;
+    }
+
+    status = RegistryOpenKey(NULL, &RegistryPath, DesiredAccess, &ServiceKey);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    status = RegistryOpenSubKey(ServiceKey, "Parameters", DesiredAccess, Key);
+    if (!NT_SUCCESS(status))
+        goto fail3;
+
+    RegistryCloseKey(ServiceKey);
+
+done:
+    return STATUS_SUCCESS;
+
+fail3:
+    Error("fail3\n");
+
+    RegistryCloseKey(ServiceKey);
+
+fail2:
+    Error("fail2\n");
+
+fail1:
+    Error("fail1 %08x\n", status);
+
+    return status;
+}
+
 NTSTATUS
 RegistryOpenSoftwareKey(
     IN  PDEVICE_OBJECT  DeviceObject,
diff --git a/src/xendisk/registry.h b/src/xendisk/registry.h
index 7516e51..b33eb81 100644
--- a/src/xendisk/registry.h
+++ b/src/xendisk/registry.h
@@ -37,7 +37,8 @@
 
 extern NTSTATUS
 RegistryInitialize(
-    IN PUNICODE_STRING  Path
+    IN  PDRIVER_OBJECT  DriverObject,
+    IN  PUNICODE_STRING Path
     );
 
 extern VOID
@@ -72,6 +73,12 @@ RegistryCreateServiceKey(
     OUT PHANDLE     Key
     );
 
+extern NTSTATUS
+RegistryOpenParametersKey(
+    IN  ACCESS_MASK DesiredAccess,
+    OUT PHANDLE     Key
+    );
+
 extern NTSTATUS
 RegistryOpenSoftwareKey(
     IN  PDEVICE_OBJECT  DeviceObject,
diff --git a/src/xenvbd/driver.c b/src/xenvbd/driver.c
index 0d6c21d..ba0ad33 100644
--- a/src/xenvbd/driver.c
+++ b/src/xenvbd/driver.c
@@ -351,7 +351,6 @@ DriverEntry(
     IN  PUNICODE_STRING     RegistryPath
     )
 {
-    HANDLE                  ServiceKey;
     HANDLE                  ParametersKey;
     NTSTATUS                status;
 
@@ -371,21 +370,14 @@ DriverEntry(
          MONTH,
          YEAR);
 
-    status = RegistryInitialize(RegistryPath);
+    status = RegistryInitialize(DriverObject, RegistryPath);
     if (!NT_SUCCESS(status))
         goto fail1;
 
-    status = RegistryOpenServiceKey(KEY_ALL_ACCESS, &ServiceKey);
+    status = RegistryOpenParametersKey(KEY_READ, &ParametersKey);
     if (!NT_SUCCESS(status))
         goto fail2;
 
-    status = RegistryOpenSubKey(ServiceKey,
-                                "Parameters",
-                                KEY_READ,
-                                &ParametersKey);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
     Driver.ParametersKey = ParametersKey;
     Driver.Adapter = NULL;
 
@@ -394,7 +386,7 @@ DriverEntry(
     status = AdapterDriverEntry(RegistryPath,
                                 DriverObject);
     if (!NT_SUCCESS(status))
-        goto fail4;
+        goto fail3;
 
     Driver.StorPortDispatchPnp   = DriverObject->MajorFunction[IRP_MJ_PNP];
     Driver.StorPortDispatchPower = DriverObject->MajorFunction[IRP_MJ_POWER];
@@ -404,22 +396,13 @@ DriverEntry(
     DriverObject->MajorFunction[IRP_MJ_POWER] = DispatchPower;
     DriverObject->DriverUnload                = DriverUnload;
 
-    RegistryCloseKey(ServiceKey);
-    ServiceKey = NULL;
-
     return STATUS_SUCCESS;
 
-fail4:
-    Error("fail4\n");
-
-    RegistryCloseKey(Driver.ParametersKey);
-    Driver.ParametersKey = NULL;
-
 fail3:
     Error("fail3\n");
 
-    RegistryCloseKey(ServiceKey);
-    ServiceKey = NULL;
+    RegistryCloseKey(Driver.ParametersKey);
+    Driver.ParametersKey = NULL;
 
 fail2:
     Error("fail2\n");
diff --git a/src/xenvbd/registry.c b/src/xenvbd/registry.c
index 811701f..069c62a 100644
--- a/src/xenvbd/registry.c
+++ b/src/xenvbd/registry.c
@@ -38,8 +38,13 @@
 
 #define REGISTRY_TAG 'GERX'
 
+static PDRIVER_OBJECT   RegistryDriverObject;
 static UNICODE_STRING   RegistryPath;
 
+typedef NTSTATUS(*IOOPENDRIVERREGISTRYKEY)(PDRIVER_OBJECT, DRIVER_REGKEY_TYPE, ACCESS_MASK, ULONG, PHANDLE);
+
+static IOOPENDRIVERREGISTRYKEY __IoOpenDriverRegistryKey;
+
 static FORCEINLINE PVOID
 __RegistryAllocate(
     IN  ULONG   Length
@@ -58,9 +63,12 @@ __RegistryFree(
 
 NTSTATUS
 RegistryInitialize(
-    IN PUNICODE_STRING  Path
+    IN  PDRIVER_OBJECT  DriverObject,
+    IN  PUNICODE_STRING Path
     )
 {
+    UNICODE_STRING      Unicode;
+    PVOID               Func;
     NTSTATUS            status;
 
     ASSERT3P(RegistryPath.Buffer, ==, NULL);
@@ -69,6 +77,16 @@ RegistryInitialize(
     if (!NT_SUCCESS(status))
         goto fail1;
 
+    ASSERT3P(RegistryDriverObject, ==, NULL);
+    RegistryDriverObject = DriverObject;
+
+    ASSERT3P(__IoOpenDriverRegistryKey, ==, NULL);
+    RtlInitUnicodeString(&Unicode, L"IoOpenDriverRegistryKey");
+
+    Func = MmGetSystemRoutineAddress(&Unicode);
+    if (Func != NULL)
+        __IoOpenDriverRegistryKey = (IOOPENDRIVERREGISTRYKEY)Func;
+
     return STATUS_SUCCESS;
 
 fail1:
@@ -82,6 +100,10 @@ RegistryTeardown(
     VOID
     )
 {
+    __IoOpenDriverRegistryKey = NULL;
+
+    RegistryDriverObject = NULL;
+
     RtlFreeUnicodeString(&RegistryPath);
     RegistryPath.Buffer = NULL;
     RegistryPath.MaximumLength = RegistryPath.Length = 0;
@@ -270,6 +292,55 @@ RegistryCreateServiceKey(
     return RegistryCreateKey(NULL, &RegistryPath, REG_OPTION_NON_VOLATILE, Key);
 }
 
+__drv_requiresIRQL(PASSIVE_LEVEL)
+NTSTATUS
+RegistryOpenParametersKey(
+    IN  ACCESS_MASK DesiredAccess,
+    OUT PHANDLE     Key
+    )
+{
+    HANDLE              ServiceKey;
+    NTSTATUS            status;
+
+    if (__IoOpenDriverRegistryKey != NULL) {
+        status = __IoOpenDriverRegistryKey(RegistryDriverObject,
+                                           DriverRegKeyParameters,
+                                           DesiredAccess,
+                                           0,
+                                           Key);
+        if (!NT_SUCCESS(status))
+            goto fail1;
+
+        goto done;
+    }
+
+    status = RegistryOpenKey(NULL, &RegistryPath, DesiredAccess, &ServiceKey);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    status = RegistryOpenSubKey(ServiceKey, "Parameters", DesiredAccess, Key);
+    if (!NT_SUCCESS(status))
+        goto fail3;
+
+    RegistryCloseKey(ServiceKey);
+
+done:
+    return STATUS_SUCCESS;
+
+fail3:
+    Error("fail3\n");
+
+    RegistryCloseKey(ServiceKey);
+
+fail2:
+    Error("fail2\n");
+
+fail1:
+    Error("fail1 %08x\n", status);
+
+    return status;
+}
+
 __drv_requiresIRQL(PASSIVE_LEVEL)
 NTSTATUS
 RegistryOpenSoftwareKey(
diff --git a/src/xenvbd/registry.h b/src/xenvbd/registry.h
index d8a2df5..8dac63e 100644
--- a/src/xenvbd/registry.h
+++ b/src/xenvbd/registry.h
@@ -37,7 +37,8 @@
 
 extern NTSTATUS
 RegistryInitialize(
-    IN PUNICODE_STRING  Path
+    IN  PDRIVER_OBJECT  DriverObject,
+    IN  PUNICODE_STRING Path
     );
 
 extern VOID
@@ -76,6 +77,13 @@ RegistryCreateServiceKey(
     OUT PHANDLE     Key
     );
 
+__drv_requiresIRQL(PASSIVE_LEVEL)
+extern NTSTATUS
+RegistryOpenParametersKey(
+    IN  ACCESS_MASK DesiredAccess,
+    OUT PHANDLE     Key
+    );
+
 __drv_requiresIRQL(PASSIVE_LEVEL)
 extern NTSTATUS
 RegistryOpenSoftwareKey(
-- 
2.44.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Jul 09 10:43:36 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 09 Jul 2024 10:43:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.756095.1164654 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8Js-0001Qn-0q; Tue, 09 Jul 2024 10:43:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 756095.1164654; Tue, 09 Jul 2024 10:43:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8Jr-0001Qg-UZ; Tue, 09 Jul 2024 10:43:35 +0000
Received: by outflank-mailman (input) for mailman id 756095;
 Tue, 09 Jul 2024 10:43:34 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KswS=OJ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sR8Jq-0001QH-P9
 for win-pv-devel@lists.xenproject.org; Tue, 09 Jul 2024 10:43:34 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 15d31a00-3de0-11ef-8776-851b0ebba9a2;
 Tue, 09 Jul 2024 12:43:32 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-595850e7e11so322115a12.1
 for <win-pv-devel@lists.xenproject.org>; Tue, 09 Jul 2024 03:43:32 -0700 (PDT)
Received: from localhost.localdomain
 (host109-158-229-15.range109-158.btcentralplus.com. [109.158.229.15])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-594bba548bcsm909572a12.17.2024.07.09.03.43.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 09 Jul 2024 03:43:31 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 15d31a00-3de0-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720521811; x=1721126611; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=K5S03Q7VzianSK6o4rXd+eNnzK5plIJJgApPFaLuIsM=;
        b=W7d+vhceBxYXEJZU+NJTpjI/8eQ4r16puu4sBCqj/Ds9fDAaNzjDq4U45LIk+/aW/j
         Qp+1GMDZ9yWwbFhDyIRimGaHikRQ6XHgc6R3Ee2LKoESirCmCB4mmz27NxefkiUNwnYI
         /M4FOkXO+t0SjbCSAwF0p0n0VJEngPsBTz9WI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720521811; x=1721126611;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=K5S03Q7VzianSK6o4rXd+eNnzK5plIJJgApPFaLuIsM=;
        b=dvLdjeejD0e8s2sAg43ntz251pgpjWpJ5m/p6Sy48XkS7V71yQ23Ko3J3aVuezWv1h
         lioA9w/BuMLGaxuDTVOb82QEEICxz7ghW5vyBQwA7ppf6wWHIAPA81a0LMKHXVW0Jpoq
         hvfCoYeCfy+P8hbCfv4Iem7yjGLkV5/OL6t8E0qahPNIj/ww4ClOTkY+OX1A8AC031yP
         iglkPPkJ0m6lBkYMuSi+eCicDSCr0Y8ymRdsiUkvXTMfRFpPjWzagc5hjqEvy7ZDSMz9
         SlIjymX47yD0RyS2ibNYKu7gq28Lv1UVEzUzr/X6POpfPdR2wdcO7HxDhEazBgpmdxhv
         3dbw==
X-Gm-Message-State: AOJu0YzeZv4L5Cb9xfFH6Y2yqhWco0qWzHgsMXlOgizfYdxSIOjpl70P
	n+kcWGASOD6mdvMFq3vDQuzCRNelFER1aT/s5rewhQm7+3tA7IgPtbATyhMudkCwGVr1o6vgQnQ
	=
X-Google-Smtp-Source: AGHT+IHgpMbe9hQdCSkZjOOP/IuUROut2b87wVks9kYEQitsvV03h61/qAOpSuzWRM4pR0oNZYAwzg==
X-Received: by 2002:a05:6402:1c87:b0:58b:7413:db00 with SMTP id 4fb4d7f45d1cf-594bbe2b9e5mr1317009a12.37.1720521811259;
        Tue, 09 Jul 2024 03:43:31 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [XENVBD PATCH 2/2] Use UNPLUG v3
Date: Tue,  9 Jul 2024 11:43:19 +0100
Message-ID: <20240709104319.1273-2-owen.smith@cloud.com>
X-Mailer: git-send-email 2.44.0.windows.1
In-Reply-To: <20240709104319.1273-1-owen.smith@cloud.com>
References: <20240709104319.1273-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use UnplugBootEmulated to detect whether the boot disk should remain emulated
to avoid openning an absolute registry path.
Use UnplugReboot to request a reboot from xenbus_monitor. Also removes the
RequestKey property from the INF file, as its no longer needed.
Bumps binding in INF file to match revision exposed by xenbus that implements
UNPLUG v3 (0x0900000B)

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 include/unplug_interface.h | 40 +++++++++++++++++++-
 src/xenvbd.inf             |  8 ++--
 src/xenvbd/adapter.c       | 35 ++++++++++++------
 src/xenvbd/adapter.h       |  5 +++
 src/xenvbd/driver.c        | 76 --------------------------------------
 src/xenvbd/driver.h        |  6 ---
 6 files changed, 69 insertions(+), 101 deletions(-)

diff --git a/include/unplug_interface.h b/include/unplug_interface.h
index e99b406..1dc9f51 100644
--- a/include/unplug_interface.h
+++ b/include/unplug_interface.h
@@ -99,6 +99,28 @@ typedef BOOLEAN
     IN  XENBUS_UNPLUG_DEVICE_TYPE   Type
     );
 
+/*! \typedef XENBUS_UNPLUG_BOOT_EMULATED
+    \brief Should the boot disk be emulated
+
+    \param Interface The interface header
+*/
+typedef BOOLEAN
+(*XENBUS_UNPLUG_BOOT_EMULATED)(
+    IN  PINTERFACE                  Interface
+    );
+
+/*! \typedef XENBUS_UNPLUG_REBOOT
+    \brief Request a reboot to complete setup
+
+    \param Interface The interface header
+    \param Module The module name requesting a reboot
+*/
+typedef VOID
+(*XENBUS_UNPLUG_REBOOT)(
+    IN  PINTERFACE                  Interface,
+    IN  PCHAR                       Module
+    );
+
 // {73db6517-3d06-4937-989f-199b7501e229}
 DEFINE_GUID(GUID_XENBUS_UNPLUG_INTERFACE,
 0x73db6517, 0x3d06, 0x4937, 0x98, 0x9f, 0x19, 0x9b, 0x75, 0x01, 0xe2, 0x29);
@@ -126,7 +148,21 @@ struct _XENBUS_UNPLUG_INTERFACE_V2 {
     XENBUS_UNPLUG_IS_REQUESTED  UnplugIsRequested;
 };
 
-typedef struct _XENBUS_UNPLUG_INTERFACE_V2 XENBUS_UNPLUG_INTERFACE, *PXENBUS_UNPLUG_INTERFACE;
+/*! \struct _XENBUS_UNPLUG_INTERFACE_V3
+    \brief UNPLUG interface version 3
+    \ingroup interfaces
+*/
+struct _XENBUS_UNPLUG_INTERFACE_V3 {
+    INTERFACE                   Interface;
+    XENBUS_UNPLUG_ACQUIRE       UnplugAcquire;
+    XENBUS_UNPLUG_RELEASE       UnplugRelease;
+    XENBUS_UNPLUG_REQUEST       UnplugRequest;
+    XENBUS_UNPLUG_IS_REQUESTED  UnplugIsRequested;
+    XENBUS_UNPLUG_BOOT_EMULATED UnplugBootEmulated;
+    XENBUS_UNPLUG_REBOOT        UnplugReboot;
+};
+
+typedef struct _XENBUS_UNPLUG_INTERFACE_V3 XENBUS_UNPLUG_INTERFACE, *PXENBUS_UNPLUG_INTERFACE;
 
 /*! \def XENBUS_UNPLUG
     \brief Macro at assist in method invocation
@@ -137,6 +173,6 @@ typedef struct _XENBUS_UNPLUG_INTERFACE_V2 XENBUS_UNPLUG_INTERFACE, *PXENBUS_UNP
 #endif  // _WINDLL
 
 #define XENBUS_UNPLUG_INTERFACE_VERSION_MIN  1
-#define XENBUS_UNPLUG_INTERFACE_VERSION_MAX  2
+#define XENBUS_UNPLUG_INTERFACE_VERSION_MAX  3
 
 #endif  // _XENBUS_UNPLUG_INTERFACE_H
diff --git a/src/xenvbd.inf b/src/xenvbd.inf
index 8bb7998..dfde613 100644
--- a/src/xenvbd.inf
+++ b/src/xenvbd.inf
@@ -54,9 +54,9 @@ xendisk.sys=0,,
 %Vendor%=Inst,NT@INF_ARCH@
 
 [Inst.NT@INF_ARCH@]
-%XenVbdName%=XenVbd_Inst,XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_VBD&REV_0900000A
-%XenVbdName%=XenVbd_Inst,XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_VBD&REV_0900000A
-%XenVbdName%=XenVbd_Inst,XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_VBD&REV_0900000A
+%XenVbdName%=XenVbd_Inst,XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_VBD&REV_0900000B
+%XenVbdName%=XenVbd_Inst,XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_VBD&REV_0900000B
+%XenVbdName%=XenVbd_Inst,XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_VBD&REV_0900000B
 
 [XenVbd_Inst] 
 CopyFiles=XenVbd_Copyfiles
@@ -101,7 +101,6 @@ AddReg=XenVbd_Parameters, XenVbd_Unplug, XenVbd_Extras
 HKR,"Parameters",,0x00000010
 HKR,"Parameters","BusType",0x00010001,0x00000001 
 HKR,"Parameters\PnpInterface","5",0x00010001,0x00000001 
-HKR,"Parameters","RequestKey",0x00000000,%RequestKey%
 HKR,"Parameters","max-ring-page-order",0x00010001,0x00000001
 HKR,"Parameters","multi-queue-max-queues",0x00010001,0x00000002
 
@@ -120,7 +119,6 @@ Vendor = "@VENDOR_NAME@"
 DiskDesc = "@PRODUCT_NAME@ PV Storage Host Adapter Package" 
 XenVbdName= "@PRODUCT_NAME@ PV Storage Host Adapter"
 XenDiskName= "@PRODUCT_NAME@ PV Storage Filter"
-RequestKey="SYSTEM\CurrentControlSet\Services\xenbus_monitor\Request"
 UnplugKey="SYSTEM\CurrentControlSet\Services\XEN\Unplug"
 PnpKey="SYSTEM\CurrentControlSet\Control\Pnp"
 PartMgrKey="SYSTEM\CurrentControlSet\Services\PartMgr\Parameters"
diff --git a/src/xenvbd/adapter.c b/src/xenvbd/adapter.c
index 7092086..0f9500c 100644
--- a/src/xenvbd/adapter.c
+++ b/src/xenvbd/adapter.c
@@ -418,6 +418,24 @@ AdapterBootEmulated(
     return Adapter->BootEmulated;
 }
 
+VOID
+AdapterRequestReboot(
+    IN  PXENVBD_ADAPTER Adapter
+    )
+{
+    NTSTATUS            status;
+
+    status = XENBUS_UNPLUG(Acquire, &Adapter->UnplugInterface);
+    if (!NT_SUCCESS(status))
+        return;
+
+    XENBUS_UNPLUG(Reboot,
+                  &Adapter->UnplugInterface,
+                  __MODULE__);
+
+    XENBUS_UNPLUG(Release, &Adapter->UnplugInterface);
+}
+
 static FORCEINLINE VOID
 __AdapterEnumerate(
     IN  PXENVBD_ADAPTER Adapter,
@@ -508,7 +526,7 @@ __AdapterEnumerate(
     if (NeedInvalidate)
         AdapterTargetListChanged(Adapter);
     if (NeedReboot)
-        DriverRequestReboot();
+        AdapterRequestReboot(Adapter);
 }
 
 static DECLSPEC_NOINLINE NTSTATUS
@@ -1190,25 +1208,18 @@ __AdapterSetBootEmulated(
     IN  PXENVBD_ADAPTER Adapter
     )
 {
-    CHAR                Key[] = "XEN:BOOT_EMULATED=";
-    PANSI_STRING        Option;
-    PCHAR               Value;
     NTSTATUS            status;
 
     Adapter->BootEmulated = FALSE;
 
-    status = RegistryQuerySystemStartOption(Key, &Option);
+    status = XENBUS_UNPLUG(Acquire, &Adapter->UnplugInterface);
     if (!NT_SUCCESS(status))
         return;
 
-    Value = Option->Buffer + sizeof (Key) - 1;
+    Adapter->BootEmulated = XENBUS_UNPLUG(BootEmulated,
+                                          &Adapter->UnplugInterface);
 
-    if (strcmp(Value, "TRUE") == 0)
-        Adapter->BootEmulated = TRUE;
-    else if (strcmp(Value, "FALSE") != 0)
-        Warning("UNRECOGNIZED VALUE OF %s: %s\n", Key, Value);
-
-    RegistryFreeSzValue(Option);
+    XENBUS_UNPLUG(Release, &Adapter->UnplugInterface);
 }
 
 __drv_requiresIRQL(PASSIVE_LEVEL)
diff --git a/src/xenvbd/adapter.h b/src/xenvbd/adapter.h
index e6684ba..7b8b952 100644
--- a/src/xenvbd/adapter.h
+++ b/src/xenvbd/adapter.h
@@ -73,6 +73,11 @@ AdapterBootEmulated(
     IN  PXENVBD_ADAPTER Adapter
     );
 
+extern VOID
+AdapterRequestReboot(
+    IN  PXENVBD_ADAPTER Adapter
+    );
+
 extern VOID
 AdapterCompleteSrb(
     IN  PXENVBD_ADAPTER Adapter,
diff --git a/src/xenvbd/driver.c b/src/xenvbd/driver.c
index ba0ad33..676246e 100644
--- a/src/xenvbd/driver.c
+++ b/src/xenvbd/driver.c
@@ -111,82 +111,6 @@ DriverDispatchPower(
     return Driver.StorPortDispatchPower(DeviceObject, Irp);
 }
 
-#define MAXNAMELEN  256
-
-__drv_requiresIRQL(PASSIVE_LEVEL)
-VOID
-DriverRequestReboot(
-    VOID
-    )
-{
-    PANSI_STRING    Ansi;
-    CHAR            RequestKeyName[MAXNAMELEN];
-    HANDLE          RequestKey;
-    HANDLE          SubKey;
-    NTSTATUS        status;
-
-    ASSERT3U(KeGetCurrentIrql(), ==, PASSIVE_LEVEL);
-
-    status = RegistryQuerySzValue(Driver.ParametersKey,
-                                  "RequestKey",
-                                  NULL,
-                                  &Ansi);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    status = RtlStringCbPrintfA(RequestKeyName,
-                                MAXNAMELEN,
-                                "\\Registry\\Machine\\%Z",
-                                &Ansi[0]);
-    ASSERT(NT_SUCCESS(status));
-
-    status = RegistryCreateSubKey(NULL,
-                                  RequestKeyName,
-                                  REG_OPTION_NON_VOLATILE,
-                                  &RequestKey);
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    status = RegistryCreateSubKey(RequestKey,
-                                  __MODULE__,
-                                  REG_OPTION_VOLATILE,
-                                  &SubKey);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
-    status = RegistryUpdateDwordValue(SubKey,
-                                      "Reboot",
-                                      1);
-    if (!NT_SUCCESS(status))
-        goto fail4;
-
-    RegistryCloseKey(SubKey);
-
-    RegistryCloseKey(RequestKey);
-
-    RegistryFreeSzValue(Ansi);
-
-    return;
-
-fail4:
-    Error("fail4\n");
-
-    RegistryCloseKey(SubKey);
-
-fail3:
-    Error("fail3\n");
-
-    RegistryCloseKey(RequestKey);
-
-fail2:
-    Error("fail2\n");
-
-    RegistryFreeSzValue(Ansi);
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-}
-
 __drv_dispatchType(IRP_MJ_PNP)
 DRIVER_DISPATCH             DispatchPnp;
 
diff --git a/src/xenvbd/driver.h b/src/xenvbd/driver.h
index cd3c97f..5c5df45 100644
--- a/src/xenvbd/driver.h
+++ b/src/xenvbd/driver.h
@@ -62,12 +62,6 @@ DriverDispatchPower(
     IN  PIRP            Irp
     );
 
-__drv_requiresIRQL(PASSIVE_LEVEL)
-extern VOID
-DriverRequestReboot(
-    VOID
-    );
-
 // Registry overrides for driver features
 typedef enum _XENVBD_FEATURE {
     FeatureRemovable = 0,
-- 
2.44.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Jul 09 10:45:14 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 09 Jul 2024 10:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.756123.1164671 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8LS-0002At-I4; Tue, 09 Jul 2024 10:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 756123.1164671; Tue, 09 Jul 2024 10:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8LS-0002Am-FW; Tue, 09 Jul 2024 10:45:14 +0000
Received: by outflank-mailman (input) for mailman id 756123;
 Tue, 09 Jul 2024 10:45:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KswS=OJ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sR8LR-00029g-B8
 for win-pv-devel@lists.xenproject.org; Tue, 09 Jul 2024 10:45:13 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 51e85205-3de0-11ef-bbfb-fd08da9f4363;
 Tue, 09 Jul 2024 12:45:12 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-58c947a6692so6149723a12.0
 for <win-pv-devel@lists.xenproject.org>; Tue, 09 Jul 2024 03:45:12 -0700 (PDT)
Received: from localhost.localdomain
 (host109-158-229-15.range109-158.btcentralplus.com. [109.158.229.15])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-594bd459ddasm916673a12.64.2024.07.09.03.45.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 09 Jul 2024 03:45:11 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 51e85205-3de0-11ef-bbfb-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720521912; x=1721126712; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=Zx0N9wjTd4lemziP1gju4jLrX7rhK6imRSki8rd1T0c=;
        b=AT8H0tNmIP5YiYCYPEeTERHHs/RqiNmKUJOOEcHjXL6lxcaauanhzbwRrJAUGeouMT
         4IjErSTDVRx/4pUPa+b2HI0uoeZDGUSm9GxPhZkZQk5pH756y4DoYfgEIytHjRvwG+IX
         Yo7CV24/+FGoIjX4TOVsz8R8PU+f9SMWf8Lfo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720521912; x=1721126712;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Zx0N9wjTd4lemziP1gju4jLrX7rhK6imRSki8rd1T0c=;
        b=HYJWlgw/GSms/JCPeGL6CfxQOrlStSUCzFzjO/7Je1mmgBkCBhGkv17blGAEVopcRE
         Sloim9S0gHzfCUeyS9RkN8ZbTDXR9N8BaJIerqX7lS4DEigq145hCPzNJ8Z0X0b4GIak
         sYNr0ao9WY+FKxvjekvpYKhnJYjHDZVt7OFAknHPekwUOUkK/JDnKawBMZBAGU/xEoO4
         kNnQrtnYk3cV5nuk/JpgWXwo0TnyzPWa270L8XkEfU6UYDGtGEHxTTp9MS3J/inxe9go
         nhuwoVgFpunwU81KqgV2VMxm1WlSE7+SlC4oh7ShEHWWThryKN5NuW/Z/4CB38hb7vQp
         8TlQ==
X-Gm-Message-State: AOJu0YwV/ZCpmxmPOKgTdn13N/mFlCNYZ45rvR5/BSNcEBGBXBslWTIu
	daxnPs08X9dAIqAaMMhBLFinnpDjQ14e0AxlZDs2x+LVdAg1kDTM+ChgcbsVfkix7M83CjQ3JCU
	=
X-Google-Smtp-Source: AGHT+IFL6JObVfv0OYJr1hms9yF5lDteT9/8NrgB1N94jGSv9Rz5swfM8V8xAXSjsc7cHRNCQf7g4w==
X-Received: by 2002:a05:6402:4304:b0:58d:ebf9:4e2d with SMTP id 4fb4d7f45d1cf-594b9b068d5mr1838780a12.2.1720521911625;
        Tue, 09 Jul 2024 03:45:11 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [XENVIF PATCH 1/3] Avoid returning STATUS_PNP_REBOOT_REQUIRED
Date: Tue,  9 Jul 2024 11:44:58 +0100
Message-ID: <20240709104500.1392-1-owen.smith@cloud.com>
X-Mailer: git-send-email 2.44.0.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

When emulated devices are present, returning STATUS_PNP_REBOOT_REQUIRED
will display the 'reboot required' toast popup, but will also count as
a failure when distributing XenNet via Windows Update, which will
result in Microsoft pulling the XenNet update.
Note: PnpUnplugRequest is called twice in this startup codepath, as
      the reference count is decreased by PdoStopDevice later and
      keeping the reference count above zero is needed to unplug
      the emulated device.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/xenvif/pdo.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
index a3ae061..8ec9814 100644
--- a/src/xenvif/pdo.c
+++ b/src/xenvif/pdo.c
@@ -1407,7 +1407,6 @@ PdoStartDevice(
     IN  PIRP            Irp
     )
 {
-    PIO_STACK_LOCATION  StackLocation;
     HANDLE              SoftwareKey;
     HANDLE              HardwareKey;
     NTSTATUS            status;
@@ -1438,18 +1437,15 @@ PdoStartDevice(
 
     status = PdoParseMibTable(Pdo, SoftwareKey);
     if (status == STATUS_PNP_REBOOT_REQUIRED || !PdoUnplugRequested(Pdo)) {
-        PdoUnplugRequest(Pdo, TRUE);
+        PdoUnplugRequest(Pdo, TRUE); // fix unplug reference count
         DriverRequestReboot();
 
-        status = STATUS_PNP_REBOOT_REQUIRED;
-        goto fail5;
+        status = STATUS_SUCCESS;
     }
 
-    StackLocation = IoGetCurrentIrpStackLocation(Irp);
-
     status = PdoD3ToD0(Pdo);
     if (!NT_SUCCESS(status))
-        goto fail6;
+        goto fail5;
 
     PdoUnplugRequest(Pdo, TRUE);
 
@@ -1463,9 +1459,6 @@ PdoStartDevice(
 
     return STATUS_SUCCESS;
 
-fail6:
-    Error("fail6\n");
-
 fail5:
     Error("fail5\n");
 
-- 
2.44.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Jul 09 10:45:16 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 09 Jul 2024 10:45:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.756124.1164676 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8LU-0002Cu-Jg; Tue, 09 Jul 2024 10:45:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 756124.1164676; Tue, 09 Jul 2024 10:45:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8LU-0002Cm-Gq; Tue, 09 Jul 2024 10:45:16 +0000
Received: by outflank-mailman (input) for mailman id 756124;
 Tue, 09 Jul 2024 10:45:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KswS=OJ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sR8LT-00029g-9o
 for win-pv-devel@lists.xenproject.org; Tue, 09 Jul 2024 10:45:15 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 52f71b7a-3de0-11ef-bbfb-fd08da9f4363;
 Tue, 09 Jul 2024 12:45:14 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-58bac81f419so6572975a12.0
 for <win-pv-devel@lists.xenproject.org>; Tue, 09 Jul 2024 03:45:14 -0700 (PDT)
Received: from localhost.localdomain
 (host109-158-229-15.range109-158.btcentralplus.com. [109.158.229.15])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-594bd459ddasm916673a12.64.2024.07.09.03.45.13
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 09 Jul 2024 03:45:13 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 52f71b7a-3de0-11ef-bbfb-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720521914; x=1721126714; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=5PhRfB+dduY07yBHDh3vG8xstGUqs8kbBIv7+w6J2ac=;
        b=gOHRUBzXPqwRLRHRHwYXdVu/a9uBGZaF+RJtIKpR8T151GkM11U442/QZh1lKDHajh
         VpTdeh6oexxU/Gu61FqWwzCRj9uEpyxgD2v0+0THvq9Hy0maXyqwUazypIFgyCcAb/9y
         OnutwpG8WueEJEJUqq9u8JgcM/8ZJ3xPCe7X8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720521914; x=1721126714;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=5PhRfB+dduY07yBHDh3vG8xstGUqs8kbBIv7+w6J2ac=;
        b=uhpWhauw3Xyzj1XcOrmZly1bZ8yfHGla+OJDdUk3u1nVZZbHPo2aSwpHWE0YnXa5lW
         6u99d5aAFFGwt12IeYZn1s6i85f2AAQIm94f7Quh+GYeSdb7OjeZsy+gpuZ21IUm17dr
         L4ZASyyYp7v9MPKyYHuDkOQ+Th8Sbtk9iLKqtxSUHYV/ZRZMJjcav3xTULfOfUUWpXwl
         ttNUcAkywcBNQ2c8idKbuSwkDcAfXvUR99k3bpupoQNFL9sb32vNxwZiAheD7VRDAAMh
         lBMmoghSkQiGIkZxWFdHhSEk38EMm4Ft+81lq1dVa7cmPPeaOtKDQbhBXS/40YP8HGLA
         SakQ==
X-Gm-Message-State: AOJu0YwXcneo5G3VJR4aAua4jofHwmRSU7168jIgrRvWF7y8qfW3ksZ0
	XO9kmObNYs8h5w3tqdevlrQfTgs85qZMAmLM5x/zc0WnWdfUVqQS8vGqAIb3SBf4e8aHB2gy2bU
	=
X-Google-Smtp-Source: AGHT+IFQ+tVhywcSv3x8A0dqaFTu2OlSLyamyepzNNFLQ+Yq6Urg/Hz3PdAgSg4gRyt6PDIIBgxz9g==
X-Received: by 2002:a05:6402:1ecf:b0:586:12f6:c0fe with SMTP id 4fb4d7f45d1cf-594ba99755cmr1665104a12.5.1720521913904;
        Tue, 09 Jul 2024 03:45:13 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [XENVIF PATCH 3/3] Use UNPLUG v3
Date: Tue,  9 Jul 2024 11:45:00 +0100
Message-ID: <20240709104500.1392-3-owen.smith@cloud.com>
X-Mailer: git-send-email 2.44.0.windows.1
In-Reply-To: <20240709104500.1392-1-owen.smith@cloud.com>
References: <20240709104500.1392-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Uses UnplugReboot to request a reboot from xenbus_monitor, rather than
writing values into an absolute registry path, which is a driver verifier
violation during Server 2025 WHQL testing.
Also removes the RequestKey from the INF file

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 include/revision.h         |  3 +-
 include/unplug_interface.h | 40 +++++++++++++++-
 src/xenvif.inf             |  8 ++--
 src/xenvif/driver.c        | 93 --------------------------------------
 src/xenvif/driver.h        |  5 --
 src/xenvif/pdo.c           | 20 +++++++-
 6 files changed, 62 insertions(+), 107 deletions(-)

diff --git a/include/revision.h b/include/revision.h
index 2f4ac80..656f171 100644
--- a/include/revision.h
+++ b/include/revision.h
@@ -46,6 +46,7 @@
     DEFINE_REVISION(0x09000001,  2,  8,   2,  1,   1),  \
     DEFINE_REVISION(0x09000002,  2,  9,   2,  1,   1),  \
     DEFINE_REVISION(0x09000003,  2,  10,  2,  1,   1),  \
-    DEFINE_REVISION(0x09000004,  2,  10,  2,  1,   2)
+    DEFINE_REVISION(0x09000004,  2,  10,  2,  1,   2),  \
+    DEFINE_REVISION(0x09000005,  2,  10,  2,  1,   3)
 
 #endif  // _REVISION_H
diff --git a/include/unplug_interface.h b/include/unplug_interface.h
index dbdc76d..dad3afc 100644
--- a/include/unplug_interface.h
+++ b/include/unplug_interface.h
@@ -99,6 +99,28 @@ typedef BOOLEAN
     IN  XENBUS_UNPLUG_DEVICE_TYPE   Type
     );
 
+/*! \typedef XENBUS_UNPLUG_BOOT_EMULATED
+    \brief Should the boot disk be emulated
+
+    \param Interface The interface header
+*/
+typedef BOOLEAN
+(*XENBUS_UNPLUG_BOOT_EMULATED)(
+    IN  PINTERFACE                  Interface
+    );
+
+/*! \typedef XENBUS_UNPLUG_REBOOT
+    \brief Request a reboot to complete setup
+
+    \param Interface The interface header
+    \param Module The module name requesting a reboot
+*/
+typedef VOID
+(*XENBUS_UNPLUG_REBOOT)(
+    IN  PINTERFACE                  Interface,
+    IN  PCHAR                       Module
+    );
+
 // {73db6517-3d06-4937-989f-199b7501e229}
 DEFINE_GUID(GUID_XENBUS_UNPLUG_INTERFACE,
 0x73db6517, 0x3d06, 0x4937, 0x98, 0x9f, 0x19, 0x9b, 0x75, 0x01, 0xe2, 0x29);
@@ -126,7 +148,21 @@ struct _XENBUS_UNPLUG_INTERFACE_V2 {
     XENBUS_UNPLUG_IS_REQUESTED  UnplugIsRequested;
 };
 
-typedef struct _XENBUS_UNPLUG_INTERFACE_V2 XENBUS_UNPLUG_INTERFACE, *PXENBUS_UNPLUG_INTERFACE;
+/*! \struct _XENBUS_UNPLUG_INTERFACE_V3
+    \brief UNPLUG interface version 3
+    \ingroup interfaces
+*/
+struct _XENBUS_UNPLUG_INTERFACE_V3 {
+    INTERFACE                   Interface;
+    XENBUS_UNPLUG_ACQUIRE       UnplugAcquire;
+    XENBUS_UNPLUG_RELEASE       UnplugRelease;
+    XENBUS_UNPLUG_REQUEST       UnplugRequest;
+    XENBUS_UNPLUG_IS_REQUESTED  UnplugIsRequested;
+    XENBUS_UNPLUG_BOOT_EMULATED UnplugBootEmulated;
+    XENBUS_UNPLUG_REBOOT        UnplugReboot;
+};
+
+typedef struct _XENBUS_UNPLUG_INTERFACE_V3 XENBUS_UNPLUG_INTERFACE, *PXENBUS_UNPLUG_INTERFACE;
 
 /*! \def XENBUS_UNPLUG
     \brief Macro at assist in method invocation
@@ -137,6 +173,6 @@ typedef struct _XENBUS_UNPLUG_INTERFACE_V2 XENBUS_UNPLUG_INTERFACE, *PXENBUS_UNP
 #endif  // _WINDLL
 
 #define XENBUS_UNPLUG_INTERFACE_VERSION_MIN  1
-#define XENBUS_UNPLUG_INTERFACE_VERSION_MAX  2
+#define XENBUS_UNPLUG_INTERFACE_VERSION_MAX  3
 
 #endif  // _XENBUS_UNPLUG_INTERFACE_H
diff --git a/src/xenvif.inf b/src/xenvif.inf
index 8bfc37c..0430f04 100644
--- a/src/xenvif.inf
+++ b/src/xenvif.inf
@@ -56,9 +56,9 @@ xenvif.sys=0,,
 ; DisplayName		Section		DeviceID
 ; -----------		-------		--------
 
-%XenVifName%		=XenVif_Inst,	XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_VIF&REV_0900000A
-%XenVifName%		=XenVif_Inst,	XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_VIF&REV_0900000A
-%XenVifName%		=XenVif_Inst,	XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_VIF&REV_0900000A
+%XenVifName%		=XenVif_Inst,	XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_VIF&REV_0900000B
+%XenVifName%		=XenVif_Inst,	XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_VIF&REV_0900000B
+%XenVifName%		=XenVif_Inst,	XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_VIF&REV_0900000B
 
 [XenVif_Inst] 
 CopyFiles=XenVif_Copyfiles
@@ -83,7 +83,6 @@ HKR,,"BootFlags",0x00010003,0x81
 
 [XenVif_Parameters]
 HKR,"Parameters",,0x00000010
-HKR,"Parameters","RequestKey",0x00000000,%RequestKey%
 HKR,"Parameters","FrontendMaxQueues",0x00010001,0x00000008
 
 [XenVif_Unplug]
@@ -94,7 +93,6 @@ HKLM,%UnplugKey%,"NICS",0x00010001,0
 Vendor="@VENDOR_NAME@"
 DiskDesc="@PRODUCT_NAME@ PV Network Class Package"
 XenVifName="@PRODUCT_NAME@ PV Network Class"
-RequestKey="SYSTEM\CurrentControlSet\Services\xenbus_monitor\Request"
 UnplugKey="SYSTEM\CurrentControlSet\Services\XEN\Unplug"
 
 SERVICE_BOOT_START=0x0 
diff --git a/src/xenvif/driver.c b/src/xenvif/driver.c
index 2ac793d..30e3373 100644
--- a/src/xenvif/driver.c
+++ b/src/xenvif/driver.c
@@ -49,7 +49,6 @@ typedef struct _XENVIF_DRIVER {
     HANDLE              ParametersKey;
     HANDLE              AddressesKey;
     HANDLE              SettingsKey;
-    BOOLEAN             NeedReboot;
 } XENVIF_DRIVER, *PXENVIF_DRIVER;
 
 static XENVIF_DRIVER    Driver;
@@ -120,96 +119,6 @@ DriverGetParametersKey(
     return __DriverGetParametersKey();
 }
 
-#define MAXNAMELEN  256
-
-static FORCEINLINE VOID
-__DriverRequestReboot(
-    VOID
-    )
-{
-    PANSI_STRING    Ansi;
-    CHAR            RequestKeyName[MAXNAMELEN];
-    HANDLE          RequestKey;
-    HANDLE          SubKey;
-    NTSTATUS        status;
-
-    Info("====>\n");
-
-    ASSERT3U(KeGetCurrentIrql(), ==, PASSIVE_LEVEL);
-
-    status = RegistryQuerySzValue(__DriverGetParametersKey(),
-                                  "RequestKey",
-                                  NULL,
-                                  &Ansi);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    status = RtlStringCbPrintfA(RequestKeyName,
-                                MAXNAMELEN,
-                                "\\Registry\\Machine\\%Z",
-                                &Ansi[0]);
-    ASSERT(NT_SUCCESS(status));
-
-    status = RegistryCreateSubKey(NULL,
-                                  RequestKeyName,
-                                  REG_OPTION_NON_VOLATILE,
-                                  &RequestKey);
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    status = RegistryCreateSubKey(RequestKey,
-                                  __MODULE__,
-                                  REG_OPTION_VOLATILE,
-                                  &SubKey);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
-    status = RegistryUpdateDwordValue(SubKey,
-                                      "Reboot",
-                                      1);
-    if (!NT_SUCCESS(status))
-        goto fail4;
-
-    RegistryCloseKey(SubKey);
-
-    RegistryFreeSzValue(Ansi);
-
-    Info("<====\n");
-
-    return;
-
-fail4:
-    Error("fail4\n");
-
-    RegistryCloseKey(SubKey);
-
-fail3:
-    Error("fail3\n");
-
-    RegistryCloseKey(RequestKey);
-
-fail2:
-    Error("fail2\n");
-
-    RegistryFreeSzValue(Ansi);
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-}
-
-VOID
-DriverRequestReboot(
-    VOID
-    )
-{
-    if (Driver.NeedReboot)
-        return;
-
-    __DriverRequestReboot();
-
-    Driver.NeedReboot = TRUE;
-}
-
 DRIVER_UNLOAD       DriverUnload;
 
 VOID
@@ -223,8 +132,6 @@ DriverUnload(
 
     Trace("====>\n");
 
-    Driver.NeedReboot = FALSE;
-
     ParametersKey = __DriverGetParametersKey();
     __DriverSetParametersKey(NULL);
 
diff --git a/src/xenvif/driver.h b/src/xenvif/driver.h
index a9b47d4..8ce0494 100644
--- a/src/xenvif/driver.h
+++ b/src/xenvif/driver.h
@@ -48,11 +48,6 @@ DriverGetParametersKey(
     VOID
     );
 
-extern VOID
-DriverRequestReboot(
-    VOID
-    );
-
 typedef struct _XENVIF_PDO  XENVIF_PDO, *PXENVIF_PDO;
 typedef struct _XENVIF_FDO  XENVIF_FDO, *PXENVIF_FDO;
 
diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
index 51cbd97..ffbf924 100644
--- a/src/xenvif/pdo.c
+++ b/src/xenvif/pdo.c
@@ -1152,6 +1152,24 @@ fail1:
     return status;
 }
 
+static VOID
+PdoRequestReboot(
+    IN  PXENVIF_PDO Pdo
+    )
+{
+    NTSTATUS        status;
+
+    status = XENBUS_UNPLUG(Acquire, &Pdo->UnplugInterface);
+    if (!NT_SUCCESS(status))
+        return;
+
+    XENBUS_UNPLUG(Reboot,
+                  &Pdo->UnplugInterface,
+                  __MODULE__);
+
+    XENBUS_UNPLUG(Release, &Pdo->UnplugInterface);
+}
+
 static VOID
 PdoUnplugRequest(
     IN  PXENVIF_PDO Pdo,
@@ -1305,7 +1323,7 @@ PdoStartDevice(
     status = PdoParseMibTable(Pdo);
     if (status == STATUS_PNP_REBOOT_REQUIRED || !PdoUnplugRequested(Pdo)) {
         PdoUnplugRequest(Pdo, TRUE); // fix unplug reference count
-        DriverRequestReboot();
+        PdoRequestReboot(Pdo);
 
         status = STATUS_SUCCESS;
     }
-- 
2.44.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Jul 09 10:45:18 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 09 Jul 2024 10:45:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.756125.1164680 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8LW-0002FX-Ky; Tue, 09 Jul 2024 10:45:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 756125.1164680; Tue, 09 Jul 2024 10:45:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8LW-0002FQ-IE; Tue, 09 Jul 2024 10:45:18 +0000
Received: by outflank-mailman (input) for mailman id 756125;
 Tue, 09 Jul 2024 10:45:17 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KswS=OJ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sR8LV-0002Ei-Bq
 for win-pv-devel@lists.xenproject.org; Tue, 09 Jul 2024 10:45:17 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 52c8b6f3-3de0-11ef-8776-851b0ebba9a2;
 Tue, 09 Jul 2024 12:45:14 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-52ea7bdde68so4369536e87.0
 for <win-pv-devel@lists.xenproject.org>; Tue, 09 Jul 2024 03:45:14 -0700 (PDT)
Received: from localhost.localdomain
 (host109-158-229-15.range109-158.btcentralplus.com. [109.158.229.15])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-594bd459ddasm916673a12.64.2024.07.09.03.45.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 09 Jul 2024 03:45:12 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 52c8b6f3-3de0-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720521913; x=1721126713; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=7SAiv1fCCZv4HvhzZXz2x91/tLCu+6OF+4sNZ6Vhw18=;
        b=RUSHq1yrTjE5a7g7JDD2P5woV4Cg0/E2/crMX0nVAneskpTsjdgvOrvo5NW82XrHlN
         CqVdGUQFLvVW7F5cf0o3qLabQwXRPO3raVZtmfDYkp1wnIorSPOFOdQR/zxAy9GsyAO0
         UJ0tOt4KpZNz17E+3uPlp2x+Nh8f+QwgPZKcY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720521913; x=1721126713;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=7SAiv1fCCZv4HvhzZXz2x91/tLCu+6OF+4sNZ6Vhw18=;
        b=wQ/KD3rLYq6jfAMQn3BRFV/nI/sxDXu0fk/fvtv1YZO6QXjmn+WgtLN6n3dfNGt2kr
         /4bRNtVqCl/IZzUqVwPKneX8GhqpxZ28/isnVI8JcMDd1E2t83h0XdAM6K6XUARNbbvh
         aBsRVqaxzNw6z4BXXlU0f4Ta2O7HOa8k/HD/7uW/Plvx8X1ND8e4GBY7eTswZnviuxiy
         T6mkPDfFzrdtateFMxkvn4P1Kp6BzETx/65qXvcrItYiOjZQdtP4XQQtU1wLNN/1LlBf
         kaqIYLHmuEhvslGFEP5vZyOrCSMsk4tA4MeEVWEh5vPMkQNHlva1ibOGxhjSCC+GEHBk
         oxCw==
X-Gm-Message-State: AOJu0Ywz7GAHKlA0WPCsHghWpetdST+JLYWHazYWAks5U6aVre2+CZDK
	2CcwUiZxpIWVHgfREvROnyHc+Mrf2bhOkpwD7IgNNARx15YRoPyN2BzPAlB+xd0OKILyqN6eLuo
	=
X-Google-Smtp-Source: AGHT+IHSqO9EmUxZ1rSQzB687recMihfFFcNQxKVoTHsjXEIliTDSRIy+Qlr5f5WrKYU9gOKfh+S8w==
X-Received: by 2002:a05:6512:3f14:b0:52c:dea7:f22c with SMTP id 2adb3069b0e04-52eb9990e9dmr1537397e87.2.1720521913318;
        Tue, 09 Jul 2024 03:45:13 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [XENVIF PATCH 2/3] Fix Registry Isolation issues with Server 2025
Date: Tue,  9 Jul 2024 11:44:59 +0100
Message-ID: <20240709104500.1392-2-owen.smith@cloud.com>
X-Mailer: git-send-email 2.44.0.windows.1
In-Reply-To: <20240709104500.1392-1-owen.smith@cloud.com>
References: <20240709104500.1392-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use MmGetSystemRoutineAddress to dynamically get IoOpenDriverRegistryKey,
which is not present on Server 2016.
Where possible, use IoOpenDriverRegistryKey to avoid opening absolute registry
paths, which is a driver verifier violation on Server 2025 WHQL testing.

This does remove PdoSetFriendlyName and SettingsSave/SettingsRestore
- PdoSetFriendlyName gets an absolute path to the parent of a key opened by an
  allowed API
- SettingsSave/SettingsRestore directly manipulate several absolute paths, but
  due to the recent DeviceID changes, the settings copy code should not be
  neccessary, as the network connection will not be re-created on driver update.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/xenvif/driver.c          | 113 +-----
 src/xenvif/driver.h          |  10 -
 src/xenvif/pdo.c             | 151 +-------
 src/xenvif/registry.c        |  72 +++-
 src/xenvif/registry.h        |   9 +-
 src/xenvif/settings.c        | 694 -----------------------------------
 src/xenvif/settings.h        |  54 ---
 vs2019/xenvif/xenvif.vcxproj |   1 -
 vs2022/xenvif/xenvif.vcxproj |   1 -
 9 files changed, 87 insertions(+), 1018 deletions(-)
 delete mode 100644 src/xenvif/settings.c
 delete mode 100644 src/xenvif/settings.h

diff --git a/src/xenvif/driver.c b/src/xenvif/driver.c
index 3345607..2ac793d 100644
--- a/src/xenvif/driver.c
+++ b/src/xenvif/driver.c
@@ -120,54 +120,6 @@ DriverGetParametersKey(
     return __DriverGetParametersKey();
 }
 
-static FORCEINLINE VOID
-__DriverSetAddressesKey(
-    IN  HANDLE  Key
-    )
-{
-    Driver.AddressesKey = Key;
-}
-
-static FORCEINLINE HANDLE
-__DriverGetAddressesKey(
-    VOID
-    )
-{
-    return Driver.AddressesKey;
-}
-
-HANDLE
-DriverGetAddressesKey(
-    VOID
-    )
-{
-    return __DriverGetAddressesKey();
-}
-
-static FORCEINLINE VOID
-__DriverSetSettingsKey(
-    IN  HANDLE  Key
-    )
-{
-    Driver.SettingsKey = Key;
-}
-
-static FORCEINLINE HANDLE
-__DriverGetSettingsKey(
-    VOID
-    )
-{
-    return Driver.SettingsKey;
-}
-
-HANDLE
-DriverGetSettingsKey(
-    VOID
-    )
-{
-    return __DriverGetSettingsKey();
-}
-
 #define MAXNAMELEN  256
 
 static FORCEINLINE VOID
@@ -265,8 +217,6 @@ DriverUnload(
     IN  PDRIVER_OBJECT  DriverObject
     )
 {
-    HANDLE              SettingsKey;
-    HANDLE              AddressesKey;
     HANDLE              ParametersKey;
 
     ASSERT3P(DriverObject, ==, __DriverGetDriverObject());
@@ -275,16 +225,6 @@ DriverUnload(
 
     Driver.NeedReboot = FALSE;
 
-    SettingsKey = __DriverGetSettingsKey();
-    __DriverSetSettingsKey(NULL);
-
-    RegistryCloseKey(SettingsKey);
-
-    AddressesKey = __DriverGetAddressesKey();
-    __DriverSetAddressesKey(NULL);
-
-    RegistryCloseKey(AddressesKey);
-
     ParametersKey = __DriverGetParametersKey();
     __DriverSetParametersKey(NULL);
 
@@ -401,10 +341,7 @@ DriverEntry(
     IN  PUNICODE_STRING RegistryPath
     )
 {
-    HANDLE              ServiceKey;
     HANDLE              ParametersKey;
-    HANDLE              AddressesKey;
-    HANDLE              SettingsKey;
     ULONG               Index;
     NTSTATUS            status;
 
@@ -428,43 +365,16 @@ DriverEntry(
          MONTH,
          YEAR);
 
-    status = RegistryInitialize(RegistryPath);
+    status = RegistryInitialize(DriverObject, RegistryPath);
     if (!NT_SUCCESS(status))
         goto fail1;
 
-    status = RegistryOpenServiceKey(KEY_ALL_ACCESS, &ServiceKey);
+    status = RegistryOpenParametersKey(KEY_READ, &ParametersKey);
     if (!NT_SUCCESS(status))
         goto fail2;
 
-    status = RegistryOpenSubKey(ServiceKey, 
-                                "Parameters", 
-                                KEY_READ, 
-                                &ParametersKey);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
     __DriverSetParametersKey(ParametersKey);
 
-    status = RegistryCreateSubKey(ServiceKey,
-                                  "Addresses",
-                                  REG_OPTION_VOLATILE,
-                                  &AddressesKey);
-    if (!NT_SUCCESS(status))
-        goto fail4;
-
-    __DriverSetAddressesKey(AddressesKey);
-
-    status = RegistryCreateSubKey(ServiceKey,
-                                  "Settings",
-                                  REG_OPTION_NON_VOLATILE,
-                                  &SettingsKey);
-    if (!NT_SUCCESS(status))
-        goto fail5;
-
-    __DriverSetSettingsKey(SettingsKey);
-
-    RegistryCloseKey(ServiceKey);
-
     DriverObject->DriverExtension->AddDevice = AddDevice;
 
     for (Index = 0; Index <= IRP_MJ_MAXIMUM_FUNCTION; Index++) {
@@ -477,25 +387,6 @@ DriverEntry(
 
     return STATUS_SUCCESS;
 
-fail5:
-    Error("fail5\n");
-
-    __DriverSetAddressesKey(NULL);
-
-    RegistryCloseKey(AddressesKey);
-
-fail4:
-    Error("fail4\n");
-
-    __DriverSetParametersKey(NULL);
-
-    RegistryCloseKey(ParametersKey);
-
-fail3:
-    Error("fail3\n");
-
-    RegistryCloseKey(ServiceKey);
-
 fail2:
     Error("fail2\n");
 
diff --git a/src/xenvif/driver.h b/src/xenvif/driver.h
index b5b9a3d..a9b47d4 100644
--- a/src/xenvif/driver.h
+++ b/src/xenvif/driver.h
@@ -48,16 +48,6 @@ DriverGetParametersKey(
     VOID
     );
 
-extern HANDLE
-DriverGetAddressesKey(
-    VOID
-    );
-
-extern HANDLE
-DriverGetSettingsKey(
-    VOID
-    );
-
 extern VOID
 DriverRequestReboot(
     VOID
diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
index 8ec9814..51cbd97 100644
--- a/src/xenvif/pdo.c
+++ b/src/xenvif/pdo.c
@@ -54,7 +54,6 @@
 #include "registry.h"
 #include "thread.h"
 #include "link.h"
-#include "settings.h"
 #include "dbg_print.h"
 #include "assert.h"
 #include "util.h"
@@ -727,30 +726,16 @@ __PdoSetPermanentAddress(
     IN  PCHAR       Buffer
     )
 {
-    ANSI_STRING     Ansi[2];
     NTSTATUS        status;
 
     status = __PdoParseAddress(Buffer, &Pdo->PermanentAddress);
     if (!NT_SUCCESS(status))
         goto fail1;
 
-    RtlZeroMemory(Ansi, sizeof (ANSI_STRING) * 2);
-    RtlInitAnsiString(&Ansi[0], Buffer);
-
-    status = RegistryUpdateSzValue(DriverGetAddressesKey(),
-                                   __PdoGetName(Pdo),
-                                   REG_SZ,
-                                   Ansi);
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    Info("%s: %Z\n", __PdoGetName(Pdo), &Ansi[0]);
+    Info("%s: %s\n", __PdoGetName(Pdo), Buffer);
 
     return STATUS_SUCCESS;
 
-fail2:
-    Error("fail2\n");
-
 fail1:
     Error("fail1 (%08x)\n", status);
 
@@ -778,68 +763,9 @@ __PdoClearPermanentAddress(
     IN  PXENVIF_PDO Pdo
     )
 {
-    (VOID) RegistryDeleteValue(DriverGetAddressesKey(),
-                               __PdoGetName(Pdo));
-
     RtlZeroMemory(&Pdo->PermanentAddress, sizeof (ETHERNET_ADDRESS));
 }
 
-static NTSTATUS
-PdoSetFriendlyName(
-    IN  PXENVIF_PDO Pdo,
-    IN  HANDLE      SoftwareKey,
-    IN  HANDLE      HardwareKey
-    )
-{
-    PANSI_STRING    DriverDesc;
-    CHAR            Buffer[MAXNAMELEN];
-    ANSI_STRING     Ansi[2];
-    NTSTATUS        status;
-
-    status = RegistryQuerySzValue(SoftwareKey,
-                                  "DriverDesc",
-                                  NULL,
-                                  &DriverDesc);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    status = RtlStringCbPrintfA(Buffer,
-                                MAXNAMELEN,
-                                "%Z #%s",
-                                &DriverDesc[0],
-                                __PdoGetName(Pdo)
-                                );
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    RtlZeroMemory(Ansi, sizeof (ANSI_STRING) * 2);
-    RtlInitAnsiString(&Ansi[0], Buffer);
-
-    status = RegistryUpdateSzValue(HardwareKey,
-                                   "FriendlyName",
-                                   REG_SZ,
-                                   Ansi);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
-    Info("%s: %Z\n", __PdoGetName(Pdo), &Ansi[0]);
-
-    RegistryFreeSzValue(DriverDesc);
-
-    return STATUS_SUCCESS;
-
-fail3:
-    Error("fail3\n");
-
-fail2:
-    Error("fail2\n");
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-}
-
 static FORCEINLINE NTSTATUS
 __PdoSetCurrentAddress(
     IN  PXENVIF_PDO Pdo,
@@ -1276,15 +1202,13 @@ PdoUnplugRequested(
 
 static FORCEINLINE NTSTATUS
 PdoParseMibTable(
-    IN  PXENVIF_PDO     Pdo,
-    IN  HANDLE          SoftwareKey
+    IN  PXENVIF_PDO     Pdo
     )
 {
     NTSTATUS            (*__GetIfTable2)(PMIB_IF_TABLE2 *);
     VOID                (*__FreeMibTable)(PVOID);
     PMIB_IF_TABLE2      Table;
     ULONG               Index;
-    GUID                Guid;
     NTSTATUS            status;
 
     status = LinkGetRoutineAddress("netio.sys",
@@ -1330,56 +1254,10 @@ PdoParseMibTable(
         if (Row->OperStatus != IfOperStatusUp)
             continue;
 
-        (VOID) SettingsSave(__PdoGetName(Pdo),
-                            Row->Alias,
-                            Row->Description,
-                            &Row->InterfaceGuid,
-                            &Row->InterfaceLuid);
-
         status = STATUS_PNP_REBOOT_REQUIRED;
         goto fail4;
     }
 
-    //
-    // If there is a stack bound then restore any settings that
-    // may have been saved from an aliasing device.
-    //
-    status = PdoGetInterfaceGuid(Pdo, SoftwareKey, &Guid);
-    if (NT_SUCCESS(status)) {
-        NET_LUID        Luid;
-        PWCHAR          Alias;
-        PWCHAR          Description;
-
-        RtlZeroMemory(&Luid, sizeof(NET_LUID));
-        Alias = NULL;
-        Description = NULL;
-
-        status = PdoGetInterfaceLuid(Pdo, SoftwareKey, &Luid);
-        if (NT_SUCCESS(status)) {
-            for (Index = 0; Index < Table->NumEntries; Index++) {
-                PMIB_IF_ROW2    Row = &Table->Table[Index];
-
-                Trace("%s: CHECKING %ws (%ws)\n",
-                    __PdoGetName(Pdo),
-                    Row->Alias,
-                    Row->Description);
-
-                if (Row->InterfaceLuid.Value != Luid.Value)
-                    continue;
-
-                Alias = Row->Alias;
-                Description = Row->Description;
-                break;
-            }
-        }
-
-        (VOID) SettingsRestore(__PdoGetName(Pdo),
-                               Alias,
-                               Description,
-                               &Guid,
-                               &Luid);
-    }
-
     __FreeMibTable(Table);
 
     return STATUS_SUCCESS;
@@ -1408,7 +1286,6 @@ PdoStartDevice(
     )
 {
     HANDLE              SoftwareKey;
-    HANDLE              HardwareKey;
     NTSTATUS            status;
 
     status = STATUS_UNSUCCESSFUL;
@@ -1421,21 +1298,11 @@ PdoStartDevice(
     if (!NT_SUCCESS(status))
         goto fail2;
 
-    status = RegistryOpenHardwareKey(__PdoGetDeviceObject(Pdo),
-                                     KEY_ALL_ACCESS,
-                                     &HardwareKey);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
-    (VOID) PdoSetFriendlyName(Pdo,
-                              SoftwareKey,
-                              HardwareKey);
-
     status = __PdoSetCurrentAddress(Pdo, SoftwareKey);
     if (!NT_SUCCESS(status))
-        goto fail4;
+        goto fail3;
 
-    status = PdoParseMibTable(Pdo, SoftwareKey);
+    status = PdoParseMibTable(Pdo);
     if (status == STATUS_PNP_REBOOT_REQUIRED || !PdoUnplugRequested(Pdo)) {
         PdoUnplugRequest(Pdo, TRUE); // fix unplug reference count
         DriverRequestReboot();
@@ -1445,7 +1312,7 @@ PdoStartDevice(
 
     status = PdoD3ToD0(Pdo);
     if (!NT_SUCCESS(status))
-        goto fail5;
+        goto fail4;
 
     PdoUnplugRequest(Pdo, TRUE);
 
@@ -1454,20 +1321,14 @@ PdoStartDevice(
     Irp->IoStatus.Status = STATUS_SUCCESS;
     IoCompleteRequest(Irp, IO_NO_INCREMENT);
 
-    RegistryCloseKey(HardwareKey);
     RegistryCloseKey(SoftwareKey);
 
     return STATUS_SUCCESS;
 
-fail5:
-    Error("fail5\n");
-
-    RtlZeroMemory(&Pdo->CurrentAddress, sizeof (ETHERNET_ADDRESS));
-
 fail4:
     Error("fail4\n");
 
-    RegistryCloseKey(HardwareKey);
+    RtlZeroMemory(&Pdo->CurrentAddress, sizeof (ETHERNET_ADDRESS));
 
 fail3:
     Error("fail3\n");
diff --git a/src/xenvif/registry.c b/src/xenvif/registry.c
index 8f84818..792ce03 100644
--- a/src/xenvif/registry.c
+++ b/src/xenvif/registry.c
@@ -38,8 +38,13 @@
 
 #define REGISTRY_TAG 'GERX'
 
+static PDRIVER_OBJECT   RegistryDriverObject;
 static UNICODE_STRING   RegistryPath;
 
+typedef NTSTATUS(*IOOPENDRIVERREGISTRYKEY)(PDRIVER_OBJECT, DRIVER_REGKEY_TYPE, ACCESS_MASK, ULONG, PHANDLE);
+
+static IOOPENDRIVERREGISTRYKEY __IoOpenDriverRegistryKey;
+
 static FORCEINLINE PVOID
 __RegistryAllocate(
     IN  ULONG   Length
@@ -58,9 +63,12 @@ __RegistryFree(
 
 NTSTATUS
 RegistryInitialize(
-    IN PUNICODE_STRING  Path
+    IN  PDRIVER_OBJECT  DriverObject,
+    IN  PUNICODE_STRING Path
     )
 {
+    UNICODE_STRING      Unicode;
+    PVOID               Func;
     NTSTATUS            status;
 
     ASSERT3P(RegistryPath.Buffer, ==, NULL);
@@ -69,6 +77,16 @@ RegistryInitialize(
     if (!NT_SUCCESS(status))
         goto fail1;
 
+    ASSERT3P(RegistryDriverObject, ==, NULL);
+    RegistryDriverObject = DriverObject;
+
+    ASSERT3P(__IoOpenDriverRegistryKey, ==, NULL);
+    RtlInitUnicodeString(&Unicode, L"IoOpenDriverRegistryKey");
+
+    Func = MmGetSystemRoutineAddress(&Unicode);
+    if (Func != NULL)
+        __IoOpenDriverRegistryKey = (IOOPENDRIVERREGISTRYKEY)Func;
+
     return STATUS_SUCCESS;
 
 fail1:
@@ -82,6 +100,10 @@ RegistryTeardown(
     VOID
     )
 {
+    __IoOpenDriverRegistryKey = NULL;
+
+    RegistryDriverObject = NULL;
+
     RtlFreeUnicodeString(&RegistryPath);
     RegistryPath.Buffer = NULL;
     RegistryPath.MaximumLength = RegistryPath.Length = 0;
@@ -266,6 +288,54 @@ RegistryCreateServiceKey(
     return RegistryCreateKey(NULL, &RegistryPath, REG_OPTION_NON_VOLATILE, Key);
 }
 
+NTSTATUS
+RegistryOpenParametersKey(
+    IN  ACCESS_MASK     DesiredAccess,
+    OUT PHANDLE         Key
+    )
+{
+    HANDLE              ServiceKey;
+    NTSTATUS            status;
+
+    if (__IoOpenDriverRegistryKey != NULL) {
+        status = __IoOpenDriverRegistryKey(RegistryDriverObject,
+                                           DriverRegKeyParameters,
+                                           DesiredAccess,
+                                           0,
+                                           Key);
+        if (!NT_SUCCESS(status))
+            goto fail1;
+
+        goto done;
+    }
+
+    status = RegistryOpenKey(NULL, &RegistryPath, DesiredAccess, &ServiceKey);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    status = RegistryOpenSubKey(ServiceKey, "Parameters", DesiredAccess, Key);
+    if (!NT_SUCCESS(status))
+        goto fail3;
+
+    RegistryCloseKey(ServiceKey);
+
+done:
+    return STATUS_SUCCESS;
+
+fail3:
+    Error("fail3\n");
+
+    RegistryCloseKey(ServiceKey);
+
+fail2:
+    Error("fail2\n");
+
+fail1:
+    Error("fail1 %08x\n", status);
+
+    return status;
+}
+
 NTSTATUS
 RegistryOpenSoftwareKey(
     IN  PDEVICE_OBJECT  DeviceObject,
diff --git a/src/xenvif/registry.h b/src/xenvif/registry.h
index c656806..60c50e8 100644
--- a/src/xenvif/registry.h
+++ b/src/xenvif/registry.h
@@ -37,7 +37,8 @@
 
 extern NTSTATUS
 RegistryInitialize(
-    IN PUNICODE_STRING  Path
+    IN  PDRIVER_OBJECT  DriverObject,
+    IN  PUNICODE_STRING Path
     );
 
 extern VOID
@@ -72,6 +73,12 @@ RegistryCreateServiceKey(
     OUT PHANDLE     Key
     );
 
+extern NTSTATUS
+RegistryOpenParametersKey(
+    IN  ACCESS_MASK     DesiredAccess,
+    OUT PHANDLE         Key
+    );
+
 extern NTSTATUS
 RegistryOpenSoftwareKey(
     IN  PDEVICE_OBJECT  DeviceObject,
diff --git a/src/xenvif/settings.c b/src/xenvif/settings.c
deleted file mode 100644
index 4dd4ec4..0000000
--- a/src/xenvif/settings.c
+++ /dev/null
@@ -1,694 +0,0 @@
-/* Copyright (c) Xen Project.
- * Copyright (c) Cloud Software Group, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms,
- * with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * *   Redistributions of source code must retain the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer.
- * *   Redistributions in binary form must reproduce the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer in the documentation and/or other
- *     materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <ntddk.h>
-#include <ntstrsafe.h>
-
-#include "registry.h"
-#include "driver.h"
-#include "dbg_print.h"
-#include "assert.h"
-#include "util.h"
-
-#define SETTINGS_TAG 'TTES'
-
-#define INTERFACES_PATH(_Name)      \
-    "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services\\" ## #_Name ## "\\Parameters\\Interfaces\\"
-
-#define IPV6_PATH   \
-    "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Nsi\\{eb004a01-9b1a-11d4-9123-0050047759bc}\\10"
-
-#define IPV4_PATH   \
-    "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Nsi\\{eb004a00-9b1a-11d4-9123-0050047759bc}\\10"
-
-#define NETLUID_STRING_LENGTH 16
-
-typedef struct _SETTINGS_COPY_IP_ADDRESS_PARAMETERS {
-    CHAR        SrcPrefix[NETLUID_STRING_LENGTH + 1];
-    CHAR        DstPrefix[NETLUID_STRING_LENGTH + 1];
-} SETTINGS_COPY_IP_ADDRESS_PARAMETERS, *PSETTINGS_COPY_IP_ADDRESS_PARAMETERS;
-
-static FORCEINLINE PVOID
-__SettingsAllocate(
-    IN  ULONG   Length
-    )
-{
-    return __AllocatePoolWithTag(NonPagedPool, Length, SETTINGS_TAG);
-}
-
-static FORCEINLINE VOID
-__SettingsFree(
-    IN  PVOID   Buffer
-    )
-{
-    __FreePoolWithTag(Buffer, SETTINGS_TAG);
-}
-
-static FORCEINLINE NTSTATUS
-__GuidToString(
-    IN  LPGUID          Guid,
-    OUT PANSI_STRING    Ansi
-    )
-{
-    NTSTATUS            status;
-    UNICODE_STRING      Unicode;
-
-    status = RtlStringFromGUID(Guid, &Unicode);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    status = RtlUnicodeStringToAnsiString(Ansi, &Unicode, TRUE);
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    RtlFreeUnicodeString(&Unicode);
-
-    return STATUS_SUCCESS;
-
-fail2:
-    Error("fail2\n");
-
-    RtlFreeUnicodeString(&Unicode);
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-}
-
-static NTSTATUS
-SettingsCopyIpAddressesValue(
-    IN  PVOID                               Context,
-    IN  HANDLE                              Key,
-    IN  PANSI_STRING                        ValueName,
-    IN  ULONG                               Type
-    )
-{
-    PSETTINGS_COPY_IP_ADDRESS_PARAMETERS    Parameters = Context;
-    PVOID                                   Value;
-    ULONG                                   ValueLength;
-    NTSTATUS                                status;
-
-    UNREFERENCED_PARAMETER(Type);
-
-    if (_strnicmp(ValueName->Buffer,
-                  Parameters->SrcPrefix,
-                  NETLUID_STRING_LENGTH) != 0)
-        goto done;
-
-    Trace("    -> %Z\n", ValueName);
-
-    status = RegistryQueryBinaryValue(Key,
-                                      ValueName->Buffer,
-                                      &Value,
-                                      &ValueLength);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    status = RegistryDeleteValue(Key,
-                                 ValueName->Buffer);
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    ASSERT(NETLUID_STRING_LENGTH < ValueName->Length);
-    memcpy(ValueName->Buffer, Parameters->DstPrefix, NETLUID_STRING_LENGTH);
-
-    Trace("    <- %Z\n", ValueName);
-
-    status = RegistryUpdateBinaryValue(Key,
-                                       ValueName->Buffer,
-                                       Value,
-                                       ValueLength);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
-    if (ValueLength != 0)
-        RegistryFreeBinaryValue(Value);
-
-done:
-    return STATUS_SUCCESS;
-
-fail3:
-    Error("fail3\n");
-
-fail2:
-    Error("fail2\n");
-
-    if (ValueLength != 0)
-        RegistryFreeBinaryValue(Value);
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-}
-
-static NTSTATUS
-SettingsCopyIpAddresses(
-    IN  ULONG                           Version,
-    IN  PNET_LUID                       OldLuid,
-    IN  PNET_LUID                       NewLuid
-    )
-{
-    SETTINGS_COPY_IP_ADDRESS_PARAMETERS Parameters;
-    HANDLE                              Key;
-    NTSTATUS                            status;
-
-    status = RtlStringCbPrintfA(Parameters.SrcPrefix,
-                                sizeof(Parameters.SrcPrefix),
-                                "%016llx",
-                                _byteswap_uint64(OldLuid->Value));
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    status = RtlStringCbPrintfA(Parameters.DstPrefix,
-                                sizeof(Parameters.DstPrefix),
-                                "%016llx",
-                                _byteswap_uint64(NewLuid->Value));
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    status = RegistryOpenSubKey(NULL,
-                                (Version == 4) ? IPV4_PATH : IPV6_PATH,
-                                KEY_ALL_ACCESS,
-                                &Key);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
-    Info("IPv%u: %s -> %s\n",
-         Version,
-         Parameters.SrcPrefix,
-         Parameters.DstPrefix);
-
-    status = RegistryEnumerateValues(Key,
-                                     SettingsCopyIpAddressesValue,
-                                     &Parameters);
-    if (!NT_SUCCESS(status))
-        goto fail4;
-
-    RegistryCloseKey(Key);
-
-    return STATUS_SUCCESS;
-
-fail4:
-    Error("fail4\n");
-
-    RegistryCloseKey(Key);
-
-fail3:
-    Error("fail3\n");
-
-fail2:
-    Error("fail2\n");
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-}
-
-static NTSTATUS
-SettingsCopyInterfaceValue(
-    IN  PVOID            Context,
-    IN  HANDLE           SourceKey,
-    IN  PANSI_STRING     ValueName,
-    IN  ULONG            Type
-    )
-{
-    HANDLE               DestinationKey = Context;
-    NTSTATUS             status;
-
-    Trace(" - %Z\n", ValueName);
-
-    switch (Type) {
-    case REG_DWORD: {
-        ULONG   Value;
-
-        status = RegistryQueryDwordValue(SourceKey,
-                                         ValueName->Buffer,
-                                         &Value);
-        if (NT_SUCCESS(status))
-            (VOID) RegistryUpdateDwordValue(DestinationKey,
-                                            ValueName->Buffer,
-                                            Value);
-
-        break;
-    }
-    case REG_SZ:
-    case REG_MULTI_SZ: {
-        PANSI_STRING    Value;
-
-        status = RegistryQuerySzValue(SourceKey,
-                                      ValueName->Buffer,
-                                      NULL,
-                                      &Value);
-        if (NT_SUCCESS(status)) {
-            (VOID) RegistryUpdateSzValue(DestinationKey,
-                                         ValueName->Buffer,
-                                         Type,
-                                         Value);
-            RegistryFreeSzValue(Value);
-        }
-
-        break;
-    }
-    case REG_BINARY: {
-        PVOID   Value;
-        ULONG   Length;
-
-        status = RegistryQueryBinaryValue(SourceKey,
-                                          ValueName->Buffer,
-                                          &Value,
-                                          &Length);
-        if (NT_SUCCESS(status)) {
-            (VOID) RegistryUpdateBinaryValue(DestinationKey,
-                                             ValueName->Buffer,
-                                             Value,
-                                             Length);
-            if (Length != 0)
-                RegistryFreeBinaryValue(Value);
-        }
-
-        break;
-    }
-    default:
-        ASSERT(FALSE);
-    }
-
-    return STATUS_SUCCESS;
-}
-
-static NTSTATUS
-SettingsCopyInterface(
-    IN  PCHAR           InterfacePath,
-    IN  PCHAR           InterfacePrefix,
-    IN  PANSI_STRING    OldGuid,
-    IN  PANSI_STRING    NewGuid
-    )
-{
-    HANDLE              OldKey;
-    HANDLE              NewKey;
-    PCHAR               OldKeyName;
-    PCHAR               NewKeyName;
-    ULONG               OldKeyLength;
-    ULONG               NewKeyLength;
-    NTSTATUS            status;
-
-    OldKeyLength = (ULONG)(strlen(InterfacePath) +
-                           strlen(InterfacePrefix) +
-                           OldGuid->Length +
-                           1) * sizeof(CHAR);
-    NewKeyLength = (ULONG)(strlen(InterfacePath) +
-                           strlen(InterfacePrefix) +
-                           NewGuid->Length +
-                           1) * sizeof(CHAR);
-
-    status = STATUS_NO_MEMORY;
-    OldKeyName = __SettingsAllocate(OldKeyLength);
-    if (OldKeyName == NULL)
-        goto fail1;
-
-    NewKeyName = __SettingsAllocate(NewKeyLength);
-    if (NewKeyName == NULL)
-        goto fail2;
-
-    status = RtlStringCbPrintfA(OldKeyName,
-                                OldKeyLength,
-                                "%s%s%Z",
-                                InterfacePath,
-                                InterfacePrefix,
-                                OldGuid);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
-    status = RtlStringCbPrintfA(NewKeyName,
-                                NewKeyLength,
-                                "%s%s%Z",
-                                InterfacePath,
-                                InterfacePrefix,
-                                NewGuid);
-    if (!NT_SUCCESS(status))
-        goto fail4;
-
-    status = RegistryOpenSubKey(NULL,
-                                OldKeyName,
-                                KEY_READ,
-                                &OldKey);
-    if (!NT_SUCCESS(status))
-        goto fail5;
-
-    status = RegistryCreateSubKey(NULL,
-                                  NewKeyName,
-                                  REG_OPTION_NON_VOLATILE,
-                                  &NewKey);
-    if (!NT_SUCCESS(status))
-        goto fail6;
-
-    status = RegistryEnumerateValues(OldKey,
-                                     SettingsCopyInterfaceValue,
-                                     NewKey);
-    if (!NT_SUCCESS(status))
-        goto fail7;
-
-    RegistryCloseKey(NewKey);
-    RegistryCloseKey(OldKey);
-    __SettingsFree(NewKeyName);
-    __SettingsFree(OldKeyName);
-
-    return STATUS_SUCCESS;
-
-fail7:
-    Error("fail7\n");
-
-    RegistryCloseKey(NewKey);
-
-fail6:
-    Error("fail6\n");
-
-    RegistryCloseKey(OldKey);
-
-fail5:
-    Error("fail5\n");
-
-fail4:
-    Error("fail4\n");
-
-fail3:
-    Error("fail3\n");
-
-    __SettingsFree(NewKeyName);
-
-fail2:
-    Error("fail2\n");
-
-    __SettingsFree(OldKeyName);
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-}
-
-static NTSTATUS
-SettingsStoreCurrent(
-    IN  HANDLE          SubKey,
-    IN  PANSI_STRING    Guid,
-    IN  PNET_LUID       Luid
-    )
-{
-
-    NTSTATUS            status;
-
-    status = RegistryUpdateSzValue(SubKey,
-                                   "NetCfgInstanceId",
-                                   REG_SZ,
-                                   Guid);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    status = RegistryUpdateBinaryValue(SubKey,
-                                       "NetLuid",
-                                       Luid,
-                                       sizeof(NET_LUID));
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    (VOID) RegistryDeleteValue(SubKey,
-                               "HasSettings");
-
-    return STATUS_SUCCESS;
-
-fail2:
-    Error("fail2\n");
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-}
-
-static NTSTATUS
-SettingsCopy(
-    IN  PCHAR           SubKeyName,
-    IN  PANSI_STRING    OldGuid,
-    IN  PNET_LUID       OldLuid,
-    IN  PANSI_STRING    NewGuid,
-    IN  PNET_LUID       NewLuid
-     )
-{
-    HANDLE              SettingsKey;
-    HANDLE              SubKey;
-    NTSTATUS            status;
-
-    Trace("====>\n");
-    Info("VIF/%s: FROM %Z\n", SubKeyName, OldGuid);
-    Info("VIF/%s: TO   %Z\n", SubKeyName, NewGuid);
-
-    (VOID) SettingsCopyInterface(INTERFACES_PATH(NetBT),
-                                 "Tcpip_",
-                                 OldGuid,
-                                 NewGuid);
-
-    (VOID) SettingsCopyInterface(INTERFACES_PATH(Tcpip),
-                                 "",
-                                 OldGuid,
-                                 NewGuid);
-
-    (VOID) SettingsCopyInterface(INTERFACES_PATH(Tcpip6),
-                                 "",
-                                 OldGuid,
-                                 NewGuid);
-
-    (VOID) SettingsCopyIpAddresses(4,
-                                   OldLuid,
-                                   NewLuid);
-
-    (VOID) SettingsCopyIpAddresses(6,
-                                   OldLuid,
-                                   NewLuid);
-
-    SettingsKey = DriverGetSettingsKey();
-
-    status = RegistryCreateSubKey(SettingsKey,
-                                  SubKeyName,
-                                  REG_OPTION_NON_VOLATILE,
-                                  &SubKey);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    status = SettingsStoreCurrent(SubKey,
-                                  NewGuid,
-                                  NewLuid);
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    RegistryCloseKey(SubKey);
-
-    Trace("<====\n");
-
-    return STATUS_SUCCESS;
-
-fail2:
-    Error("fail2\n");
-
-    RegistryCloseKey(SubKey);
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-}
-
-NTSTATUS
-SettingsSave(
-    IN  PCHAR       SubKeyName,
-    IN  PWCHAR      Alias,
-    IN  PWCHAR      Description,
-    IN  LPGUID      InterfaceGuid,
-    IN  PNET_LUID   InterfaceLuid
-    )
-{
-    HANDLE          SettingsKey;
-    HANDLE          SubKey;
-    ANSI_STRING     Ansi;
-    ULONG           HasSettings;
-    NTSTATUS        status;
-
-    Info("FROM %ws (%ws)\n", Alias, Description);
-
-    status = __GuidToString(InterfaceGuid, &Ansi);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    SettingsKey = DriverGetSettingsKey();
-
-    status = RegistryCreateSubKey(SettingsKey,
-                                  SubKeyName,
-                                  REG_OPTION_NON_VOLATILE,
-                                  &SubKey);
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    HasSettings = 0;
-    status = RegistryQueryDwordValue(SubKey,
-                                     "HasSettings",
-                                     &HasSettings);
-    if (!NT_SUCCESS(status))
-        HasSettings = 0;
-    if (HasSettings != 0)
-        goto done;
-
-    Info("FROM %Z\n", Ansi);
-    Info("FROM %016llx\n", InterfaceLuid->Value);
-
-    status = SettingsStoreCurrent(SubKey,
-                                  &Ansi,
-                                  InterfaceLuid);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
-    RtlFreeAnsiString(&Ansi);
-
-done:
-    RegistryCloseKey(SubKey);
-
-    return STATUS_SUCCESS;
-
-fail3:
-    Error("fail3\n");
-
-    RegistryCloseKey(SubKey);
-
-fail2:
-    Error("fail2\n");
-
-    RtlFreeAnsiString(&Ansi);
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-}
-
-NTSTATUS
-SettingsRestore(
-    IN  PCHAR       SubKeyName,
-    IN  PWCHAR      Alias,
-    IN  PWCHAR      Description,
-    IN  LPGUID      InterfaceGuid,
-    IN  PNET_LUID   InterfaceLuid
-    )
-{
-    HANDLE          SettingsKey;
-    HANDLE          SubKey;
-    ANSI_STRING     Ansi;
-    PANSI_STRING    NetCfgInstanceId;
-    PNET_LUID       NetLuid;
-    ULONG           NetLuidLength;
-    NTSTATUS        status;
-
-    SettingsKey = DriverGetSettingsKey();
-
-    status = RegistryOpenSubKey(SettingsKey,
-                                SubKeyName,
-                                KEY_READ,
-                                &SubKey);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    status = RegistryQuerySzValue(SubKey,
-                                  "NetCfgInstanceId",
-                                  NULL,
-                                  &NetCfgInstanceId);
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    NetLuidLength = 0;
-    status = RegistryQueryBinaryValue(SubKey,
-                                      "NetLuid",
-                                      &NetLuid,
-                                      &NetLuidLength);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
-    status = __GuidToString(InterfaceGuid, &Ansi);
-    if (!NT_SUCCESS(status))
-        goto fail4;
-
-    if (RtlCompareString(NetCfgInstanceId, &Ansi, TRUE) != 0) {
-        Info("TO %ws (%ws)\n", Alias, Description);
-        Info("TO %Z\n", Ansi);
-        Info("TO %016llx\n", InterfaceLuid->Value);
-
-        SettingsCopy(SubKeyName,
-                     NetCfgInstanceId,
-                     NetLuid,
-                     &Ansi,
-                     InterfaceLuid);
-    } else {
-        Info("%s: SettingsCopy not required for %ws\n",
-             SubKeyName,
-             Description);
-    }
-
-    RtlFreeAnsiString(&Ansi);
-
-    if (NetLuidLength != 0)
-        RegistryFreeBinaryValue(NetLuid);
-
-    RegistryFreeSzValue(NetCfgInstanceId);
-
-    RegistryCloseKey(SubKey);
-
-    return STATUS_SUCCESS;
-
-fail4:
-    Error("fail4\n");
-
-    if (NetLuidLength != 0)
-        RegistryFreeBinaryValue(NetLuid);
-
-fail3:
-    Error("fail3\n");
-
-    RegistryFreeSzValue(NetCfgInstanceId);
-
-fail2:
-    Error("fail2\n");
-
-    RegistryCloseKey(SubKey);
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-}
diff --git a/src/xenvif/settings.h b/src/xenvif/settings.h
deleted file mode 100644
index 3f964bb..0000000
--- a/src/xenvif/settings.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (c) Xen Project.
- * Copyright (c) Cloud Software Group, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms,
- * with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * *   Redistributions of source code must retain the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer.
- * *   Redistributions in binary form must reproduce the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer in the documentation and/or other
- *     materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _XENVIF_SETTINGS_H
-#define _XENVIF_SETTINGS_H
-
-extern NTSTATUS
-SettingsSave(
-    IN  PCHAR       SubKeyName,
-    IN  PWCHAR      Alias,
-    IN  PWCHAR      Description,
-    IN  LPGUID      InterfaceGuid,
-    IN  PNET_LUID   InterfaceLuid
-    );
-
-extern NTSTATUS
-SettingsRestore(
-    IN  PCHAR       SubKeyName,
-    IN  PWCHAR      Alias,
-    IN  PWCHAR      Description,
-    IN  LPGUID      InterfaceGuid,
-    IN  PNET_LUID   InterfaceLuid
-    );
-
-#endif  // _XENVIF_SETTINGS_H
diff --git a/vs2019/xenvif/xenvif.vcxproj b/vs2019/xenvif/xenvif.vcxproj
index 0412426..3e48cf7 100644
--- a/vs2019/xenvif/xenvif.vcxproj
+++ b/vs2019/xenvif/xenvif.vcxproj
@@ -82,7 +82,6 @@
     <ClCompile Include="../../src/xenvif/pdo.c" />
     <ClCompile Include="../../src/xenvif/receiver.c" />
     <ClCompile Include="../../src/xenvif/registry.c" />
-    <ClCompile Include="../../src/xenvif/settings.c" />
     <ClCompile Include="../../src/xenvif/thread.c" />
     <ClCompile Include="../../src/xenvif/transmitter.c" />
     <ClCompile Include="../../src/xenvif/controller.c" />
diff --git a/vs2022/xenvif/xenvif.vcxproj b/vs2022/xenvif/xenvif.vcxproj
index be84232..af9fe96 100644
--- a/vs2022/xenvif/xenvif.vcxproj
+++ b/vs2022/xenvif/xenvif.vcxproj
@@ -74,7 +74,6 @@
     <ClCompile Include="../../src/xenvif/pdo.c" />
     <ClCompile Include="../../src/xenvif/receiver.c" />
     <ClCompile Include="../../src/xenvif/registry.c" />
-    <ClCompile Include="../../src/xenvif/settings.c" />
     <ClCompile Include="../../src/xenvif/thread.c" />
     <ClCompile Include="../../src/xenvif/transmitter.c" />
     <ClCompile Include="../../src/xenvif/controller.c" />
-- 
2.44.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Jul 09 10:48:26 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 09 Jul 2024 10:48:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.756151.1164684 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8OX-00033X-UD; Tue, 09 Jul 2024 10:48:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 756151.1164684; Tue, 09 Jul 2024 10:48:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8OX-00033Q-RO; Tue, 09 Jul 2024 10:48:25 +0000
Received: by outflank-mailman (input) for mailman id 756151;
 Tue, 09 Jul 2024 10:48:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KswS=OJ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sR8OW-00032s-Ii
 for win-pv-devel@lists.xenproject.org; Tue, 09 Jul 2024 10:48:24 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c3abbfe0-3de0-11ef-bbfb-fd08da9f4363;
 Tue, 09 Jul 2024 12:48:23 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-58bac81f3f9so6425092a12.2
 for <win-pv-devel@lists.xenproject.org>; Tue, 09 Jul 2024 03:48:23 -0700 (PDT)
Received: from localhost.localdomain
 (host109-158-229-15.range109-158.btcentralplus.com. [109.158.229.15])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-594bda30a30sm926625a12.82.2024.07.09.03.48.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 09 Jul 2024 03:48:22 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c3abbfe0-3de0-11ef-bbfb-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720522103; x=1721126903; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=ZQZ1+AUQjMzvMT1DHipDhAldU7U/ENbqQMLUqq5ucXU=;
        b=GwRzjZyzvtMoX1c6bIYk4D7nbj+viTr7pZIDuQ8TmDOaY6FaV3lLC4/hQQQ7sf2pB6
         TX6r6D9Gnz2RtoOkjUyeC4hDsvP6JStxpIdQbgVMfDJ66b1PvvcJYQUYcgKPFYs1h7sw
         j0RhoL5qsM8sOjD05K07dhDHgAuAw5d1euoZk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720522103; x=1721126903;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=ZQZ1+AUQjMzvMT1DHipDhAldU7U/ENbqQMLUqq5ucXU=;
        b=HCdieQv+N84lvWbCsHiVGS32qZBiPQ2LXcMvv7nEAYsrTis4LjVq513q4Jqv5D0VTD
         IgrITFsusUyMh7/ZEOOPOD8aD3VcsZqCswqEgifsS9tgLuK1Z5+xmnKcYNs81OBC2AG/
         7X8HqHtUbzUFP9Rqm11kjs8KGWMZ5D3q9LNJ59OcCBIEne6CjBFNyOVjB3BGgINbWtdm
         xY68Ie9y1KMDM9/5LQ8dTo5ga1J7O/o6xcOuP7eelV/QmA9aA3KTBY6yFovOoRUNbKx+
         j+HFYJXT9fESh8smT8u+eEDt7JHdrTuD4aLvIYuqJAEREelsz/dbz1fH4eDmTgjrzKpJ
         NSyA==
X-Gm-Message-State: AOJu0Yw98r0V+orLv9rQSiWZAsbsItY0N/KgkP31KY9Oc8kHmuYUBriC
	jytpnWa2VcMclE3k+qoESSn9HhulUWat83v+EeekKoXpQyki/b/fDWJwHskZWnqMFiWnmjJabkE
	=
X-Google-Smtp-Source: AGHT+IGxyAu35Igx6ttR4i6UvqHFKscbg2MQ8qgCrrWILKAWlaZzBFCReANUWyGkUUZ+5VkiWEt7nA==
X-Received: by 2002:a05:6402:5208:b0:58c:909f:3d52 with SMTP id 4fb4d7f45d1cf-594b9a10437mr1799562a12.6.1720522103001;
        Tue, 09 Jul 2024 03:48:23 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [XENNET PATCH 2/2] Bump binding to 0x09000005
Date: Tue,  9 Jul 2024 11:48:11 +0100
Message-ID: <20240709104811.987-2-owen.smith@cloud.com>
X-Mailer: git-send-email 2.44.0.windows.1
In-Reply-To: <20240709104811.987-1-owen.smith@cloud.com>
References: <20240709104811.987-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Require UNPLUGv3 be present, so that Windows Update will only attempt
to install this driver on a xenvif that does not return an error code
from PdoStartDevice during normal operation.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/xennet.inf | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/xennet.inf b/src/xennet.inf
index dcf3e04..4923388 100644
--- a/src/xennet.inf
+++ b/src/xennet.inf
@@ -58,9 +58,9 @@ xennet.sys
 ; DisplayName		Section		DeviceID
 ; -----------		-------		--------
 
-%XenNetName%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_09000004
-%XenNetName%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_09000004
-%XenNetName%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_09000004
+%XenNetName%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_09000005
+%XenNetName%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_09000005
+%XenNetName%		=XenNet_Inst,	XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_09000005
 
 [XenNet_Inst] 
 Characteristics=0x84
-- 
2.44.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Jul 09 10:48:27 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 09 Jul 2024 10:48:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.756152.1164687 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8OY-00035G-VP; Tue, 09 Jul 2024 10:48:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 756152.1164687; Tue, 09 Jul 2024 10:48:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sR8OY-000359-Sh; Tue, 09 Jul 2024 10:48:26 +0000
Received: by outflank-mailman (input) for mailman id 756152;
 Tue, 09 Jul 2024 10:48:25 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KswS=OJ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sR8OX-00033H-90
 for win-pv-devel@lists.xenproject.org; Tue, 09 Jul 2024 10:48:25 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c364235f-3de0-11ef-8776-851b0ebba9a2;
 Tue, 09 Jul 2024 12:48:23 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-58d24201934so7828119a12.0
 for <win-pv-devel@lists.xenproject.org>; Tue, 09 Jul 2024 03:48:23 -0700 (PDT)
Received: from localhost.localdomain
 (host109-158-229-15.range109-158.btcentralplus.com. [109.158.229.15])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-594bda30a30sm926625a12.82.2024.07.09.03.48.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 09 Jul 2024 03:48:22 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c364235f-3de0-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1720522102; x=1721126902; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=B7F9OKOwqXbZbuzjANzGhu1v2+bFMPiA7qBKAlj+hOY=;
        b=X5jlxBTwKndEif1lW0BDbYH/9FhsL8fiM4jGYqLW5COCmTOw20h5MhX7HNCqylTbRN
         /Hv7juey/+gP41FL0hVhxIlmTk3RWtGRSTFnPxO4IG/2kJ61TWUahrPQpzbpoQsLoWug
         cwPhhLW13G++bZjnpmo84sLB2J+ciAUMExgF8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1720522102; x=1721126902;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=B7F9OKOwqXbZbuzjANzGhu1v2+bFMPiA7qBKAlj+hOY=;
        b=vXs+CSeCWhsnRTVFJIDTyg9Z3SPP4hyghNCmExDsbKLdH+JcRJBUWzoKsEQJ7x2dSt
         vsACBuPJl9aXLIWx/imTbXR5R3TyyyOgY3BG2L6rT6VWo/DuRwWVZuKhbzjZ2ObsOFJe
         1KTu0qXUhuwoF2b5aHnAALxHh63bPkxM5XLIhiDbjNEA2eyIzGKkjK7PiGwOJjJbk0B5
         WhtKjaRu2hiK+rrJUS3XDC2qylzMV3ORdxKyhtatO1LKevp3X2usdHtUyLd3zpuTxN/U
         9mk5DnhlRfmL4CkutFxUoMnOXeyMjtgZpGBf4BkmtVQMUb+0zrB0kmUHt7sKI5KtwvCS
         ntWQ==
X-Gm-Message-State: AOJu0YxHI34Y24NjQRvJVxxsVDnV3je4xaJKl+JtQ0CRFBhzohB6ZEbP
	L1s7qYqw2EyKZEnQgDRAl3eIUSaZhuWoyB+EAwfHvENk5wWSPAaJRQNe9EA0dMN1LMBtDA5TebU
	=
X-Google-Smtp-Source: AGHT+IF1oe+nKtpw6JatqBX3PMvHVziluPZlrTLIXKIbPEIBAaTWlgPBD+s4euPdXtnVuknqhpdmCw==
X-Received: by 2002:a05:6402:40ca:b0:57c:603a:6b2b with SMTP id 4fb4d7f45d1cf-594ddc2107fmr1234920a12.21.1720522102393;
        Tue, 09 Jul 2024 03:48:22 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [XENNET PATCH 1/2] Report NDIS minor version as expected by OS
Date: Tue,  9 Jul 2024 11:48:10 +0100
Message-ID: <20240709104811.987-1-owen.smith@cloud.com>
X-Mailer: git-send-email 2.44.0.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

WHQL requires NDIS minor versions to match the OS under test.
For Server 2022, this requires NDIS version 6.85 and Server 2025 requires
NDIS version 6.89.
In order to build with EWDK 22000, the reported version is echoed from the
call to NdisGetVersion() without requiring updated headers.

Note: NDIS 6.89 does add support for UDP Receive Segment Coalescing Offload
(URO), but XenNet does not support this new NDIS feature.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/xennet/miniport.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/xennet/miniport.c b/src/xennet/miniport.c
index 5dc9858..10717fa 100644
--- a/src/xennet/miniport.c
+++ b/src/xennet/miniport.c
@@ -348,16 +348,16 @@ MiniportRegister(
         MiniportDriverCharacteristics.Header.Size = NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3;
         MiniportDriverCharacteristics.Header.Revision = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3;
 
-        MiniportDriverCharacteristics.MajorNdisVersion = NDIS_MINIPORT_MAJOR_VERSION; // 6
-        MiniportDriverCharacteristics.MinorNdisVersion = NDIS_MINIPORT_MINOR_VERSION; // 85
+        MiniportDriverCharacteristics.MajorNdisVersion = 6;
+        MiniportDriverCharacteristics.MinorNdisVersion = (UCHAR)(NdisGetVersion() & 0x00FF);
     } else
 #endif
     if (NdisGetVersion() >= NDIS_RUNTIME_VERSION_660) {
         MiniportDriverCharacteristics.MajorNdisVersion = 6;
         MiniportDriverCharacteristics.MinorNdisVersion = 60;
     } else {
-        MiniportDriverCharacteristics.MajorNdisVersion = NDIS_MINIPORT_MINIMUM_MAJOR_VERSION; // 6
-        MiniportDriverCharacteristics.MinorNdisVersion = NDIS_MINIPORT_MINIMUM_MINOR_VERSION; // 30
+        MiniportDriverCharacteristics.MajorNdisVersion = 6;
+        MiniportDriverCharacteristics.MinorNdisVersion = 30;
     }
 
     MiniportDriverCharacteristics.MajorDriverVersion = MAJOR_VERSION;
-- 
2.44.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Jul 15 14:59:45 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 15 Jul 2024 14:59:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.758997.1168531 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sTNB2-0002yH-JG; Mon, 15 Jul 2024 14:59:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 758997.1168531; Mon, 15 Jul 2024 14:59:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sTNB2-0002yA-GB; Mon, 15 Jul 2024 14:59:44 +0000
Received: by outflank-mailman (input) for mailman id 758997;
 Mon, 15 Jul 2024 14:59:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DvRO=OP=invisiblethingslab.com=omeg@srs-se1.protection.inumbo.net>)
 id 1sTNB1-0002wN-Ky
 for win-pv-devel@lists.xenproject.org; Mon, 15 Jul 2024 14:59:43 +0000
Received: from fhigh7-smtp.messagingengine.com
 (fhigh7-smtp.messagingengine.com [103.168.172.158])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dbfd7712-42ba-11ef-8776-851b0ebba9a2;
 Mon, 15 Jul 2024 16:59:41 +0200 (CEST)
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailfhigh.nyi.internal (Postfix) with ESMTP id ED6B51147D59
 for <win-pv-devel@lists.xenproject.org>; Mon, 15 Jul 2024 10:59:38 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute6.internal (MEProxy); Mon, 15 Jul 2024 10:59:38 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA for
 <win-pv-devel@lists.xenproject.org>; Mon,
 15 Jul 2024 10:59:37 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dbfd7712-42ba-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:content-type:content-type:date:date
	:from:from:in-reply-to:message-id:mime-version:reply-to:subject
	:subject:to:to; s=fm2; t=1721055578; x=1721141978; bh=sCVk11Jz5S
	KB4XeLl4Rx0k1qXkgzoUcOgKk4fvMxnfs=; b=LGopZxO9W0cWsWpm5b5LfQSG8D
	YrK0xqoyxUEiD0/6ZrBNGx+Jn0lHms1SYEdplHBpm4NLT29tJumYdS+mh34y24UT
	qPKGw1e1F7PdJquqvk5duLAMesoh79rmLJ2LpuXRarfysDjMNze9L96jYY2laTbi
	DrihGdw/b7eSk5cPC6m1UHJ4IUfvBEBbrZ0j9PWVj843u65zMY0MO8te8GVEl0FT
	4MpLG0uEgCJLCiNof44I+NHtvBj3f3kFBEbz/U8WoYr9cwIht6/LgScJiX0qFSqH
	dO7zdWKcgMIhWfPlcirgU/b/Z8zmplzMI3YTW+1EeoXHd2Om+XPFQ6t5H6ZA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:message-id
	:mime-version:reply-to:subject:subject:to:to:x-me-proxy
	:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1721055578; x=1721141978; bh=sCVk11Jz5SKB4XeLl4Rx0k1qXkgzoUcOgKk
	4fvMxnfs=; b=cq45nz38HMYgXksKC7QpZ6FL9tztDPSkXDrr+9qEF7kG6Ldd7/L
	okHumiqMcLHZ3ZzckkQblgozgEkXU7h/EjDEIr383fi1GQhzf3t/Kxjz1T6/BQeC
	pioe6id2z70+Badwg7K4fzr24ISGSkLRC0wsjffJ0xNNLmEZbIlBUf5rCcxSctj9
	pI5zXyAA7jhXIWchEwXlQQ6wbezmAw4SEp/++do8mLY1nq9AVD4nTt+eMse6ckfK
	mc5CtwJtUU8YC8TFUmtPVSaKexz0BjXJlzw5oPMjl+38M0e55aRvV3LvTty8Ou17
	CNC3XKlWxnmGuw4EgAdI93bAJiSEUbKHTng==
X-ME-Sender: <xms:WTmVZuEH1bozmzGJjjQh6wX_I-YHKV5MFnGLD4bvZrT_x_7aCglLpg>
    <xme:WTmVZvWcKpsJUl2Dqof_iD4O5rA-TToGHMCHOaQ5gq_B_5EFQjECJ2Lap-sbUh8tF
    ABnjFo1MLNX_3I>
X-ME-Received: <xmr:WTmVZoJKZXnFTYl8ey6E817WJZl8f-mR95R5CMq-6hpBnwLl53Qinbb0xwoe1nesZxpQ88RVT8svVouwSqKjs5bJTjGaLA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrgedvgdekvdcutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfvffhufgtsehgtderredtvd
    ejnecuhfhrohhmpeftrghfrghlucghohhjugihlhgruceoohhmvghgsehinhhvihhsihgs
    lhgvthhhihhnghhslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepteduffejtdethe
    ekkedvuedufeehueefueeitdffjefhueeiudfhteejvedvheeknecuvehluhhsthgvrhfu
    ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepohhmvghgsehinhhvihhsihgslh
    gvthhhihhnghhslhgrsgdrtghomh
X-ME-Proxy: <xmx:WTmVZoHxzGHCULT9FMzYPltRLOEzz7iqVIvXixgzbSHsJIsNAR-HBQ>
    <xmx:WTmVZkV-bIKBty5C03xYzaVLQKKuU6Mq2x8hc_O-3amzhT-3iSvw0w>
    <xmx:WTmVZrNdJsCg6vV5P8-J6xuvAsKcW5ssdr0vAfNfZa_377MkZmrZzA>
    <xmx:WTmVZr1IJlagZAvVoooO_hb6TCTgL8e3dNp4_JfLhAMQni-0jcPxtw>
    <xmx:WjmVZtd1bDr7nT67DxkA-HjzQXfVGDIgI94lnKfWpTaS_tAhwBcZTjLJ>
Feedback-ID: i409c4082:Fastmail
Message-ID: <604fdd1a-541a-43ee-9e06-ebd3b6ad1c6e@invisiblethingslab.com>
Date: Mon, 15 Jul 2024 16:59:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: win-pv-devel@lists.xenproject.org
From: =?UTF-8?B?UmFmYcWCIFdvamR5xYJh?= <omeg@invisiblethingslab.com>
Autocrypt: addr=omeg@invisiblethingslab.com;
 keydata= xsBNBFH+JQwBCAC0ym1Jtm5HM2p32Nw8NDNdkhwJR1For9txOKqeYMJWBTPzGJQG9HVHdYY/
 PZNfzvJkl26q1CB7JbAXVq2rSt1hn7cc4qL4BIDackJ4SEAAYbSLK82pQYUHhj18nNzZgxnn
 DBHpppRUA76DhSRKxEOZ+7GQAHd6H8RA0zBW+5ut0iOmglia3sOlim2yqeBRj6XaRn3RGmT9
 LXQu/UrJDY52LwJGE9on1wTvw+tN4QmCipFUk6YToVbkHiyDSnNN6aRqclH0vJBZquagQ/wn
 aOohowIyyzbY2+GJspKEPD3J9Ov5aKe/jN13WjBYwcy+NUG9SWT+VTIi6th43mh/L3dNABEB
 AAHNLVJhZmHFgiBXb2pkecWCYSA8b21lZ0BpbnZpc2libGV0aGluZ3NsYWIuY29tPsLAeQQT
 AQIAIwUCUkHE5wIbAwcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEIWi9rB2GrW7hasI
 AK5DFMRDqARqlOIncq0bDJbbPnScXozcVjrU2jHaA736d9eoXNixSxX+D1+4QGjgEIUJWaa6
 yqGTlqgHdOMKWYoDpUsm56Utj16E/ln1hSxXxEeHL30Fyqfqfmi0mlJv4ijasfxqwoHSt+Yy
 cACIhm563cwCaAdaO++lrcF2O/g+KIUXo0uEx+n6c8M25gu2TC3Cxn1ZeWH+5y9rUB6ph6JV
 eVKAYBSdK4qDEpDwz124YcpBloh5S4Jt6pVBSbJodbP+LQyet3Gb3IMYzFa+M6SMO/6EQX8k
 Q0zv1axlFCFs/Wf19A+nh40fZRRL+Q/v3lY9/v7u2mY4jGvKYao+sKXOwE0EUf4lDAEIALD5
 ungRVF1VnOKpNBS6xcpXw7jGX5Lh+r9fOZ9pSyqQRfD5t6yF3bjwgJBzfIJO2t/WhxlNTwZA
 Y3ZYA/+UBOyi9Y0axEp1L6bR42iC1tCt4kawpm+Lye4aRXdbKo/EBP6wSUiOqQ3+LLLmnaSj
 saAiYQWUZ3at1hOHrZZRIy3vk38rsheWURu6FQWc4VK2odEFtKD2gvw0s93Q6xbMahcWRP3M
 1TWzBSlO4pbV64nXBJVtqDOOs/jQwYjkdotNWb70a2uYasPz+btS0YvW31m94zedXdKZnJN+
 kP314z1q7Gv8CPfgRTqU3JonIkw69ylk2AGzeRv5oFVhRKgFlv0AEQEAAcLAXwQYAQIACQUC
 Uf4lDAIbDAAKCRCFovawdhq1u8wYB/9kZRnMX5gm0Yq7zdqu/K6o3EfAfYI/ZBOXSgYcb58s
 L1Jy+b3inq5PZQrLn7D9V5DFBBjKwthhKVK/eKCALqYuVvaiBmhHjE02xZoi1g7pvV2kj0z6
 OFtF2IXO4vwtaHQhhIutVd+jjDmnSl0kYCBurOjVFmD2ZCTDQ5/JqEDU26V5i9Dwp9sImDm7
 r3lBgLOKu5uWKoQRHbdxPN8FzoFfxDH+xZKubqGgvEvCsX1CjFRP7/kcGW5TrAb/rNEOG1Ik
 25Qj7mjWFa6sv2jYvV1aIpCK8sKKTPeS0mRfhnqQDYqluBsOQIrSHSHbjCTkuIdSutzJyxpG
 xLY7n9TPT2ug
Subject: xeniface: assertion failure on hibernation
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------XzxTWlcyWjttzpZqVHMDkBgG"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------XzxTWlcyWjttzpZqVHMDkBgG
Content-Type: multipart/mixed; boundary="------------16zNSaMugijUkamq0NdZcpru";
 protected-headers="v1"
From: =?UTF-8?B?UmFmYcWCIFdvamR5xYJh?= <omeg@invisiblethingslab.com>
To: win-pv-devel@lists.xenproject.org
Message-ID: <604fdd1a-541a-43ee-9e06-ebd3b6ad1c6e@invisiblethingslab.com>
Subject: xeniface: assertion failure on hibernation

--------------16zNSaMugijUkamq0NdZcpru
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

SGksDQoNCkkgd2FzIGRvaW5nIHNvbWUgdGVzdHMgd2l0aCB0aGUgZGVmYXVsdCBzeXN0ZW0g
c2h1dGRvd24gdGhhdCBhY3R1YWxseSANCmhpYmVybmF0ZXMgdGhlIE9TIGFuZCBJJ20gaGl0
dGluZyB0aGUgZm9sbG93aW5nIGFzc2VydGlvbjoNCg0KeGVufFN5c3RlbVBvd2VyU3RhdGVD
YWxsYmFjazogPC0gUzANCnhlbmlmYWNlfF9fRmRvUXVlcnlTeXN0ZW1Qb3dlcjogPT09PT4g
KEhpYmVybmF0ZTpIaWJlcm5hdGUpDQp4ZW5pZmFjZXxGZG9SZXF1ZXN0UXVlcnlEZXZpY2VQ
b3dlcjogRDMNCnhlbmlmYWNlfF9fRmRvUXVlcnlEZXZpY2VQb3dlcjogPT09PT4gKEQzOkhp
YmVybmF0ZSkNCnhlbmlmYWNlfF9fRmRvUmVxdWVzdFF1ZXJ5RGV2aWNlUG93ZXI6IEFTU0VS
VElPTiBGQUlMRUQ6IA0KKCgoTlRTVEFUVVMpKElvU3RhdHVzLT5TdGF0dXMpKSA+PSAwKQ0K
QXNzZXJ0aW9uIHhlbmlmYWNlXHNyY1x4ZW5pZmFjZVxmZG8uYygxOTQ0KTogDQooKChOVFNU
QVRVUykoSW9TdGF0dXMtPlN0YXR1cykpID49IDApDQoNCkl0J3MgcmVwcm9kdWNpYmxlIG9u
IFdpbiAxMCBhbmQgMTEgd2l0aCB0aGUgbGF0ZXN0IHhlbmJ1cyBhbmQgeGVuaWZhY2UgDQoo
ZGVidWcgYnVpbGQpLCBubyBvdGhlciBwdiBkcml2ZXJzIG9yIHRvb2xzLiBBIGJpdCBtb3Jl
IGluZm8gYmVsb3cuDQoNCjA6IGtkPiBrDQogICMgQ2hpbGQtU1AgICAgICAgICAgUmV0QWRk
ciAgICAgICAgICAgICAgIENhbGwgU2l0ZQ0KMDAgZmZmZjkzMGJgYmYyMzU3NTAgZmZmZmY4
MDJgMzRmN2FjYzQgDQp4ZW5pZmFjZSFfX0Zkb1JlcXVlc3RRdWVyeURldmljZVBvd2VyKzB4
NTcgW3hlbmlmYWNlXHNyY1x4ZW5pZmFjZVxmZG8uYyANCkAgMTk0NF0NCjAxIGZmZmY5MzBi
YGJmMjM1NzkwIGZmZmZmODAyYDM0ZTU0OTc1ICAgICBudCFQb3BSZXF1ZXN0Q29tcGxldGlv
bisweDY0DQowMiBmZmZmOTMwYmBiZjIzNTdlMCBmZmZmZjgwMmAzNGU1NDdiNyAgICAgbnQh
SW9wZkNvbXBsZXRlUmVxdWVzdCsweDFhNQ0KMDMgZmZmZjkzMGJgYmYyMzU4YzAgZmZmZmY4
MDJgMzgwYTgxYmUgICAgIG50IUlvZkNvbXBsZXRlUmVxdWVzdCsweDE3DQowNCBmZmZmOTMw
YmBiZjIzNThmMCBmZmZmZjgwMmAzODBhN2RmZCAgICAgeGVuYnVzIVBkb0Rpc3BhdGNoUG93
ZXIrMHg2ZSANClt4ZW5idXNcc3JjXHhlbmJ1c1xwZG8uYyBAIDE5MzRdDQowNSBmZmZmOTMw
YmBiZjIzNTk0MCBmZmZmZjgwMmAzODA4YTJlOCAgICAgeGVuYnVzIVBkb0Rpc3BhdGNoKzB4
NWQgDQpbeGVuYnVzXHNyY1x4ZW5idXNccGRvLmMgQCAxOTcwXQ0KMDYgZmZmZjkzMGJgYmYy
MzU5ODAgZmZmZmY4MDJgMzRmOTg2Y2YgICAgIHhlbmJ1cyFEcml2ZXJEaXNwYXRjaCsweDIy
OCANClt4ZW5idXNcc3JjXHhlbmJ1c1xkcml2ZXIuYyBAIDM0Ml0NCjA3IGZmZmY5MzBiYGJm
MjM1YTAwIGZmZmZmODAyYDM0ZTJkNDBkICAgICBudCFJb3BQb0hhbmRsZUlycCsweDNiDQow
OCBmZmZmOTMwYmBiZjIzNWEzMCBmZmZmZjgwMmAzYjFjMTAyOSAgICAgbnQhSW9mQ2FsbERy
aXZlcisweDZkDQowOSBmZmZmOTMwYmBiZjIzNWE3MCBmZmZmZjgwMmAzYjFjMGViNyANCnhl
bmlmYWNlIV9fRmRvUXVlcnlEZXZpY2VQb3dlckRvd24rMHgxMTkgW3hlbmlmYWNlXHNyY1x4
ZW5pZmFjZVxmZG8uYyBAIA0KMTg4Ml0NCjBhIGZmZmY5MzBiYGJmMjM1YWQwIGZmZmZmODAy
YDNiMWJjZDFjIA0KeGVuaWZhY2UhX19GZG9RdWVyeURldmljZVBvd2VyKzB4MWI3IFt4ZW5p
ZmFjZVxzcmNceGVuaWZhY2VcZmRvLmMgQCAxOTE1XQ0KMGIgZmZmZjkzMGJgYmYyMzViNTAg
ZmZmZmY4MDJgM2IxYzJiNjkgICAgIHhlbmlmYWNlIUZkb0RldmljZVBvd2VyKzB4ZmMgDQpb
eGVuaWZhY2Vcc3JjXHhlbmlmYWNlXGZkby5jIEAgMjEyNl0NCjBjIGZmZmY5MzBiYGJmMjM1
YmMwIGZmZmZmODAyYDM0ZjQ4ZGE1ICAgICB4ZW5pZmFjZSFUaHJlYWRGdW5jdGlvbisweDM5
IA0KW3hlbmlmYWNlXHNyY1x4ZW5pZmFjZVx0aHJlYWQuYyBAIDExMF0NCjBkIGZmZmY5MzBi
YGJmMjM1YzEwIGZmZmZmODAyYDM1MDA2YjU4ICAgICBudCFQc3BTeXN0ZW1UaHJlYWRTdGFy
dHVwKzB4NTUNCjBlIGZmZmY5MzBiYGJmMjM1YzYwIDAwMDAwMDAwYDAwMDAwMDAwICAgICBu
dCFLaVN0YXJ0U3lzdGVtVGhyZWFkKzB4MjgNCjA6IGtkPiA/PyAoRFdPUkQpIElvU3RhdHVz
LT5TdGF0dXMNCkRXT1JEIDB4YzAwMDAwYmINCjA6IGtkPiAhZXJyb3IgMHhjMDAwMDBiYg0K
RXJyb3IgY29kZTogKE5UU1RBVFVTKSAweGMwMDAwMGJiICgzMjIxMjI1NjU5KSAtIFRoZSBy
ZXF1ZXN0IGlzIG5vdCANCnN1cHBvcnRlZC4NCjA6IGtkPiAuZnJhbWUgMG40O2R2IC90IC92
DQowNCBmZmZmOTMwYmBiZjIzNThmMCBmZmZmZjgwMmAzODBhN2RmZCAgICAgeGVuYnVzIVBk
b0Rpc3BhdGNoUG93ZXIrMHg2ZSANClt4ZW5idXNcc3JjXHhlbmJ1c1xwZG8uYyBAIDE5MzRd
DQpmZmZmOTMwYmBiZjIzNTk0MCBzdHJ1Y3QgX1hFTkJVU19QRE8gKiBQZG8gPSAweGZmZmZj
NzhlYDQ1ZWZlMjMwDQpmZmZmOTMwYmBiZjIzNTk0OCBzdHJ1Y3QgX0lSUCAqIElycCA9IDB4
ZmZmZmM3OGVgNGMyOWFkZTANCmZmZmY5MzBiYGJmMjM1OTEwIHVuc2lnbmVkIGNoYXIgTWlu
b3JGdW5jdGlvbiA9IDB4MDMgJycNCmZmZmY5MzBiYGJmMjM1OTIwIHN0cnVjdCBfSU9fU1RB
Q0tfTE9DQVRJT04gKiBTdGFja0xvY2F0aW9uID0gDQoweGZmZmZjNzhlYDRjMjlhZWY4IElS
UF9NSl9QT1dFUiAvIElSUF9NTl9XQUlUX1dBS0UgZm9yIERldmljZSBmb3IgDQoiXERyaXZl
clx4ZW5idXMiDQpmZmZmOTMwYmBiZjIzNTkxNCBsb25nIHN0YXR1cyA9IDBuLTEwNzM3NDE2
MzcNCjA6IGtkPiA/PyAoRFdPUkQpSXJwLT5Jb1N0YXR1cy5TdGF0dXMNCkRXT1JEIDB4YzAw
MDAwYmINCjA6IGtkPiAuZnJhbWUgMG45O2R2IC90IC92DQowOSBmZmZmOTMwYmBiZjIzNWE3
MCBmZmZmZjgwMmAzYjFjMGViNyANCnhlbmlmYWNlIV9fRmRvUXVlcnlEZXZpY2VQb3dlckRv
d24rMHgxMTkgW3hlbmlmYWNlXHNyY1x4ZW5pZmFjZVxmZG8uYyBAIA0KMTg4Ml0NCmZmZmY5
MzBiYGJmMjM1YWQwIHN0cnVjdCBfWEVOSUZBQ0VfRkRPICogRmRvID0gMHhmZmZmYzc4ZWA0
NjUxNTRhMA0KZmZmZjkzMGJgYmYyMzVhZDggc3RydWN0IF9JUlAgKiBJcnAgPSAweGZmZmZj
NzhlYDRjMjlhZGUwDQpmZmZmOTMwYmBiZjIzNWFiMCBzdHJ1Y3QgX0lPX1NUQUNLX0xPQ0FU
SU9OICogU3RhY2tMb2NhdGlvbiA9IA0KMHhmZmZmYzc4ZWA0YzI5YWVmOCBJUlBfTUpfUE9X
RVIgLyBJUlBfTU5fV0FJVF9XQUtFIGZvciBEZXZpY2UgZm9yIA0KIlxEcml2ZXJceGVuYnVz
Ig0KZmZmZjkzMGJgYmYyMzVhOTAgX0RFVklDRV9QT1dFUl9TVEFURSBEZXZpY2VTdGF0ZSA9
IFBvd2VyRGV2aWNlRDMgKDBuNCkNCmZmZmY5MzBiYGJmMjM1YTljIGxvbmcgc3RhdHVzID0g
MG4wDQowOiBrZD4gPz8gKERXT1JEKUlycC0+SW9TdGF0dXMuU3RhdHVzDQpEV09SRCAweGMw
MDAwMGJiDQoNCkl0J3MgcHJvYmFibHkgaGFybWxlc3MgaGVyZSwgYnV0IEkgYWxzbyBmb3Vu
ZCBzb21lIHByb2JhYmxlIGJ1Z3MgaW4gdGhlIA0KZ250dGFiIGNvZGUgc2VlbWluZ2x5IHJl
bGF0ZWQgdG8gaGliZXJuYXRpb24gc28gdGhvdWdodCBJJ2Qgc2hhcmUgdGhpcyANCmZpcnN0
Lg0KDQotLSANClJhZmHFgiBXb2pkecWCYQ0KSW52aXNpYmxlIFRoaW5ncyBMYWINCg==

--------------16zNSaMugijUkamq0NdZcpru--

--------------XzxTWlcyWjttzpZqVHMDkBgG
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature.asc"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEVwOm02mHaIsSbeWChaL2sHYatbsFAmaVOVcFAwAAAAAACgkQhaL2sHYatbul
lggAjBfDv/9B/f43jJ6JFQ2ng1Z/eusbAk9+LbyfmOpxk5mLoXiQdTfzIPAwGvcNDXowG+4QtnqW
bNI/eS7UAElZPd66/2ePi3LNFkE00VL5jobILN0LzYRUDhXKiR4ySBHdqUhr2mK0g5OsV0RZKNLW
gN+pzKUGZwZ6AvOrsRXhfztgSpmD8hWjeu0Gs8VcaMMXMyhgA0bPSLOY2EG9cG3P1bYQ8kSBaJQr
8XBo2Hok92e+L0T3uPK/jo1x60fK6JHeF+N8QzF3RJVuAEZzWATAzfradyWvHjtN/T0IMkVnrKBG
dAWodwx87wGSB5NDISzRwtzilYGRyScG1lgojbh9oQ==
=riAd
-----END PGP SIGNATURE-----

--------------XzxTWlcyWjttzpZqVHMDkBgG--


From win-pv-devel-bounces@lists.xenproject.org Tue Jul 16 08:19:33 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 16 Jul 2024 08:19:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.759397.1169108 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sTdPH-0007Yc-M5; Tue, 16 Jul 2024 08:19:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 759397.1169108; Tue, 16 Jul 2024 08:19:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sTdPH-0007YQ-Ix; Tue, 16 Jul 2024 08:19:31 +0000
Received: by outflank-mailman (input) for mailman id 759397;
 Tue, 16 Jul 2024 08:19:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=GZY9=OQ=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sTdPG-0007YG-Ik
 for win-pv-devel@lists.xenproject.org; Tue, 16 Jul 2024 08:19:30 +0000
Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com
 [2a00:1450:4864:20::436])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1ecc2e27-434c-11ef-bbfb-fd08da9f4363;
 Tue, 16 Jul 2024 10:19:29 +0200 (CEST)
Received: by mail-wr1-x436.google.com with SMTP id
 ffacd0b85a97d-3678fbf4a91so2635567f8f.1
 for <win-pv-devel@lists.xenproject.org>; Tue, 16 Jul 2024 01:19:28 -0700 (PDT)
Received: from [192.168.14.98] (54-240-197-236.amazon.com. [54.240.197.236])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-3680dafb91csm8361463f8f.74.2024.07.16.01.19.27
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 16 Jul 2024 01:19:27 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1ecc2e27-434c-11ef-bbfb-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721117968; x=1721722768; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=5WwBB6LvSTZIqzO6/9d5Am2Ps3f54C+phcgmIpUpxkY=;
        b=a/ha5lTLG8zpjaheGSj2Z1n48JJcaS4z9eOw/mdqjaHZYuGmX0Fe51BGFKSO29/TfQ
         d/3z4VuUYZwYypi+YhQ4UTu12nbSeeBwJeAOlJaiaUJ8+5GTwLYnJXjRKKwxees2+FFm
         PP0esuLMwU3p8QgsLDlvYP4aujttqurZ9Aa+To7CdDYK0PEXDd95KhhVucB9ysc+Bw0D
         q+bBdQBl0qpbxtEBzGLeiesm7V7Z1kYNstzsDC25puQWBrt3Mj1NdZiYWtBf7PMY+AaM
         9DoUxWpPHvVEfx/jINqMmUq2thP6vFEQ1mKZmw+ggrtxsxM8siX/ngo34rKdu2rsz80I
         CvRw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721117968; x=1721722768;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=5WwBB6LvSTZIqzO6/9d5Am2Ps3f54C+phcgmIpUpxkY=;
        b=aZ9HfAMUgBheA4eLClgAXf65CRtkzhkGEyvCnNv8hpyd2eOANPMkESSNSeDX9YDVC8
         DsIAji50cEcgkh86ejjVC3eYjJ8Z4iy23PklUisXx32HwEu0thSiLbEA+f39feh2ek+9
         f7yrywexeF07hws7gFQtJ0ccl31Nhb3oo77t/qEqbjMPqmb7/p6aMaUduiyhdlLqFJIi
         fIEIndy4VTK6EpjrTEFuQM6gMzl93XQ10kwMagvLJHE1aLCdLXjSJ/HCFdkjVVV9YqHD
         NRPYCTl1Q1mu1aTjw4gk32IK2lCyZL3vLBE/7rY4g3BPgrXLhR/AvRMbOG71Ew7xQnS/
         69ew==
X-Gm-Message-State: AOJu0YxAkQBiSmaJaAJxa2KRryKk2GAlFgSp9vmeDENKuEU1sMVNo5wD
	p4fKqLE/08DO3ELwVwAulmBY+h3HItBbT/wR9gIxLZooy4fFw5YSG9ab+w/f
X-Google-Smtp-Source: AGHT+IHUrIf5OjHdsPxxdjxlRjYBjF7ITS9EeG97SBgh8PgX2ctyxLwSZerNVhSwa3gCnMjVGNWBpA==
X-Received: by 2002:a05:6000:1864:b0:367:434f:ca9a with SMTP id ffacd0b85a97d-36825d1204dmr973069f8f.0.1721117967874;
        Tue, 16 Jul 2024 01:19:27 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <faf963fe-a631-42ed-8a2f-5e128a6c7ddf@xen.org>
Date: Tue, 16 Jul 2024 09:19:24 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: xeniface: assertion failure on hibernation
To: win-pv-devel@lists.xenproject.org
References: <604fdd1a-541a-43ee-9e06-ebd3b6ad1c6e@invisiblethingslab.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <604fdd1a-541a-43ee-9e06-ebd3b6ad1c6e@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 15/07/2024 16:59, Rafał Wojdyła wrote:
> Hi,
> 
> I was doing some tests with the default system shutdown that actually 
> hibernates the OS and I'm hitting the following assertion:
> 
> xen|SystemPowerStateCallback: <- S0
> xeniface|__FdoQuerySystemPower: ====> (Hibernate:Hibernate)
> xeniface|FdoRequestQueryDevicePower: D3
> xeniface|__FdoQueryDevicePower: ====> (D3:Hibernate)
> xeniface|__FdoRequestQueryDevicePower: ASSERTION FAILED: 
> (((NTSTATUS)(IoStatus->Status)) >= 0)
> Assertion xeniface\src\xeniface\fdo.c(1944): 
> (((NTSTATUS)(IoStatus->Status)) >= 0)
> 
> It's reproducible on Win 10 and 11 with the latest xenbus and xeniface 
> (debug build), no other pv drivers or tools. A bit more info below.
> 

This is exactly the kind of reason why I feared changing the power IRP 
handling code. Anything to do with PnP or power handling is just so 
fragile. Any chance you could dig into this further?

> 0: kd> k
>   # Child-SP          RetAddr               Call Site
> 00 ffff930b`bf235750 fffff802`34f7acc4 
> xeniface!__FdoRequestQueryDevicePower+0x57 [xeniface\src\xeniface\fdo.c 
> @ 1944]
> 01 ffff930b`bf235790 fffff802`34e54975     nt!PopRequestCompletion+0x64
> 02 ffff930b`bf2357e0 fffff802`34e547b7     nt!IopfCompleteRequest+0x1a5
> 03 ffff930b`bf2358c0 fffff802`380a81be     nt!IofCompleteRequest+0x17
> 04 ffff930b`bf2358f0 fffff802`380a7dfd     xenbus!PdoDispatchPower+0x6e 
> [xenbus\src\xenbus\pdo.c @ 1934]
> 05 ffff930b`bf235940 fffff802`3808a2e8     xenbus!PdoDispatch+0x5d 
> [xenbus\src\xenbus\pdo.c @ 1970]
> 06 ffff930b`bf235980 fffff802`34f986cf     xenbus!DriverDispatch+0x228 
> [xenbus\src\xenbus\driver.c @ 342]
> 07 ffff930b`bf235a00 fffff802`34e2d40d     nt!IopPoHandleIrp+0x3b
> 08 ffff930b`bf235a30 fffff802`3b1c1029     nt!IofCallDriver+0x6d
> 09 ffff930b`bf235a70 fffff802`3b1c0eb7 
> xeniface!__FdoQueryDevicePowerDown+0x119 [xeniface\src\xeniface\fdo.c @ 
> 1882]
> 0a ffff930b`bf235ad0 fffff802`3b1bcd1c 
> xeniface!__FdoQueryDevicePower+0x1b7 [xeniface\src\xeniface\fdo.c @ 1915]
> 0b ffff930b`bf235b50 fffff802`3b1c2b69     xeniface!FdoDevicePower+0xfc 
> [xeniface\src\xeniface\fdo.c @ 2126]
> 0c ffff930b`bf235bc0 fffff802`34f48da5     xeniface!ThreadFunction+0x39 
> [xeniface\src\xeniface\thread.c @ 110]
> 0d ffff930b`bf235c10 fffff802`35006b58     nt!PspSystemThreadStartup+0x55
> 0e ffff930b`bf235c60 00000000`00000000     nt!KiStartSystemThread+0x28
> 0: kd> ?? (DWORD) IoStatus->Status
> DWORD 0xc00000bb
> 0: kd> !error 0xc00000bb
> Error code: (NTSTATUS) 0xc00000bb (3221225659) - The request is not 
> supported.
> 0: kd> .frame 0n4;dv /t /v
> 04 ffff930b`bf2358f0 fffff802`380a7dfd     xenbus!PdoDispatchPower+0x6e 
> [xenbus\src\xenbus\pdo.c @ 1934]
> ffff930b`bf235940 struct _XENBUS_PDO * Pdo = 0xffffc78e`45efe230
> ffff930b`bf235948 struct _IRP * Irp = 0xffffc78e`4c29ade0
> ffff930b`bf235910 unsigned char MinorFunction = 0x03 ''
> ffff930b`bf235920 struct _IO_STACK_LOCATION * StackLocation = 
> 0xffffc78e`4c29aef8 IRP_MJ_POWER / IRP_MN_WAIT_WAKE for Device for 
> "\Driver\xenbus"
> ffff930b`bf235914 long status = 0n-1073741637
> 0: kd> ?? (DWORD)Irp->IoStatus.Status
> DWORD 0xc00000bb
> 0: kd> .frame 0n9;dv /t /v
> 09 ffff930b`bf235a70 fffff802`3b1c0eb7 
> xeniface!__FdoQueryDevicePowerDown+0x119 [xeniface\src\xeniface\fdo.c @ 
> 1882]
> ffff930b`bf235ad0 struct _XENIFACE_FDO * Fdo = 0xffffc78e`465154a0
> ffff930b`bf235ad8 struct _IRP * Irp = 0xffffc78e`4c29ade0
> ffff930b`bf235ab0 struct _IO_STACK_LOCATION * StackLocation = 
> 0xffffc78e`4c29aef8 IRP_MJ_POWER / IRP_MN_WAIT_WAKE for Device for 
> "\Driver\xenbus"
> ffff930b`bf235a90 _DEVICE_POWER_STATE DeviceState = PowerDeviceD3 (0n4)
> ffff930b`bf235a9c long status = 0n0
> 0: kd> ?? (DWORD)Irp->IoStatus.Status
> DWORD 0xc00000bb
> 
> It's probably harmless here, but I also found some probable bugs in the 
> gnttab code seemingly related to hibernation so thought I'd share this 
> first.
> 

Ah. maybe you're already on it.

   Paul



From win-pv-devel-bounces@lists.xenproject.org Tue Jul 16 11:55:13 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 16 Jul 2024 11:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.759460.1169172 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sTglz-00038C-L3; Tue, 16 Jul 2024 11:55:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 759460.1169172; Tue, 16 Jul 2024 11:55:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sTglz-000385-IN; Tue, 16 Jul 2024 11:55:11 +0000
Received: by outflank-mailman (input) for mailman id 759460;
 Tue, 16 Jul 2024 11:55:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=iYYY=OQ=cloud.com=kelly.choi@srs-se1.protection.inumbo.net>)
 id 1sTgly-00037z-TM
 for win-pv-devel@lists.xenproject.org; Tue, 16 Jul 2024 11:55:10 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4011c130-436a-11ef-bbfb-fd08da9f4363;
 Tue, 16 Jul 2024 13:55:09 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a797c62565aso576537866b.2
 for <win-pv-devel@lists.xenproject.org>; Tue, 16 Jul 2024 04:55:09 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4011c130-436a-11ef-bbfb-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1721130909; x=1721735709; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=49AF6InFOH/oYWanwpJu20XweI0SLlDMfCg4YaI1zBE=;
        b=IGE0+zDzprssS+D8/fKDVfndDtnWuTFiOi6Wsz1vLVQNM4J7jPxv6t9L5ryiBmLnGY
         rH4L9hTp/TSPdcpw6Lx1FtqreLENC58g2IOG1U/pLAyPv0dLenSjek0tiNE6hsykdqp6
         H9qgjkphZWXlUy1vDKqHREHCwjuB51RFhz0oM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721130909; x=1721735709;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=49AF6InFOH/oYWanwpJu20XweI0SLlDMfCg4YaI1zBE=;
        b=FN8QVBDTQ+EwTiaNeQ3WYjLNPOK3j4TJ0DSq6AB4ahm0thqXqwJM5nj4jr8QaUIgVl
         gvpvgudQtMvPEL5UGQPPFZEkSKKS+lkFqBfOL5lh+VJ1VCWOKoQw5d7nq7tYEbncliWs
         +dVzp0x+heoty4VLxcmSHuAdi3z1a42XXJGrYMlUxhwnCw3uZbRyEHtX9L0ac4WVHbFB
         W011gVpAif11uoAyjjDg9vSKtlh+eZxw4m9BDA1q8PcbPK2kDIPWmcKNxTbM9wupOuZv
         kO132FKz6Gd3W8sSOW1eaDm378fEduxCTjPa7ZCMteB0bnFx0PyI493sBubp7F8eIMHt
         YHTg==
X-Forwarded-Encrypted: i=1; AJvYcCWlH+/EVwQZYCgKDJQAC4W5gPEtP4af9wNFu1nooVbH8GPZJMtoRZTMt53hv3zyZXaAKCbGpLho8M4WCrgHEaLxh2SgVvT68r+vNLVG9VksMks=
X-Gm-Message-State: AOJu0YxUaKne+OPy5NxsfLj3/FQjNWH2itGJWBcSjdsDcoWzeEPhLS8V
	1uoqwW/wpxdgIlXrVQDU6f6aQbmyZRkLwC/R7rK8EUtXomxMUNAAlaOp504mx71tQ1/hVMeuWCR
	VZKL8K6YosTZYQwNUM6gvSwPGALV2oAAEjqAfbw==
X-Google-Smtp-Source: AGHT+IG/Uh4XYIlfCVF9cxypKQRT5/GflfpEqf38lkkIiE7lhpGzIXD4zOj6jF4GcYUgffahLM7efbg3TOZPzJHiCRk=
X-Received: by 2002:a17:907:980f:b0:a77:d52c:c42d with SMTP id
 a640c23a62f3a-a79ea43a1e9mr138960266b.13.1721130908401; Tue, 16 Jul 2024
 04:55:08 -0700 (PDT)
MIME-Version: 1.0
References: <CAO-mL=yK45Zc4a3gWtZsL4jMjextF9AVtjYezrngt=0TJn_RPg@mail.gmail.com>
 <99d03fea-a4e6-4139-964b-354327747deb@xen.org> <CAC_UY8_Mo+QOgOT=zFK0+GyWjLOpeaX8A_dZzXpaiz6fB_LPYw@mail.gmail.com>
 <3e6c98fb-2a10-4746-a5e5-107ef7d7303a@xen.org>
In-Reply-To: <3e6c98fb-2a10-4746-a5e5-107ef7d7303a@xen.org>
From: Kelly Choi <kelly.choi@cloud.com>
Date: Tue, 16 Jul 2024 12:54:32 +0100
Message-ID: <CAO-mL=w5M_nM1W9t-MDQy1EmL6XxW_jAqF=WEERuJNJSnH_JTQ@mail.gmail.com>
Subject: Re: Update maintainers file
To: paul@xen.org
Cc: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000686c8e061d5c04f9"

--000000000000686c8e061d5c04f9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi both,

Just following this up.
Please can you let me know once this has been updated?

Many thanks,
Kelly Choi

Community Manager
Xen Project


On Tue, Jul 2, 2024 at 9:56=E2=80=AFAM Paul Durrant <xadimgnik@gmail.com> w=
rote:

> On 02/07/2024 09:47, Owen Smith wrote:
> > The @citrix.com <http://citrix.com> address is redirected to the
> > @cloud.com <http://cloud.com> address, but updating to the @cloud.com
> > <http://cloud.com> address will be best.
> >
>
> Ok. I'll send a patch.
>
> Paul
>
> > Owen
> >
> > On Tue, Jul 2, 2024 at 9:24=E2=80=AFAM Paul Durrant <xadimgnik@gmail.co=
m
> > <mailto:xadimgnik@gmail.com>> wrote:
> >
> >     On 01/07/2024 13:51, Kelly Choi wrote:
> >      > Hi all,
> >      >
> >      > Please can we update the maintainer's file for Windows PV Driver=
s?
> >      >
> >      > Ben Chalmers should be removed as he no longer works at Citrix.
> >      >
> >      >
> >
> https://xenbits.xenproject.org/gitweb/?p=3Dpvdrivers/win/xenbus.git;a=3Db=
lob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56dbb7d09614221d836e6;hb=3DHEAD
> <
> https://xenbits.xenproject.org/gitweb/?p=3Dpvdrivers/win/xenbus.git;a=3Db=
lob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56dbb7d09614221d836e6;hb=3DHEAD>
> <
> https://xenbits.xenproject.org/gitweb/?p=3Dpvdrivers/win/xenbus.git;a=3Db=
lob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56dbb7d09614221d836e6;hb=3DHEAD
> <
> https://xenbits.xenproject.org/gitweb/?p=3Dpvdrivers/win/xenbus.git;a=3Db=
lob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56dbb7d09614221d836e6;hb=3DHEAD
> >>
> >      >
> >
> >     Will do.
> >
> >     Owen, is your @citrix.com <http://citrix.com> address still valid o=
r
> >     does it need to be
> >     updated to @cloud.com <http://cloud.com>?
> >
>
>
>

--000000000000686c8e061d5c04f9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi both,<div><br></div><div>Just following this up.=C2=A0<=
/div><div>Please can you let me know once this has been updated?</div><div>=
<br clear=3D"all"><div><div dir=3D"ltr" class=3D"gmail_signature" data-smar=
tmail=3D"gmail_signature"><div dir=3D"ltr"><div>Many thanks,</div><div>Kell=
y Choi</div><div><br></div><div><div style=3D"color:rgb(136,136,136)">Commu=
nity Manager</div><div style=3D"color:rgb(136,136,136)">Xen Project=C2=A0<b=
r></div></div></div></div></div><br></div></div><br><div class=3D"gmail_quo=
te"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Jul 2, 2024 at 9:56=E2=80=
=AFAM Paul Durrant &lt;<a href=3D"mailto:xadimgnik@gmail.com">xadimgnik@gma=
il.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left=
:1ex">On 02/07/2024 09:47, Owen Smith wrote:<br>
&gt; The=C2=A0@<a href=3D"http://citrix.com" rel=3D"noreferrer" target=3D"_=
blank">citrix.com</a> &lt;<a href=3D"http://citrix.com" rel=3D"noreferrer" =
target=3D"_blank">http://citrix.com</a>&gt; address is redirected to the <b=
r>
&gt; @<a href=3D"http://cloud.com" rel=3D"noreferrer" target=3D"_blank">clo=
ud.com</a> &lt;<a href=3D"http://cloud.com" rel=3D"noreferrer" target=3D"_b=
lank">http://cloud.com</a>&gt; address, but updating to the=C2=A0@<a href=
=3D"http://cloud.com" rel=3D"noreferrer" target=3D"_blank">cloud.com</a> <b=
r>
&gt; &lt;<a href=3D"http://cloud.com" rel=3D"noreferrer" target=3D"_blank">=
http://cloud.com</a>&gt; address will be best.<br>
&gt; <br>
<br>
Ok. I&#39;ll send a patch.<br>
<br>
Paul<br>
<br>
&gt; Owen<br>
&gt; <br>
&gt; On Tue, Jul 2, 2024 at 9:24=E2=80=AFAM Paul Durrant &lt;<a href=3D"mai=
lto:xadimgnik@gmail.com" target=3D"_blank">xadimgnik@gmail.com</a> <br>
&gt; &lt;mailto:<a href=3D"mailto:xadimgnik@gmail.com" target=3D"_blank">xa=
dimgnik@gmail.com</a>&gt;&gt; wrote:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0On 01/07/2024 13:51, Kelly Choi wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; Hi all,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; Please can we update the maintainer&#39;s fil=
e for Windows PV Drivers?<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; Ben Chalmers should be removed as he no longe=
r works at Citrix.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0<a href=3D"https://xenbits.xenproject.org/gitweb/?p=
=3Dpvdrivers/win/xenbus.git;a=3Dblob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51=
b56dbb7d09614221d836e6;hb=3DHEAD" rel=3D"noreferrer" target=3D"_blank">http=
s://xenbits.xenproject.org/gitweb/?p=3Dpvdrivers/win/xenbus.git;a=3Dblob;f=
=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56dbb7d09614221d836e6;hb=3DHEAD</a> &=
lt;<a href=3D"https://xenbits.xenproject.org/gitweb/?p=3Dpvdrivers/win/xenb=
us.git;a=3Dblob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56dbb7d09614221d836e=
6;hb=3DHEAD" rel=3D"noreferrer" target=3D"_blank">https://xenbits.xenprojec=
t.org/gitweb/?p=3Dpvdrivers/win/xenbus.git;a=3Dblob;f=3DMAINTAINERS;h=3Dcc5=
9618fe54b12bd51b56dbb7d09614221d836e6;hb=3DHEAD</a>&gt; &lt;<a href=3D"http=
s://xenbits.xenproject.org/gitweb/?p=3Dpvdrivers/win/xenbus.git;a=3Dblob;f=
=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56dbb7d09614221d836e6;hb=3DHEAD" rel=
=3D"noreferrer" target=3D"_blank">https://xenbits.xenproject.org/gitweb/?p=
=3Dpvdrivers/win/xenbus.git;a=3Dblob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51=
b56dbb7d09614221d836e6;hb=3DHEAD</a> &lt;<a href=3D"https://xenbits.xenproj=
ect.org/gitweb/?p=3Dpvdrivers/win/xenbus.git;a=3Dblob;f=3DMAINTAINERS;h=3Dc=
c59618fe54b12bd51b56dbb7d09614221d836e6;hb=3DHEAD" rel=3D"noreferrer" targe=
t=3D"_blank">https://xenbits.xenproject.org/gitweb/?p=3Dpvdrivers/win/xenbu=
s.git;a=3Dblob;f=3DMAINTAINERS;h=3Dcc59618fe54b12bd51b56dbb7d09614221d836e6=
;hb=3DHEAD</a>&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Will do.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Owen, is your @<a href=3D"http://citrix.com" rel=3D=
"noreferrer" target=3D"_blank">citrix.com</a> &lt;<a href=3D"http://citrix.=
com" rel=3D"noreferrer" target=3D"_blank">http://citrix.com</a>&gt; address=
 still valid or<br>
&gt;=C2=A0 =C2=A0 =C2=A0does it need to be<br>
&gt;=C2=A0 =C2=A0 =C2=A0updated to @<a href=3D"http://cloud.com" rel=3D"nor=
eferrer" target=3D"_blank">cloud.com</a> &lt;<a href=3D"http://cloud.com" r=
el=3D"noreferrer" target=3D"_blank">http://cloud.com</a>&gt;?<br>
&gt; <br>
<br>
<br>
</blockquote></div>

--000000000000686c8e061d5c04f9--


From win-pv-devel-bounces@lists.xenproject.org Fri Jul 19 11:13:47 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 19 Jul 2024 11:13:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.760994.1170969 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sUlYX-0001Ym-1D; Fri, 19 Jul 2024 11:13:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 760994.1170969; Fri, 19 Jul 2024 11:13:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sUlYW-0001Ya-US; Fri, 19 Jul 2024 11:13:44 +0000
Received: by outflank-mailman (input) for mailman id 760994;
 Fri, 19 Jul 2024 11:13:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Y74h=OT=cloud.com=kelly.choi@srs-se1.protection.inumbo.net>)
 id 1sUlYW-0001YJ-CN
 for win-pv-devel@lists.xenproject.org; Fri, 19 Jul 2024 11:13:44 +0000
Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com
 [2a00:1450:4864:20::62c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f4f7de5f-45bf-11ef-bbfd-fd08da9f4363;
 Fri, 19 Jul 2024 13:13:42 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a77c2d89af8so194824766b.2
 for <win-pv-devel@lists.xenproject.org>; Fri, 19 Jul 2024 04:13:42 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f4f7de5f-45bf-11ef-bbfd-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1721387622; x=1721992422; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=5e7wKCkzNVlPlHXDTLl/rmjv17vv+TYao9fpalfP0SY=;
        b=ADwOtJLbN+JvJpno4O8CnEb87H2z/D5AhH44F28stOJGxuUpiTTZBTox+J58gVyqYh
         ZSKWJFVk6yQ3nA3RCTtz4zQrHrdcGuDuGI+kfaTO3tBxgFC43FUTF51Uko36QIdHUwkQ
         oZaghE/BbD9neA63QOAxrHy3DJXUt3YgAkBl0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721387622; x=1721992422;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=5e7wKCkzNVlPlHXDTLl/rmjv17vv+TYao9fpalfP0SY=;
        b=n9N2dfLSVYhNbxn6SKBgnImmfAlNi3qBbyoblM8hXPSbFWqRXPjqLXKR3ngGtK3+na
         T2dUIv6zyC3mgj2VtXqhrVyreCjaLk3f6+c6q9HD16eNb02rAFvxr77Hpw48BSdVhCkq
         3v72WzSD1NUZlc79dnE0AT5mYMDkKCZ/cwH6AC6/v76T6o+Zko/I1m4sqvPSVqWiQoH+
         cGjG759iPvtHYmqYOkSB9JgkQrry9MOfgPmWm+dILgvEDunuPH7+zLwFjLYXJ3ttBylB
         Fb4aZrDzxwGYq+gwVrWmpA5gea3Ge/tVpDaSRph2DCjmMO0oMjFC38Jb7w8RVRD7rpO/
         jwEQ==
X-Gm-Message-State: AOJu0YxXqMY1z3U3i3ibDlVatw7yVD5E74Oyo58sUPB2JOM8r6tQODGl
	cOlb1flC1pwdslKDSY8ZWO3MsXGWx+0MbeyzWt56B7sTZNodhcPPy4UqOEa+DyGWqysYkWgTR2I
	5xg9oVk5n4O09OQVoEeKkw6CCD2eInE3yu554ufQMbQsqgvBI5qE=
X-Google-Smtp-Source: AGHT+IE2E6/0CR/edfh7Q2HPb/VFViuIMYHUXMOIzEDWTbjY5p+yMMocv/qWDt07IMeaBdZj5Uh0C1g8GkzU4fm8wKg=
X-Received: by 2002:a17:906:2f0b:b0:a77:dbf0:d30 with SMTP id
 a640c23a62f3a-a7a011b6466mr523528966b.41.1721387621269; Fri, 19 Jul 2024
 04:13:41 -0700 (PDT)
MIME-Version: 1.0
References: <CAO-mL=xEEdCjUWN3oqJEBjktH+dsJDXrQ2uHWD80bJJ32q3_pw@mail.gmail.com>
 <925ec9b8-83b3-473c-aa7c-dd825cdc3b9a@xen.org>
In-Reply-To: <925ec9b8-83b3-473c-aa7c-dd825cdc3b9a@xen.org>
From: Kelly Choi <kelly.choi@cloud.com>
Date: Fri, 19 Jul 2024 12:13:05 +0100
Message-ID: <CAO-mL=yhMDuvMOWHU93jNLgxOJe4_Bir44UC23+HoAfj0yK=Tw@mail.gmail.com>
Subject: Re: [Vote] Xen Project Code of Conduct Team Member
To: win-pv-devel@lists.xenproject.org, 
	xen-devel <xen-devel@lists.xenproject.org>, 
	"xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>, minios-devel@lists.xenproject.org, 
	mirageos-devel@lists.xenproject.org
Cc: committers@xenproject.org, Roger Pau Monne <roger.pau@cloud.com>
Content-Type: multipart/alternative; boundary="000000000000afe24c061d97c966"

--000000000000afe24c061d97c966
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi all,

I have received all votes from leadership teams of three mature projects
and achieved a quorum on this proposal.
Votes have been received both in public and private.

The outcome of votes:
Hypervisor: +3
Windows PV: +2
XAPI: +2

Roger will be added as the new code of conduct team member.

Many thanks,
Kelly Choi

Community Manager
Xen Project


On Tue, Jul 9, 2024 at 6:42=E2=80=AFAM Julien Grall <julien@xen.org> wrote:

>
>
> On 08/07/2024 10:00, Kelly Choi wrote:
> > Hi all,
> >
> > As you are aware, George Dunlap has recently stepped down from the Xen
> > Project as a committer, but he was also a part of the Code of Conduct
> team.
> >
> > As a result, Stefano will be the only member remaining on the CoC team.
> @Roger
> > Pau Monne <roger.pau@cloud.com> has volunteered to join the team, so
> that
> > there are at least two members.
> >
> > In accordance with https://xenproject.org/developers/governance/, I nee=
d
> > the leadership teams of the three mature projects: the Hypervisor, the
> XAPI
> > project, and the Windows PV Driver project to vote on this proposal.
> >
> > The specific voting rules, in this case, are outlined in the section:
> > https://www.xenproject.org/governance.html#project-decisions
> >
> > I propose to tally the votes after July 31st, 2024. You can reply via
> email
> > in public or private:
> > +1: for proposal
> > -1: against proposal
>
> +1
>
> Cheers,
>
> --
> Julien Grall
>

--000000000000afe24c061d97c966
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">Hi all,<div><br></div><div>I have receive=
d all votes from leadership=C2=A0teams=C2=A0of three mature projects and ac=
hieved a quorum=C2=A0on this proposal.</div><div>Votes have been received b=
oth in public and private.</div><div><br></div><div>The outcome of votes:</=
div><div>Hypervisor:=C2=A0+3</div><div>Windows PV:=C2=A0+2</div><div>XAPI:=
=C2=A0+2</div><div><br></div><div>Roger will be added as the new code of co=
nduct team member.=C2=A0</div><div><br></div><div><div><div dir=3D"ltr" cla=
ss=3D"gmail_signature"><div dir=3D"ltr"><div>Many thanks,</div><div>Kelly C=
hoi</div><div><br></div><div><div style=3D"color:rgb(136,136,136)">Communit=
y Manager</div><div style=3D"color:rgb(136,136,136)">Xen Project=C2=A0<br><=
/div></div></div></div></div><br></div></div><br><div class=3D"gmail_quote"=
><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Jul 9, 2024 at 6:42=E2=80=AF=
AM Julien Grall &lt;<a href=3D"mailto:julien@xen.org">julien@xen.org</a>&gt=
; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px=
 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On 08/07/2024 10:00, Kelly Choi wrote:<br>
&gt; Hi all,<br>
&gt; <br>
&gt; As you are aware, George Dunlap has recently stepped down from the Xen=
<br>
&gt; Project as a committer, but he was also a part of the Code of Conduct =
team.<br>
&gt; <br>
&gt; As a result, Stefano will be the only member remaining on the CoC team=
. @Roger<br>
&gt; Pau Monne &lt;<a href=3D"mailto:roger.pau@cloud.com" target=3D"_blank"=
>roger.pau@cloud.com</a>&gt; has volunteered to join the team, so that<br>
&gt; there are at least two members.<br>
&gt; <br>
&gt; In accordance with <a href=3D"https://xenproject.org/developers/govern=
ance/" rel=3D"noreferrer" target=3D"_blank">https://xenproject.org/develope=
rs/governance/</a>, I need<br>
&gt; the leadership teams of the three mature projects: the Hypervisor, the=
 XAPI<br>
&gt; project, and the Windows PV Driver project to vote on this proposal.<b=
r>
&gt; <br>
&gt; The specific voting rules, in this case, are outlined in the section:<=
br>
&gt; <a href=3D"https://www.xenproject.org/governance.html#project-decision=
s" rel=3D"noreferrer" target=3D"_blank">https://www.xenproject.org/governan=
ce.html#project-decisions</a><br>
&gt; <br>
&gt; I propose to tally the votes after July 31st, 2024. You can reply via =
email<br>
&gt; in public or private:<br>
&gt; +1: for proposal<br>
&gt; -1: against proposal<br>
<br>
+1<br>
<br>
Cheers,<br>
<br>
-- <br>
Julien Grall<br>
</blockquote></div></div>

--000000000000afe24c061d97c966--


From win-pv-devel-bounces@lists.xenproject.org Wed Jul 24 08:00:07 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jul 2024 08:00:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.763850.1174188 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWWur-00053r-Sk; Wed, 24 Jul 2024 08:00:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 763850.1174188; Wed, 24 Jul 2024 08:00:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWWur-00053f-PZ; Wed, 24 Jul 2024 08:00:05 +0000
Received: by outflank-mailman (input) for mailman id 763850;
 Wed, 24 Jul 2024 08:00:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i0Yy=OY=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sWWuq-0004ld-GX
 for win-pv-devel@lists.xenproject.org; Wed, 24 Jul 2024 08:00:04 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id baaaab39-4992-11ef-bbfe-fd08da9f4363;
 Wed, 24 Jul 2024 10:00:03 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a7a8553db90so196421966b.2
 for <win-pv-devel@lists.xenproject.org>; Wed, 24 Jul 2024 01:00:01 -0700 (PDT)
Received: from [192.168.12.134] (54-240-197-235.amazon.com. [54.240.197.235])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7a3c9273a5sm618025366b.165.2024.07.24.00.59.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 24 Jul 2024 01:00:00 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: baaaab39-4992-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721808001; x=1722412801; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:content-language
         :references:cc:to:subject:reply-to:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=RnsvKqZhATC2jo5olae/HL/IPwrxu/swdkpXO1mOuI8=;
        b=MRyIti2QelRSHIoOxntXaxC5l8kozsAKxrOFTe8+qpIGEkxz8e0IKULF0uIKiRxwu0
         C+XhHXiQuCB/wn+puenvThI8n1pcPj2m/b42wJ2+N09L3ZMk/3Gzy+OGn/8Dt4mi5sEw
         6dp8x/rB8oiZ5y7LvsGWYPuX0CTfYkqgRuKAT1H0IAldn+des75fA7+zH8GcLbD8M0kQ
         y8/04vr8iPwlr+e3DG8uqv3vkoOO8IDoTUvVn5R1tu9WNCz2FQAE+e7BYWEz5sSegrgk
         SXliwXw6EfiHKwCnYYD/bt48CJGlVOrdebA1tKtjf56BcXmsTqYgwRh65nmEQcrz9HLA
         9PVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721808001; x=1722412801;
        h=content-transfer-encoding:in-reply-to:organization:content-language
         :references:cc:to:subject:reply-to:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=RnsvKqZhATC2jo5olae/HL/IPwrxu/swdkpXO1mOuI8=;
        b=VqyXRBhfq/BfqRCzi/VkWjy9S1d/CPPTQYTmJnhQDYQeIF0kcfxCxXuVpcm2s1nsnR
         jbP/JOwlhk2uOWuAWPLA+yy4v++9vJk6EfhhEnOJyy0DuKTErzSE+AE9bnGmlgdsEbz8
         hhgnghIs7KYkhZZykj6yEnMkEBRn/Fts8AVMz/3d7QCdi8u0skG36NwXCWMq3Hp+j29h
         UIY2c7MRhHXwPgDOgH9a3i1HfloOi8/8JSDPJWTRhWtxWtN+6xZ56ffoJ5W+PUfIAxKO
         fJT+FL/VOkhMB0ayMp6VdNokULjIkrj0k6R+vwFH3CNBHQvNWQRlDzbV7JzPGmw93N1B
         /CGQ==
X-Forwarded-Encrypted: i=1; AJvYcCUJ38ANJuLL04tr0k92YSxjadiQu65lwxwTjFYVqITFtNCf4sfLgrqdnIKrDwmiVLBr+Z8uNV7nDwV9bqAjn7Cdyo2hSyQVMDzKQhuOHqOh/Gc=
X-Gm-Message-State: AOJu0Yw51Q8Vif/9vmjgHa+f3U38fQYUGMxTRgrYceNarXrWJSwtF2NB
	d07aU25iuhpxMWIFEmAewqlso3c8LEtZR7GKVBrWEF0+8yUCMOe0
X-Google-Smtp-Source: AGHT+IFQCVADRKDIejBPnqji/N/p7uPKXGsapgT8EFBN14wejdLO5OMnHTtUmWpFzF9mZ4Fc1fYo3A==
X-Received: by 2002:a17:906:dc8f:b0:a7a:b561:3575 with SMTP id a640c23a62f3a-a7ab5616665mr56905766b.56.1721808001118;
        Wed, 24 Jul 2024 01:00:01 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <ccb7abc8-01b9-4a9b-b56c-624545fe92b4@xen.org>
Date: Wed, 24 Jul 2024 08:59:56 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Reply-To: paul@xen.org
Subject: Re: Update maintainers file
To: Kelly Choi <kelly.choi@cloud.com>
Cc: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <CAO-mL=yK45Zc4a3gWtZsL4jMjextF9AVtjYezrngt=0TJn_RPg@mail.gmail.com>
 <99d03fea-a4e6-4139-964b-354327747deb@xen.org>
 <CAC_UY8_Mo+QOgOT=zFK0+GyWjLOpeaX8A_dZzXpaiz6fB_LPYw@mail.gmail.com>
 <3e6c98fb-2a10-4746-a5e5-107ef7d7303a@xen.org>
 <CAO-mL=w5M_nM1W9t-MDQy1EmL6XxW_jAqF=WEERuJNJSnH_JTQ@mail.gmail.com>
Content-Language: en-US
Organization: Xen Project
In-Reply-To: <CAO-mL=w5M_nM1W9t-MDQy1EmL6XxW_jAqF=WEERuJNJSnH_JTQ@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

SGkgS2VsbHksDQoNCiAgIEkgaGF2ZSB1cGRhdGVkIHRoZSBNQUlOVEFJTkVSUyBmaWxlIGlu
IGFsbCByZXBvcyBub3cuDQoNCiAgIENoZWVycywNCg0KICAgICBQYXVsDQoNCk9uIDE2LzA3
LzIwMjQgMTI6NTQsIEtlbGx5IENob2kgd3JvdGU6DQo+IEhpIGJvdGgsDQo+IA0KPiBKdXN0
IGZvbGxvd2luZyB0aGlzIHVwLg0KPiBQbGVhc2UgY2FuIHlvdSBsZXQgbWUga25vdyBvbmNl
IHRoaXMgaGFzIGJlZW4gdXBkYXRlZD8NCj4gDQo+IE1hbnkgdGhhbmtzLA0KPiBLZWxseSBD
aG9pDQo+IA0KPiBDb21tdW5pdHkgTWFuYWdlcg0KPiBYZW4gUHJvamVjdA0KPiANCj4gDQo+
IE9uIFR1ZSwgSnVsIDIsIDIwMjQgYXQgOTo1NuKAr0FNIFBhdWwgRHVycmFudCA8eGFkaW1n
bmlrQGdtYWlsLmNvbSANCj4gPG1haWx0bzp4YWRpbWduaWtAZ21haWwuY29tPj4gd3JvdGU6
DQo+IA0KPiAgICAgT24gMDIvMDcvMjAyNCAwOTo0NywgT3dlbiBTbWl0aCB3cm90ZToNCj4g
ICAgICA+IFRoZcKgQGNpdHJpeC5jb20gPGh0dHA6Ly9jaXRyaXguY29tPiA8aHR0cDovL2Np
dHJpeC5jb20NCj4gICAgIDxodHRwOi8vY2l0cml4LmNvbT4+IGFkZHJlc3MgaXMgcmVkaXJl
Y3RlZCB0byB0aGUNCj4gICAgICA+IEBjbG91ZC5jb20gPGh0dHA6Ly9jbG91ZC5jb20+IDxo
dHRwOi8vY2xvdWQuY29tDQo+ICAgICA8aHR0cDovL2Nsb3VkLmNvbT4+IGFkZHJlc3MsIGJ1
dCB1cGRhdGluZyB0byB0aGXCoEBjbG91ZC5jb20NCj4gICAgIDxodHRwOi8vY2xvdWQuY29t
Pg0KPiAgICAgID4gPGh0dHA6Ly9jbG91ZC5jb20gPGh0dHA6Ly9jbG91ZC5jb20+PiBhZGRy
ZXNzIHdpbGwgYmUgYmVzdC4NCj4gICAgICA+DQo+IA0KPiAgICAgT2suIEknbGwgc2VuZCBh
IHBhdGNoLg0KPiANCj4gICAgIFBhdWwNCj4gDQo+ICAgICAgPiBPd2VuDQo+ICAgICAgPg0K
PiAgICAgID4gT24gVHVlLCBKdWwgMiwgMjAyNCBhdCA5OjI04oCvQU0gUGF1bCBEdXJyYW50
IDx4YWRpbWduaWtAZ21haWwuY29tDQo+ICAgICA8bWFpbHRvOnhhZGltZ25pa0BnbWFpbC5j
b20+DQo+ICAgICAgPiA8bWFpbHRvOnhhZGltZ25pa0BnbWFpbC5jb20gPG1haWx0bzp4YWRp
bWduaWtAZ21haWwuY29tPj4+IHdyb3RlOg0KPiAgICAgID4NCj4gICAgICA+wqAgwqAgwqBP
biAwMS8wNy8yMDI0IDEzOjUxLCBLZWxseSBDaG9pIHdyb3RlOg0KPiAgICAgID7CoCDCoCDC
oCA+IEhpIGFsbCwNCj4gICAgICA+wqAgwqAgwqAgPg0KPiAgICAgID7CoCDCoCDCoCA+IFBs
ZWFzZSBjYW4gd2UgdXBkYXRlIHRoZSBtYWludGFpbmVyJ3MgZmlsZSBmb3IgV2luZG93cyBQ
Vg0KPiAgICAgRHJpdmVycz8NCj4gICAgICA+wqAgwqAgwqAgPg0KPiAgICAgID7CoCDCoCDC
oCA+IEJlbiBDaGFsbWVycyBzaG91bGQgYmUgcmVtb3ZlZCBhcyBoZSBubyBsb25nZXIgd29y
a3MgYXQNCj4gICAgIENpdHJpeC4NCj4gICAgICA+wqAgwqAgwqAgPg0KPiAgICAgID7CoCDC
oCDCoCA+DQo+ICAgICAgPg0KPiAgICAgaHR0cHM6Ly94ZW5iaXRzLnhlbnByb2plY3Qub3Jn
L2dpdHdlYi8/cD1wdmRyaXZlcnMvd2luL3hlbmJ1cy5naXQ7YT1ibG9iO2Y9TUFJTlRBSU5F
UlM7aD1jYzU5NjE4ZmU1NGIxMmJkNTFiNTZkYmI3ZDA5NjE0MjIxZDgzNmU2O2hiPUhFQUQg
PGh0dHBzOi8veGVuYml0cy54ZW5wcm9qZWN0Lm9yZy9naXR3ZWIvP3A9cHZkcml2ZXJzL3dp
bi94ZW5idXMuZ2l0O2E9YmxvYjtmPU1BSU5UQUlORVJTO2g9Y2M1OTYxOGZlNTRiMTJiZDUx
YjU2ZGJiN2QwOTYxNDIyMWQ4MzZlNjtoYj1IRUFEPiA8aHR0cHM6Ly94ZW5iaXRzLnhlbnBy
b2plY3Qub3JnL2dpdHdlYi8/cD1wdmRyaXZlcnMvd2luL3hlbmJ1cy5naXQ7YT1ibG9iO2Y9
TUFJTlRBSU5FUlM7aD1jYzU5NjE4ZmU1NGIxMmJkNTFiNTZkYmI3ZDA5NjE0MjIxZDgzNmU2
O2hiPUhFQUQgPGh0dHBzOi8veGVuYml0cy54ZW5wcm9qZWN0Lm9yZy9naXR3ZWIvP3A9cHZk
cml2ZXJzL3dpbi94ZW5idXMuZ2l0O2E9YmxvYjtmPU1BSU5UQUlORVJTO2g9Y2M1OTYxOGZl
NTRiMTJiZDUxYjU2ZGJiN2QwOTYxNDIyMWQ4MzZlNjtoYj1IRUFEPj4gPGh0dHBzOi8veGVu
Yml0cy54ZW5wcm9qZWN0Lm9yZy9naXR3ZWIvP3A9cHZkcml2ZXJzL3dpbi94ZW5idXMuZ2l0
O2E9YmxvYjtmPU1BSU5UQUlORVJTO2g9Y2M1OTYxOGZlNTRiMTJiZDUxYjU2ZGJiN2QwOTYx
NDIyMWQ4MzZlNjtoYj1IRUFEIDxodHRwczovL3hlbmJpdHMueGVucHJvamVjdC5vcmcvZ2l0
d2ViLz9wPXB2ZHJpdmVycy93aW4veGVuYnVzLmdpdDthPWJsb2I7Zj1NQUlOVEFJTkVSUzto
PWNjNTk2MThmZTU0YjEyYmQ1MWI1NmRiYjdkMDk2MTQyMjFkODM2ZTY7aGI9SEVBRD4gPGh0
dHBzOi8veGVuYml0cy54ZW5wcm9qZWN0Lm9yZy9naXR3ZWIvP3A9cHZkcml2ZXJzL3dpbi94
ZW5idXMuZ2l0O2E9YmxvYjtmPU1BSU5UQUlORVJTO2g9Y2M1OTYxOGZlNTRiMTJiZDUxYjU2
ZGJiN2QwOTYxNDIyMWQ4MzZlNjtoYj1IRUFEIDxodHRwczovL3hlbmJpdHMueGVucHJvamVj
dC5vcmcvZ2l0d2ViLz9wPXB2ZHJpdmVycy93aW4veGVuYnVzLmdpdDthPWJsb2I7Zj1NQUlO
VEFJTkVSUztoPWNjNTk2MThmZTU0YjEyYmQ1MWI1NmRiYjdkMDk2MTQyMjFkODM2ZTY7aGI9
SEVBRD4+Pg0KPiAgICAgID7CoCDCoCDCoCA+DQo+ICAgICAgPg0KPiAgICAgID7CoCDCoCDC
oFdpbGwgZG8uDQo+ICAgICAgPg0KPiAgICAgID7CoCDCoCDCoE93ZW4sIGlzIHlvdXIgQGNp
dHJpeC5jb20gPGh0dHA6Ly9jaXRyaXguY29tPg0KPiAgICAgPGh0dHA6Ly9jaXRyaXguY29t
IDxodHRwOi8vY2l0cml4LmNvbT4+IGFkZHJlc3Mgc3RpbGwgdmFsaWQgb3INCj4gICAgICA+
wqAgwqAgwqBkb2VzIGl0IG5lZWQgdG8gYmUNCj4gICAgICA+wqAgwqAgwqB1cGRhdGVkIHRv
IEBjbG91ZC5jb20gPGh0dHA6Ly9jbG91ZC5jb20+IDxodHRwOi8vY2xvdWQuY29tDQo+ICAg
ICA8aHR0cDovL2Nsb3VkLmNvbT4+Pw0KPiAgICAgID4NCj4gDQo+IA0KDQo=


From win-pv-devel-bounces@lists.xenproject.org Wed Jul 24 08:06:31 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jul 2024 08:06:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.763876.1174212 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWX14-0006bK-Pu; Wed, 24 Jul 2024 08:06:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 763876.1174212; Wed, 24 Jul 2024 08:06:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWX14-0006bD-NG; Wed, 24 Jul 2024 08:06:30 +0000
Received: by outflank-mailman (input) for mailman id 763876;
 Wed, 24 Jul 2024 08:06:29 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i0Yy=OY=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sWX13-0006Zp-MZ
 for win-pv-devel@lists.xenproject.org; Wed, 24 Jul 2024 08:06:29 +0000
Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com
 [2a00:1450:4864:20::32e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a095b627-4993-11ef-8776-851b0ebba9a2;
 Wed, 24 Jul 2024 10:06:28 +0200 (CEST)
Received: by mail-wm1-x32e.google.com with SMTP id
 5b1f17b1804b1-4267345e746so48253295e9.0
 for <win-pv-devel@lists.xenproject.org>; Wed, 24 Jul 2024 01:06:27 -0700 (PDT)
Received: from [192.168.12.134] (54-240-197-227.amazon.com. [54.240.197.227])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-427f9397204sm17827435e9.21.2024.07.24.01.06.26
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 24 Jul 2024 01:06:26 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a095b627-4993-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721808387; x=1722413187; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=HuODlOfid1YA90unVjiWuh2mBCgJeTDCjKnJzgeHyKY=;
        b=CRjEpOfDF+QEOuPK27QtouFlAxvT4D6RE/lLGNv+trRsCx7V7ttDLA0DQaeKigxTzu
         FIwGo0MTNTFNnSjrUmQiJT1DZoxyPtiRbAd+ZWVkYCxl0sPBs/kkUvDCDQMIhx0bLfh4
         nZF1/ACnJXUG4VTHqlF0XAAhv0pUxPkg+ESf8rrJcWu9rg34fH7VyfXpnTHP79ZxofVm
         /4EItrAKLMsvEVPS9Rgy7eSHGF6CXevncCyyvHxt376/4y92O/UosyaZJc5kd5CiOoMj
         e62ZOcaXiVH4QhSP7ztvrJiTKMHE2ou8/NKgoC57zcbiYYChOw8XgyWMk5XdlZEMJuSt
         Axog==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721808387; x=1722413187;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=HuODlOfid1YA90unVjiWuh2mBCgJeTDCjKnJzgeHyKY=;
        b=gHJ7/nJVkK2N3SGVuXeaZuSW/ixtTIzzYX96B/yElY+m1M3D1ST2uOyyUzFoclui8K
         8IhSeR75ZbbtdfNvMU9Bm6I8U6XSTyPGt1DTpgzNq3b4cbqFEpVy+jnIfGwvgYZCf9UV
         d8DmHr1UwzoAkfDbPRkmQoyHuZXpI3wl306iB4+AuKWMv00EeKMkxjb9bMzQ3Hm6kWJ3
         ECaV2wVRucKFshIyM/x5h9/FOvgcXgsFBLBuGQNm79RcLh9jujIViZzc9xqKnphjPuQD
         Cbg8ldiZlEUduwwGYxs9ascoXo8/vLXU6Q/5J5UJpgE+bcIRE+oSLVjh9+4qfv929F4x
         7v/w==
X-Gm-Message-State: AOJu0Ywc7RJ8UUhRoumL0uMElhIRcRpBisVGX7ilHcd59psY3r2dBusy
	BjXTfFU5vkXaIY2A5CVlPPhK4hy/8wU4OY+WbehKZysuRNMKkVbOJ821+eRV
X-Google-Smtp-Source: AGHT+IExNkZyvs5GRuymlzxs/5BbE8uzLeib2kWsBakrIdiXAw9cys98i+wwDD0C6oaUSsNk4k2DZw==
X-Received: by 2002:a05:600c:4506:b0:426:6157:7ad3 with SMTP id 5b1f17b1804b1-427dc524d30mr79460475e9.19.1721808386883;
        Wed, 24 Jul 2024 01:06:26 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <005cf480-27df-4b09-a813-608d2ffc38d9@xen.org>
Date: Wed, 24 Jul 2024 09:06:22 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XENNET PATCH 1/2] Report NDIS minor version as expected by OS
To: win-pv-devel@lists.xenproject.org
References: <20240709104811.987-1-owen.smith@cloud.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <20240709104811.987-1-owen.smith@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 09/07/2024 11:48, Owen Smith wrote:
> WHQL requires NDIS minor versions to match the OS under test.
> For Server 2022, this requires NDIS version 6.85 and Server 2025 requires
> NDIS version 6.89.
> In order to build with EWDK 22000, the reported version is echoed from the
> call to NdisGetVersion() without requiring updated headers.
> 
> Note: NDIS 6.89 does add support for UDP Receive Segment Coalescing Offload
> (URO), but XenNet does not support this new NDIS feature.
> 
> Signed-off-by: Owen Smith <owen.smith@cloud.com>
> ---
>   src/xennet/miniport.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/xennet/miniport.c b/src/xennet/miniport.c
> index 5dc9858..10717fa 100644
> --- a/src/xennet/miniport.c
> +++ b/src/xennet/miniport.c
> @@ -348,16 +348,16 @@ MiniportRegister(
>           MiniportDriverCharacteristics.Header.Size = NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3;
>           MiniportDriverCharacteristics.Header.Revision = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3;
>   
> -        MiniportDriverCharacteristics.MajorNdisVersion = NDIS_MINIPORT_MAJOR_VERSION; // 6
> -        MiniportDriverCharacteristics.MinorNdisVersion = NDIS_MINIPORT_MINOR_VERSION; // 85
> +        MiniportDriverCharacteristics.MajorNdisVersion = 6;
> +        MiniportDriverCharacteristics.MinorNdisVersion = (UCHAR)(NdisGetVersion() & 0x00FF);

NdisGetVersion() should also return the 6 as well. I don't think we 
should be hardcoding the major and dynamically determining the minor... 
either both hardcoded, or neither.

>       } else
>   #endif
>       if (NdisGetVersion() >= NDIS_RUNTIME_VERSION_660) {
>           MiniportDriverCharacteristics.MajorNdisVersion = 6;
>           MiniportDriverCharacteristics.MinorNdisVersion = 60;
>       } else {
> -        MiniportDriverCharacteristics.MajorNdisVersion = NDIS_MINIPORT_MINIMUM_MAJOR_VERSION; // 6
> -        MiniportDriverCharacteristics.MinorNdisVersion = NDIS_MINIPORT_MINIMUM_MINOR_VERSION; // 30
> +        MiniportDriverCharacteristics.MajorNdisVersion = 6;
> +        MiniportDriverCharacteristics.MinorNdisVersion = 30;
>       }
>   
>       MiniportDriverCharacteristics.MajorDriverVersion = MAJOR_VERSION;



From win-pv-devel-bounces@lists.xenproject.org Wed Jul 24 08:07:30 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jul 2024 08:07:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.763884.1174216 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWX21-00071a-TL; Wed, 24 Jul 2024 08:07:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 763884.1174216; Wed, 24 Jul 2024 08:07:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWX21-00071T-QT; Wed, 24 Jul 2024 08:07:29 +0000
Received: by outflank-mailman (input) for mailman id 763884;
 Wed, 24 Jul 2024 08:07:29 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i0Yy=OY=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sWX20-0006Zp-Tr
 for win-pv-devel@lists.xenproject.org; Wed, 24 Jul 2024 08:07:28 +0000
Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com
 [2a00:1450:4864:20::335])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c437d33f-4993-11ef-8776-851b0ebba9a2;
 Wed, 24 Jul 2024 10:07:27 +0200 (CEST)
Received: by mail-wm1-x335.google.com with SMTP id
 5b1f17b1804b1-42660b8dd27so46771315e9.3
 for <win-pv-devel@lists.xenproject.org>; Wed, 24 Jul 2024 01:07:27 -0700 (PDT)
Received: from [192.168.12.134] (54-240-197-227.amazon.com. [54.240.197.227])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-427f938d63csm17461835e9.20.2024.07.24.01.07.26
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 24 Jul 2024 01:07:26 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c437d33f-4993-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721808447; x=1722413247; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=CF32mzKIcL9feNVh1yzFbKrGXHzzeBbHkij5E9nT/vI=;
        b=FeJSiOfz5EAlZbaJfJ89eSEMDuZgsMa54LxxDvDz3hndghrnSo7XHJuXRQ7Ts0dUv1
         F4yQcdjqX+gyt6TjqYj2qAc5pR43Z7jc8sJslYeje/jqVd8Owfp6h7ybQr2VceHEx471
         rz0uNot+S59//Tnsr08XICMCd13lNRJrqw3vHF2DW0xdNhF2sV345P5YpDIKgHBQknaH
         7R1XdRLYDiyFKiO2IPxuNORrJ7ujKeoIEn8reZEbrT9NdKPaXkmDmKAmlu52mXB+AEF+
         utSICgyMp3SeVTlxKhWNlfj6HeSOGIODXjawCaudZlnjFou1phxjJFvljd79qejq2X9n
         xAsA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721808447; x=1722413247;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=CF32mzKIcL9feNVh1yzFbKrGXHzzeBbHkij5E9nT/vI=;
        b=gYfr5p+wOSH4FcdbUQMj60n3Az7IkmU6OA/hp8sNggENIdqVbF7on2vHkTQ/Zfrf6q
         7dp8+g4qo91z0hjI16agOSxDgW3qoyD8NFn7ZH7Sf3ch5bKyqg1AbJb7W9JSIWLoeJ8i
         GjJwbgrSvAjovyqW1YmOp2+kTGKnlsOSjTO41PXy+PnvQ6FRtCViyJ3sK7jP2UKeRAE3
         IMKqx5Ea/GlrS1DWOUGi6ULwpXWT5jG1DjTBCQcNwbELvPM4MCeCdSDe7p646riElFX3
         sFzZ+SYAwi03U+goc6eyinOQVI5iAhcA7pDS0YiVxZ4ifLi4OIoJ214k2QIwIIUhC5aH
         JUkw==
X-Gm-Message-State: AOJu0YxgNTt17QfhOcScrNgAaOcP51iQ+EpGa5dKI9qMPemeaBKBvEb9
	Us0blyBcKVGTTbZPVwezclZoBUDgRsUsFQKg7fyGfnkwP+uGqW9mdrd4Nblg
X-Google-Smtp-Source: AGHT+IHVYMNqHxjL58VACwxsIwXJ4DUxJNyZy2z4GqggmxG4bbqB9QCnfogVqXAfiuZIfj0JSHaoSg==
X-Received: by 2002:a05:600c:4750:b0:426:689b:65c4 with SMTP id 5b1f17b1804b1-427dc56a0bdmr90011725e9.31.1721808446745;
        Wed, 24 Jul 2024 01:07:26 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <710135d3-2558-4eaa-ac1c-b984bc3f73d9@xen.org>
Date: Wed, 24 Jul 2024 09:07:22 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XENNET PATCH 2/2] Bump binding to 0x09000005
To: win-pv-devel@lists.xenproject.org
References: <20240709104811.987-1-owen.smith@cloud.com>
 <20240709104811.987-2-owen.smith@cloud.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <20240709104811.987-2-owen.smith@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 09/07/2024 11:48, Owen Smith wrote:
> Require UNPLUGv3 be present, so that Windows Update will only attempt
> to install this driver on a xenvif that does not return an error code
> from PdoStartDevice during normal operation.
> 
> Signed-off-by: Owen Smith <owen.smith@cloud.com>
> ---
>   src/xennet.inf | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 

Acked-by: Paul Durrant <paul@xen.org>



From win-pv-devel-bounces@lists.xenproject.org Wed Jul 24 08:12:49 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jul 2024 08:12:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.763895.1174221 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWX7A-00085S-B9; Wed, 24 Jul 2024 08:12:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 763895.1174221; Wed, 24 Jul 2024 08:12:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWX7A-00085L-7T; Wed, 24 Jul 2024 08:12:48 +0000
Received: by outflank-mailman (input) for mailman id 763895;
 Wed, 24 Jul 2024 08:12:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i0Yy=OY=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sWX78-00085F-Jq
 for win-pv-devel@lists.xenproject.org; Wed, 24 Jul 2024 08:12:46 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 810a1a52-4994-11ef-8776-851b0ebba9a2;
 Wed, 24 Jul 2024 10:12:44 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a728f74c23dso143447766b.1
 for <win-pv-devel@lists.xenproject.org>; Wed, 24 Jul 2024 01:12:44 -0700 (PDT)
Received: from [192.168.12.134] (54-240-197-235.amazon.com. [54.240.197.235])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7aa6fea966sm90012066b.223.2024.07.24.01.12.42
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 24 Jul 2024 01:12:42 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 810a1a52-4994-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721808763; x=1722413563; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=uXf9SKlN+4uz7bgWg3h+Lr3rLiNvPLBG4/HD+t7Yy44=;
        b=O13GD+GEczZSvX+BYkEr1CLwQVLd//684ONUd6yaZAIcpslWlok9BY/9ovPv8pLTOV
         GPUeDjT9ad4HnkWw70jybOZcvD7F1OR5gAHdjKmo8ifUd9ZoUAvnu+0RfgreOslRvP2e
         lh+gFcA++DaS4c6XGvxkAiVPWnYhHQNB6WyRfffxyKufjOU+gZ612UGryF1ibFcvQt4W
         dOF41vYBa4Gq3/a6KngujT/MJ8nLlnIJB0dF+50WC9Hg3eXPZ0LfLw79wh67DjxwtayI
         HJkx1PSd0zdX/n99GwYv5H/NaqhMSyB0fzVsu0EcVY/m/3vQPuf8L3sbBZ5Ilso7n78/
         ZlBA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721808763; x=1722413563;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=uXf9SKlN+4uz7bgWg3h+Lr3rLiNvPLBG4/HD+t7Yy44=;
        b=dTS2rDS1G9uWY6dmFiGhxRhZOM+lkjqBpeoiVVkENEbLMzQT+ja/5z+ZuLv6tvfg+V
         tcD+ZDVXecgESIcqcUPJ9Bbu8LsKkiBJw8c6dmtA2t1XofMGXKJgZvWLEPTmyGHdnX8j
         W7n+h0sKqGA1duMuBNWbqHKw0YuduSkUpdosJLopdJSbEQWRRl5LopLSCN18y5j+Irro
         OsWsRn1iotmaeQgWdiFCgUiTss4948QY/kaCCRNpKtUdfK0fIYxn8PE5uql2btBUHFHQ
         aGwUzo++VEMDm85w7sCry7qTCuXgi9p/KqjDy0SzJLlnYK1ZsHbug31Cn3ow9MpQ2SXN
         kBfQ==
X-Gm-Message-State: AOJu0Yxo4MDgPxJvFC5AmiJl6zzELCpLEmKy+H1h3vKGXhYubP/QuooC
	+o42Q4tDgDLHv4oJ3ouX/VPVXygogSkuItLjuS1JTOEkt/Ek2jGz+emcXpE9
X-Google-Smtp-Source: AGHT+IHR3tQgl8BPTPOfWpLgQyyzODIM8EiM0JTqaVJX0i6FwGFtncd70Da/U+I3sLAxX6nhN3GbmQ==
X-Received: by 2002:a17:907:3f0a:b0:a77:eb34:3b44 with SMTP id a640c23a62f3a-a7ab0de8fdamr99999666b.30.1721808762996;
        Wed, 24 Jul 2024 01:12:42 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <c838bfdc-4abe-4f95-b114-0e6dfcb95a79@xen.org>
Date: Wed, 24 Jul 2024 09:12:38 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XENVIF PATCH 2/3] Fix Registry Isolation issues with Server 2025
To: win-pv-devel@lists.xenproject.org
References: <20240709104500.1392-1-owen.smith@cloud.com>
 <20240709104500.1392-2-owen.smith@cloud.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <20240709104500.1392-2-owen.smith@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 09/07/2024 11:44, Owen Smith wrote:
> Use MmGetSystemRoutineAddress to dynamically get IoOpenDriverRegistryKey,
> which is not present on Server 2016.
> Where possible, use IoOpenDriverRegistryKey to avoid opening absolute registry
> paths, which is a driver verifier violation on Server 2025 WHQL testing.
> 
> This does remove PdoSetFriendlyName and SettingsSave/SettingsRestore
> - PdoSetFriendlyName gets an absolute path to the parent of a key opened by an
>    allowed API
> - SettingsSave/SettingsRestore directly manipulate several absolute paths, but
>    due to the recent DeviceID changes, the settings copy code should not be
>    neccessary, as the network connection will not be re-created on driver update.
> 

What abou when moving from an emulated device to the PV device? That's 
why all the settings copy nastiness was originally implemented... it 
wasn't about PV driver update.

> Signed-off-by: Owen Smith <owen.smith@cloud.com>
> ---
>   src/xenvif/driver.c          | 113 +-----
>   src/xenvif/driver.h          |  10 -
>   src/xenvif/pdo.c             | 151 +-------
>   src/xenvif/registry.c        |  72 +++-
>   src/xenvif/registry.h        |   9 +-
>   src/xenvif/settings.c        | 694 -----------------------------------
>   src/xenvif/settings.h        |  54 ---
>   vs2019/xenvif/xenvif.vcxproj |   1 -
>   vs2022/xenvif/xenvif.vcxproj |   1 -
>   9 files changed, 87 insertions(+), 1018 deletions(-)
>   delete mode 100644 src/xenvif/settings.c
>   delete mode 100644 src/xenvif/settings.h
> 
> diff --git a/src/xenvif/driver.c b/src/xenvif/driver.c
> index 3345607..2ac793d 100644
> --- a/src/xenvif/driver.c
> +++ b/src/xenvif/driver.c
> @@ -120,54 +120,6 @@ DriverGetParametersKey(
>       return __DriverGetParametersKey();
>   }
>   
> -static FORCEINLINE VOID
> -__DriverSetAddressesKey(
> -    IN  HANDLE  Key
> -    )
> -{
> -    Driver.AddressesKey = Key;
> -}
> -
> -static FORCEINLINE HANDLE
> -__DriverGetAddressesKey(
> -    VOID
> -    )
> -{
> -    return Driver.AddressesKey;
> -}
> -
> -HANDLE
> -DriverGetAddressesKey(
> -    VOID
> -    )
> -{
> -    return __DriverGetAddressesKey();
> -}
> -
> -static FORCEINLINE VOID
> -__DriverSetSettingsKey(
> -    IN  HANDLE  Key
> -    )
> -{
> -    Driver.SettingsKey = Key;
> -}
> -
> -static FORCEINLINE HANDLE
> -__DriverGetSettingsKey(
> -    VOID
> -    )
> -{
> -    return Driver.SettingsKey;
> -}
> -
> -HANDLE
> -DriverGetSettingsKey(
> -    VOID
> -    )
> -{
> -    return __DriverGetSettingsKey();
> -}
> -
>   #define MAXNAMELEN  256
>   
>   static FORCEINLINE VOID
> @@ -265,8 +217,6 @@ DriverUnload(
>       IN  PDRIVER_OBJECT  DriverObject
>       )
>   {
> -    HANDLE              SettingsKey;
> -    HANDLE              AddressesKey;
>       HANDLE              ParametersKey;
>   
>       ASSERT3P(DriverObject, ==, __DriverGetDriverObject());
> @@ -275,16 +225,6 @@ DriverUnload(
>   
>       Driver.NeedReboot = FALSE;
>   
> -    SettingsKey = __DriverGetSettingsKey();
> -    __DriverSetSettingsKey(NULL);
> -
> -    RegistryCloseKey(SettingsKey);
> -
> -    AddressesKey = __DriverGetAddressesKey();
> -    __DriverSetAddressesKey(NULL);
> -
> -    RegistryCloseKey(AddressesKey);
> -
>       ParametersKey = __DriverGetParametersKey();
>       __DriverSetParametersKey(NULL);
>   
> @@ -401,10 +341,7 @@ DriverEntry(
>       IN  PUNICODE_STRING RegistryPath
>       )
>   {
> -    HANDLE              ServiceKey;
>       HANDLE              ParametersKey;
> -    HANDLE              AddressesKey;
> -    HANDLE              SettingsKey;
>       ULONG               Index;
>       NTSTATUS            status;
>   
> @@ -428,43 +365,16 @@ DriverEntry(
>            MONTH,
>            YEAR);
>   
> -    status = RegistryInitialize(RegistryPath);
> +    status = RegistryInitialize(DriverObject, RegistryPath);
>       if (!NT_SUCCESS(status))
>           goto fail1;
>   
> -    status = RegistryOpenServiceKey(KEY_ALL_ACCESS, &ServiceKey);
> +    status = RegistryOpenParametersKey(KEY_READ, &ParametersKey);
>       if (!NT_SUCCESS(status))
>           goto fail2;
>   
> -    status = RegistryOpenSubKey(ServiceKey,
> -                                "Parameters",
> -                                KEY_READ,
> -                                &ParametersKey);
> -    if (!NT_SUCCESS(status))
> -        goto fail3;
> -
>       __DriverSetParametersKey(ParametersKey);
>   
> -    status = RegistryCreateSubKey(ServiceKey,
> -                                  "Addresses",
> -                                  REG_OPTION_VOLATILE,
> -                                  &AddressesKey);
> -    if (!NT_SUCCESS(status))
> -        goto fail4;
> -
> -    __DriverSetAddressesKey(AddressesKey);
> -
> -    status = RegistryCreateSubKey(ServiceKey,
> -                                  "Settings",
> -                                  REG_OPTION_NON_VOLATILE,
> -                                  &SettingsKey);
> -    if (!NT_SUCCESS(status))
> -        goto fail5;
> -
> -    __DriverSetSettingsKey(SettingsKey);
> -
> -    RegistryCloseKey(ServiceKey);
> -
>       DriverObject->DriverExtension->AddDevice = AddDevice;
>   
>       for (Index = 0; Index <= IRP_MJ_MAXIMUM_FUNCTION; Index++) {
> @@ -477,25 +387,6 @@ DriverEntry(
>   
>       return STATUS_SUCCESS;
>   
> -fail5:
> -    Error("fail5\n");
> -
> -    __DriverSetAddressesKey(NULL);
> -
> -    RegistryCloseKey(AddressesKey);
> -
> -fail4:
> -    Error("fail4\n");
> -
> -    __DriverSetParametersKey(NULL);
> -
> -    RegistryCloseKey(ParametersKey);
> -
> -fail3:
> -    Error("fail3\n");
> -
> -    RegistryCloseKey(ServiceKey);
> -
>   fail2:
>       Error("fail2\n");
>   
> diff --git a/src/xenvif/driver.h b/src/xenvif/driver.h
> index b5b9a3d..a9b47d4 100644
> --- a/src/xenvif/driver.h
> +++ b/src/xenvif/driver.h
> @@ -48,16 +48,6 @@ DriverGetParametersKey(
>       VOID
>       );
>   
> -extern HANDLE
> -DriverGetAddressesKey(
> -    VOID
> -    );
> -
> -extern HANDLE
> -DriverGetSettingsKey(
> -    VOID
> -    );
> -
>   extern VOID
>   DriverRequestReboot(
>       VOID
> diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
> index 8ec9814..51cbd97 100644
> --- a/src/xenvif/pdo.c
> +++ b/src/xenvif/pdo.c
> @@ -54,7 +54,6 @@
>   #include "registry.h"
>   #include "thread.h"
>   #include "link.h"
> -#include "settings.h"
>   #include "dbg_print.h"
>   #include "assert.h"
>   #include "util.h"
> @@ -727,30 +726,16 @@ __PdoSetPermanentAddress(
>       IN  PCHAR       Buffer
>       )
>   {
> -    ANSI_STRING     Ansi[2];
>       NTSTATUS        status;
>   
>       status = __PdoParseAddress(Buffer, &Pdo->PermanentAddress);
>       if (!NT_SUCCESS(status))
>           goto fail1;
>   
> -    RtlZeroMemory(Ansi, sizeof (ANSI_STRING) * 2);
> -    RtlInitAnsiString(&Ansi[0], Buffer);
> -
> -    status = RegistryUpdateSzValue(DriverGetAddressesKey(),
> -                                   __PdoGetName(Pdo),
> -                                   REG_SZ,
> -                                   Ansi);
> -    if (!NT_SUCCESS(status))
> -        goto fail2;
> -
> -    Info("%s: %Z\n", __PdoGetName(Pdo), &Ansi[0]);
> +    Info("%s: %s\n", __PdoGetName(Pdo), Buffer);
>   
>       return STATUS_SUCCESS;
>   
> -fail2:
> -    Error("fail2\n");
> -
>   fail1:
>       Error("fail1 (%08x)\n", status);
>   
> @@ -778,68 +763,9 @@ __PdoClearPermanentAddress(
>       IN  PXENVIF_PDO Pdo
>       )
>   {
> -    (VOID) RegistryDeleteValue(DriverGetAddressesKey(),
> -                               __PdoGetName(Pdo));
> -
>       RtlZeroMemory(&Pdo->PermanentAddress, sizeof (ETHERNET_ADDRESS));
>   }
>   
> -static NTSTATUS
> -PdoSetFriendlyName(
> -    IN  PXENVIF_PDO Pdo,
> -    IN  HANDLE      SoftwareKey,
> -    IN  HANDLE      HardwareKey
> -    )
> -{
> -    PANSI_STRING    DriverDesc;
> -    CHAR            Buffer[MAXNAMELEN];
> -    ANSI_STRING     Ansi[2];
> -    NTSTATUS        status;
> -
> -    status = RegistryQuerySzValue(SoftwareKey,
> -                                  "DriverDesc",
> -                                  NULL,
> -                                  &DriverDesc);
> -    if (!NT_SUCCESS(status))
> -        goto fail1;
> -
> -    status = RtlStringCbPrintfA(Buffer,
> -                                MAXNAMELEN,
> -                                "%Z #%s",
> -                                &DriverDesc[0],
> -                                __PdoGetName(Pdo)
> -                                );
> -    if (!NT_SUCCESS(status))
> -        goto fail2;
> -
> -    RtlZeroMemory(Ansi, sizeof (ANSI_STRING) * 2);
> -    RtlInitAnsiString(&Ansi[0], Buffer);
> -
> -    status = RegistryUpdateSzValue(HardwareKey,
> -                                   "FriendlyName",
> -                                   REG_SZ,
> -                                   Ansi);
> -    if (!NT_SUCCESS(status))
> -        goto fail3;
> -
> -    Info("%s: %Z\n", __PdoGetName(Pdo), &Ansi[0]);
> -
> -    RegistryFreeSzValue(DriverDesc);
> -
> -    return STATUS_SUCCESS;
> -
> -fail3:
> -    Error("fail3\n");
> -
> -fail2:
> -    Error("fail2\n");
> -
> -fail1:
> -    Error("fail1 (%08x)\n", status);
> -
> -    return status;
> -}
> -
>   static FORCEINLINE NTSTATUS
>   __PdoSetCurrentAddress(
>       IN  PXENVIF_PDO Pdo,
> @@ -1276,15 +1202,13 @@ PdoUnplugRequested(
>   
>   static FORCEINLINE NTSTATUS
>   PdoParseMibTable(
> -    IN  PXENVIF_PDO     Pdo,
> -    IN  HANDLE          SoftwareKey
> +    IN  PXENVIF_PDO     Pdo
>       )
>   {
>       NTSTATUS            (*__GetIfTable2)(PMIB_IF_TABLE2 *);
>       VOID                (*__FreeMibTable)(PVOID);
>       PMIB_IF_TABLE2      Table;
>       ULONG               Index;
> -    GUID                Guid;
>       NTSTATUS            status;
>   
>       status = LinkGetRoutineAddress("netio.sys",
> @@ -1330,56 +1254,10 @@ PdoParseMibTable(
>           if (Row->OperStatus != IfOperStatusUp)
>               continue;
>   
> -        (VOID) SettingsSave(__PdoGetName(Pdo),
> -                            Row->Alias,
> -                            Row->Description,
> -                            &Row->InterfaceGuid,
> -                            &Row->InterfaceLuid);
> -
>           status = STATUS_PNP_REBOOT_REQUIRED;
>           goto fail4;
>       }
>   
> -    //
> -    // If there is a stack bound then restore any settings that
> -    // may have been saved from an aliasing device.
> -    //
> -    status = PdoGetInterfaceGuid(Pdo, SoftwareKey, &Guid);
> -    if (NT_SUCCESS(status)) {
> -        NET_LUID        Luid;
> -        PWCHAR          Alias;
> -        PWCHAR          Description;
> -
> -        RtlZeroMemory(&Luid, sizeof(NET_LUID));
> -        Alias = NULL;
> -        Description = NULL;
> -
> -        status = PdoGetInterfaceLuid(Pdo, SoftwareKey, &Luid);
> -        if (NT_SUCCESS(status)) {
> -            for (Index = 0; Index < Table->NumEntries; Index++) {
> -                PMIB_IF_ROW2    Row = &Table->Table[Index];
> -
> -                Trace("%s: CHECKING %ws (%ws)\n",
> -                    __PdoGetName(Pdo),
> -                    Row->Alias,
> -                    Row->Description);
> -
> -                if (Row->InterfaceLuid.Value != Luid.Value)
> -                    continue;
> -
> -                Alias = Row->Alias;
> -                Description = Row->Description;
> -                break;
> -            }
> -        }
> -
> -        (VOID) SettingsRestore(__PdoGetName(Pdo),
> -                               Alias,
> -                               Description,
> -                               &Guid,
> -                               &Luid);
> -    }
> -
>       __FreeMibTable(Table);
>   
>       return STATUS_SUCCESS;
> @@ -1408,7 +1286,6 @@ PdoStartDevice(
>       )
>   {
>       HANDLE              SoftwareKey;
> -    HANDLE              HardwareKey;
>       NTSTATUS            status;
>   
>       status = STATUS_UNSUCCESSFUL;
> @@ -1421,21 +1298,11 @@ PdoStartDevice(
>       if (!NT_SUCCESS(status))
>           goto fail2;
>   
> -    status = RegistryOpenHardwareKey(__PdoGetDeviceObject(Pdo),
> -                                     KEY_ALL_ACCESS,
> -                                     &HardwareKey);
> -    if (!NT_SUCCESS(status))
> -        goto fail3;
> -
> -    (VOID) PdoSetFriendlyName(Pdo,
> -                              SoftwareKey,
> -                              HardwareKey);
> -
>       status = __PdoSetCurrentAddress(Pdo, SoftwareKey);
>       if (!NT_SUCCESS(status))
> -        goto fail4;
> +        goto fail3;
>   
> -    status = PdoParseMibTable(Pdo, SoftwareKey);
> +    status = PdoParseMibTable(Pdo);
>       if (status == STATUS_PNP_REBOOT_REQUIRED || !PdoUnplugRequested(Pdo)) {
>           PdoUnplugRequest(Pdo, TRUE); // fix unplug reference count
>           DriverRequestReboot();
> @@ -1445,7 +1312,7 @@ PdoStartDevice(
>   
>       status = PdoD3ToD0(Pdo);
>       if (!NT_SUCCESS(status))
> -        goto fail5;
> +        goto fail4;
>   
>       PdoUnplugRequest(Pdo, TRUE);
>   
> @@ -1454,20 +1321,14 @@ PdoStartDevice(
>       Irp->IoStatus.Status = STATUS_SUCCESS;
>       IoCompleteRequest(Irp, IO_NO_INCREMENT);
>   
> -    RegistryCloseKey(HardwareKey);
>       RegistryCloseKey(SoftwareKey);
>   
>       return STATUS_SUCCESS;
>   
> -fail5:
> -    Error("fail5\n");
> -
> -    RtlZeroMemory(&Pdo->CurrentAddress, sizeof (ETHERNET_ADDRESS));
> -
>   fail4:
>       Error("fail4\n");
>   
> -    RegistryCloseKey(HardwareKey);
> +    RtlZeroMemory(&Pdo->CurrentAddress, sizeof (ETHERNET_ADDRESS));
>   
>   fail3:
>       Error("fail3\n");
> diff --git a/src/xenvif/registry.c b/src/xenvif/registry.c
> index 8f84818..792ce03 100644
> --- a/src/xenvif/registry.c
> +++ b/src/xenvif/registry.c
> @@ -38,8 +38,13 @@
>   
>   #define REGISTRY_TAG 'GERX'
>   
> +static PDRIVER_OBJECT   RegistryDriverObject;
>   static UNICODE_STRING   RegistryPath;
>   
> +typedef NTSTATUS(*IOOPENDRIVERREGISTRYKEY)(PDRIVER_OBJECT, DRIVER_REGKEY_TYPE, ACCESS_MASK, ULONG, PHANDLE);
> +
> +static IOOPENDRIVERREGISTRYKEY __IoOpenDriverRegistryKey;
> +
>   static FORCEINLINE PVOID
>   __RegistryAllocate(
>       IN  ULONG   Length
> @@ -58,9 +63,12 @@ __RegistryFree(
>   
>   NTSTATUS
>   RegistryInitialize(
> -    IN PUNICODE_STRING  Path
> +    IN  PDRIVER_OBJECT  DriverObject,
> +    IN  PUNICODE_STRING Path
>       )
>   {
> +    UNICODE_STRING      Unicode;
> +    PVOID               Func;
>       NTSTATUS            status;
>   
>       ASSERT3P(RegistryPath.Buffer, ==, NULL);
> @@ -69,6 +77,16 @@ RegistryInitialize(
>       if (!NT_SUCCESS(status))
>           goto fail1;
>   
> +    ASSERT3P(RegistryDriverObject, ==, NULL);
> +    RegistryDriverObject = DriverObject;
> +
> +    ASSERT3P(__IoOpenDriverRegistryKey, ==, NULL);
> +    RtlInitUnicodeString(&Unicode, L"IoOpenDriverRegistryKey");
> +
> +    Func = MmGetSystemRoutineAddress(&Unicode);
> +    if (Func != NULL)
> +        __IoOpenDriverRegistryKey = (IOOPENDRIVERREGISTRYKEY)Func;
> +
>       return STATUS_SUCCESS;
>   
>   fail1:
> @@ -82,6 +100,10 @@ RegistryTeardown(
>       VOID
>       )
>   {
> +    __IoOpenDriverRegistryKey = NULL;
> +
> +    RegistryDriverObject = NULL;
> +
>       RtlFreeUnicodeString(&RegistryPath);
>       RegistryPath.Buffer = NULL;
>       RegistryPath.MaximumLength = RegistryPath.Length = 0;
> @@ -266,6 +288,54 @@ RegistryCreateServiceKey(
>       return RegistryCreateKey(NULL, &RegistryPath, REG_OPTION_NON_VOLATILE, Key);
>   }
>   
> +NTSTATUS
> +RegistryOpenParametersKey(
> +    IN  ACCESS_MASK     DesiredAccess,
> +    OUT PHANDLE         Key
> +    )
> +{
> +    HANDLE              ServiceKey;
> +    NTSTATUS            status;
> +
> +    if (__IoOpenDriverRegistryKey != NULL) {
> +        status = __IoOpenDriverRegistryKey(RegistryDriverObject,
> +                                           DriverRegKeyParameters,
> +                                           DesiredAccess,
> +                                           0,
> +                                           Key);
> +        if (!NT_SUCCESS(status))
> +            goto fail1;
> +
> +        goto done;
> +    }
> +
> +    status = RegistryOpenKey(NULL, &RegistryPath, DesiredAccess, &ServiceKey);
> +    if (!NT_SUCCESS(status))
> +        goto fail2;
> +
> +    status = RegistryOpenSubKey(ServiceKey, "Parameters", DesiredAccess, Key);
> +    if (!NT_SUCCESS(status))
> +        goto fail3;
> +
> +    RegistryCloseKey(ServiceKey);
> +
> +done:
> +    return STATUS_SUCCESS;
> +
> +fail3:
> +    Error("fail3\n");
> +
> +    RegistryCloseKey(ServiceKey);
> +
> +fail2:
> +    Error("fail2\n");
> +
> +fail1:
> +    Error("fail1 %08x\n", status);
> +
> +    return status;
> +}
> +
>   NTSTATUS
>   RegistryOpenSoftwareKey(
>       IN  PDEVICE_OBJECT  DeviceObject,
> diff --git a/src/xenvif/registry.h b/src/xenvif/registry.h
> index c656806..60c50e8 100644
> --- a/src/xenvif/registry.h
> +++ b/src/xenvif/registry.h
> @@ -37,7 +37,8 @@
>   
>   extern NTSTATUS
>   RegistryInitialize(
> -    IN PUNICODE_STRING  Path
> +    IN  PDRIVER_OBJECT  DriverObject,
> +    IN  PUNICODE_STRING Path
>       );
>   
>   extern VOID
> @@ -72,6 +73,12 @@ RegistryCreateServiceKey(
>       OUT PHANDLE     Key
>       );
>   
> +extern NTSTATUS
> +RegistryOpenParametersKey(
> +    IN  ACCESS_MASK     DesiredAccess,
> +    OUT PHANDLE         Key
> +    );
> +
>   extern NTSTATUS
>   RegistryOpenSoftwareKey(
>       IN  PDEVICE_OBJECT  DeviceObject,
> diff --git a/src/xenvif/settings.c b/src/xenvif/settings.c
> deleted file mode 100644
> index 4dd4ec4..0000000
> --- a/src/xenvif/settings.c
> +++ /dev/null
> @@ -1,694 +0,0 @@
> -/* Copyright (c) Xen Project.
> - * Copyright (c) Cloud Software Group, Inc.
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms,
> - * with or without modification, are permitted provided
> - * that the following conditions are met:
> - *
> - * *   Redistributions of source code must retain the above
> - *     copyright notice, this list of conditions and the
> - *     following disclaimer.
> - * *   Redistributions in binary form must reproduce the above
> - *     copyright notice, this list of conditions and the
> - *     following disclaimer in the documentation and/or other
> - *     materials provided with the distribution.
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
> - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
> - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
> - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
> - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
> - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
> - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> - * SUCH DAMAGE.
> - */
> -
> -#include <ntddk.h>
> -#include <ntstrsafe.h>
> -
> -#include "registry.h"
> -#include "driver.h"
> -#include "dbg_print.h"
> -#include "assert.h"
> -#include "util.h"
> -
> -#define SETTINGS_TAG 'TTES'
> -
> -#define INTERFACES_PATH(_Name)      \
> -    "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services\\" ## #_Name ## "\\Parameters\\Interfaces\\"
> -
> -#define IPV6_PATH   \
> -    "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Nsi\\{eb004a01-9b1a-11d4-9123-0050047759bc}\\10"
> -
> -#define IPV4_PATH   \
> -    "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Nsi\\{eb004a00-9b1a-11d4-9123-0050047759bc}\\10"
> -
> -#define NETLUID_STRING_LENGTH 16
> -
> -typedef struct _SETTINGS_COPY_IP_ADDRESS_PARAMETERS {
> -    CHAR        SrcPrefix[NETLUID_STRING_LENGTH + 1];
> -    CHAR        DstPrefix[NETLUID_STRING_LENGTH + 1];
> -} SETTINGS_COPY_IP_ADDRESS_PARAMETERS, *PSETTINGS_COPY_IP_ADDRESS_PARAMETERS;
> -
> -static FORCEINLINE PVOID
> -__SettingsAllocate(
> -    IN  ULONG   Length
> -    )
> -{
> -    return __AllocatePoolWithTag(NonPagedPool, Length, SETTINGS_TAG);
> -}
> -
> -static FORCEINLINE VOID
> -__SettingsFree(
> -    IN  PVOID   Buffer
> -    )
> -{
> -    __FreePoolWithTag(Buffer, SETTINGS_TAG);
> -}
> -
> -static FORCEINLINE NTSTATUS
> -__GuidToString(
> -    IN  LPGUID          Guid,
> -    OUT PANSI_STRING    Ansi
> -    )
> -{
> -    NTSTATUS            status;
> -    UNICODE_STRING      Unicode;
> -
> -    status = RtlStringFromGUID(Guid, &Unicode);
> -    if (!NT_SUCCESS(status))
> -        goto fail1;
> -
> -    status = RtlUnicodeStringToAnsiString(Ansi, &Unicode, TRUE);
> -    if (!NT_SUCCESS(status))
> -        goto fail2;
> -
> -    RtlFreeUnicodeString(&Unicode);
> -
> -    return STATUS_SUCCESS;
> -
> -fail2:
> -    Error("fail2\n");
> -
> -    RtlFreeUnicodeString(&Unicode);
> -
> -fail1:
> -    Error("fail1 (%08x)\n", status);
> -
> -    return status;
> -}
> -
> -static NTSTATUS
> -SettingsCopyIpAddressesValue(
> -    IN  PVOID                               Context,
> -    IN  HANDLE                              Key,
> -    IN  PANSI_STRING                        ValueName,
> -    IN  ULONG                               Type
> -    )
> -{
> -    PSETTINGS_COPY_IP_ADDRESS_PARAMETERS    Parameters = Context;
> -    PVOID                                   Value;
> -    ULONG                                   ValueLength;
> -    NTSTATUS                                status;
> -
> -    UNREFERENCED_PARAMETER(Type);
> -
> -    if (_strnicmp(ValueName->Buffer,
> -                  Parameters->SrcPrefix,
> -                  NETLUID_STRING_LENGTH) != 0)
> -        goto done;
> -
> -    Trace("    -> %Z\n", ValueName);
> -
> -    status = RegistryQueryBinaryValue(Key,
> -                                      ValueName->Buffer,
> -                                      &Value,
> -                                      &ValueLength);
> -    if (!NT_SUCCESS(status))
> -        goto fail1;
> -
> -    status = RegistryDeleteValue(Key,
> -                                 ValueName->Buffer);
> -    if (!NT_SUCCESS(status))
> -        goto fail2;
> -
> -    ASSERT(NETLUID_STRING_LENGTH < ValueName->Length);
> -    memcpy(ValueName->Buffer, Parameters->DstPrefix, NETLUID_STRING_LENGTH);
> -
> -    Trace("    <- %Z\n", ValueName);
> -
> -    status = RegistryUpdateBinaryValue(Key,
> -                                       ValueName->Buffer,
> -                                       Value,
> -                                       ValueLength);
> -    if (!NT_SUCCESS(status))
> -        goto fail3;
> -
> -    if (ValueLength != 0)
> -        RegistryFreeBinaryValue(Value);
> -
> -done:
> -    return STATUS_SUCCESS;
> -
> -fail3:
> -    Error("fail3\n");
> -
> -fail2:
> -    Error("fail2\n");
> -
> -    if (ValueLength != 0)
> -        RegistryFreeBinaryValue(Value);
> -
> -fail1:
> -    Error("fail1 (%08x)\n", status);
> -
> -    return status;
> -}
> -
> -static NTSTATUS
> -SettingsCopyIpAddresses(
> -    IN  ULONG                           Version,
> -    IN  PNET_LUID                       OldLuid,
> -    IN  PNET_LUID                       NewLuid
> -    )
> -{
> -    SETTINGS_COPY_IP_ADDRESS_PARAMETERS Parameters;
> -    HANDLE                              Key;
> -    NTSTATUS                            status;
> -
> -    status = RtlStringCbPrintfA(Parameters.SrcPrefix,
> -                                sizeof(Parameters.SrcPrefix),
> -                                "%016llx",
> -                                _byteswap_uint64(OldLuid->Value));
> -    if (!NT_SUCCESS(status))
> -        goto fail1;
> -
> -    status = RtlStringCbPrintfA(Parameters.DstPrefix,
> -                                sizeof(Parameters.DstPrefix),
> -                                "%016llx",
> -                                _byteswap_uint64(NewLuid->Value));
> -    if (!NT_SUCCESS(status))
> -        goto fail2;
> -
> -    status = RegistryOpenSubKey(NULL,
> -                                (Version == 4) ? IPV4_PATH : IPV6_PATH,
> -                                KEY_ALL_ACCESS,
> -                                &Key);
> -    if (!NT_SUCCESS(status))
> -        goto fail3;
> -
> -    Info("IPv%u: %s -> %s\n",
> -         Version,
> -         Parameters.SrcPrefix,
> -         Parameters.DstPrefix);
> -
> -    status = RegistryEnumerateValues(Key,
> -                                     SettingsCopyIpAddressesValue,
> -                                     &Parameters);
> -    if (!NT_SUCCESS(status))
> -        goto fail4;
> -
> -    RegistryCloseKey(Key);
> -
> -    return STATUS_SUCCESS;
> -
> -fail4:
> -    Error("fail4\n");
> -
> -    RegistryCloseKey(Key);
> -
> -fail3:
> -    Error("fail3\n");
> -
> -fail2:
> -    Error("fail2\n");
> -
> -fail1:
> -    Error("fail1 (%08x)\n", status);
> -
> -    return status;
> -}
> -
> -static NTSTATUS
> -SettingsCopyInterfaceValue(
> -    IN  PVOID            Context,
> -    IN  HANDLE           SourceKey,
> -    IN  PANSI_STRING     ValueName,
> -    IN  ULONG            Type
> -    )
> -{
> -    HANDLE               DestinationKey = Context;
> -    NTSTATUS             status;
> -
> -    Trace(" - %Z\n", ValueName);
> -
> -    switch (Type) {
> -    case REG_DWORD: {
> -        ULONG   Value;
> -
> -        status = RegistryQueryDwordValue(SourceKey,
> -                                         ValueName->Buffer,
> -                                         &Value);
> -        if (NT_SUCCESS(status))
> -            (VOID) RegistryUpdateDwordValue(DestinationKey,
> -                                            ValueName->Buffer,
> -                                            Value);
> -
> -        break;
> -    }
> -    case REG_SZ:
> -    case REG_MULTI_SZ: {
> -        PANSI_STRING    Value;
> -
> -        status = RegistryQuerySzValue(SourceKey,
> -                                      ValueName->Buffer,
> -                                      NULL,
> -                                      &Value);
> -        if (NT_SUCCESS(status)) {
> -            (VOID) RegistryUpdateSzValue(DestinationKey,
> -                                         ValueName->Buffer,
> -                                         Type,
> -                                         Value);
> -            RegistryFreeSzValue(Value);
> -        }
> -
> -        break;
> -    }
> -    case REG_BINARY: {
> -        PVOID   Value;
> -        ULONG   Length;
> -
> -        status = RegistryQueryBinaryValue(SourceKey,
> -                                          ValueName->Buffer,
> -                                          &Value,
> -                                          &Length);
> -        if (NT_SUCCESS(status)) {
> -            (VOID) RegistryUpdateBinaryValue(DestinationKey,
> -                                             ValueName->Buffer,
> -                                             Value,
> -                                             Length);
> -            if (Length != 0)
> -                RegistryFreeBinaryValue(Value);
> -        }
> -
> -        break;
> -    }
> -    default:
> -        ASSERT(FALSE);
> -    }
> -
> -    return STATUS_SUCCESS;
> -}
> -
> -static NTSTATUS
> -SettingsCopyInterface(
> -    IN  PCHAR           InterfacePath,
> -    IN  PCHAR           InterfacePrefix,
> -    IN  PANSI_STRING    OldGuid,
> -    IN  PANSI_STRING    NewGuid
> -    )
> -{
> -    HANDLE              OldKey;
> -    HANDLE              NewKey;
> -    PCHAR               OldKeyName;
> -    PCHAR               NewKeyName;
> -    ULONG               OldKeyLength;
> -    ULONG               NewKeyLength;
> -    NTSTATUS            status;
> -
> -    OldKeyLength = (ULONG)(strlen(InterfacePath) +
> -                           strlen(InterfacePrefix) +
> -                           OldGuid->Length +
> -                           1) * sizeof(CHAR);
> -    NewKeyLength = (ULONG)(strlen(InterfacePath) +
> -                           strlen(InterfacePrefix) +
> -                           NewGuid->Length +
> -                           1) * sizeof(CHAR);
> -
> -    status = STATUS_NO_MEMORY;
> -    OldKeyName = __SettingsAllocate(OldKeyLength);
> -    if (OldKeyName == NULL)
> -        goto fail1;
> -
> -    NewKeyName = __SettingsAllocate(NewKeyLength);
> -    if (NewKeyName == NULL)
> -        goto fail2;
> -
> -    status = RtlStringCbPrintfA(OldKeyName,
> -                                OldKeyLength,
> -                                "%s%s%Z",
> -                                InterfacePath,
> -                                InterfacePrefix,
> -                                OldGuid);
> -    if (!NT_SUCCESS(status))
> -        goto fail3;
> -
> -    status = RtlStringCbPrintfA(NewKeyName,
> -                                NewKeyLength,
> -                                "%s%s%Z",
> -                                InterfacePath,
> -                                InterfacePrefix,
> -                                NewGuid);
> -    if (!NT_SUCCESS(status))
> -        goto fail4;
> -
> -    status = RegistryOpenSubKey(NULL,
> -                                OldKeyName,
> -                                KEY_READ,
> -                                &OldKey);
> -    if (!NT_SUCCESS(status))
> -        goto fail5;
> -
> -    status = RegistryCreateSubKey(NULL,
> -                                  NewKeyName,
> -                                  REG_OPTION_NON_VOLATILE,
> -                                  &NewKey);
> -    if (!NT_SUCCESS(status))
> -        goto fail6;
> -
> -    status = RegistryEnumerateValues(OldKey,
> -                                     SettingsCopyInterfaceValue,
> -                                     NewKey);
> -    if (!NT_SUCCESS(status))
> -        goto fail7;
> -
> -    RegistryCloseKey(NewKey);
> -    RegistryCloseKey(OldKey);
> -    __SettingsFree(NewKeyName);
> -    __SettingsFree(OldKeyName);
> -
> -    return STATUS_SUCCESS;
> -
> -fail7:
> -    Error("fail7\n");
> -
> -    RegistryCloseKey(NewKey);
> -
> -fail6:
> -    Error("fail6\n");
> -
> -    RegistryCloseKey(OldKey);
> -
> -fail5:
> -    Error("fail5\n");
> -
> -fail4:
> -    Error("fail4\n");
> -
> -fail3:
> -    Error("fail3\n");
> -
> -    __SettingsFree(NewKeyName);
> -
> -fail2:
> -    Error("fail2\n");
> -
> -    __SettingsFree(OldKeyName);
> -
> -fail1:
> -    Error("fail1 (%08x)\n", status);
> -
> -    return status;
> -}
> -
> -static NTSTATUS
> -SettingsStoreCurrent(
> -    IN  HANDLE          SubKey,
> -    IN  PANSI_STRING    Guid,
> -    IN  PNET_LUID       Luid
> -    )
> -{
> -
> -    NTSTATUS            status;
> -
> -    status = RegistryUpdateSzValue(SubKey,
> -                                   "NetCfgInstanceId",
> -                                   REG_SZ,
> -                                   Guid);
> -    if (!NT_SUCCESS(status))
> -        goto fail1;
> -
> -    status = RegistryUpdateBinaryValue(SubKey,
> -                                       "NetLuid",
> -                                       Luid,
> -                                       sizeof(NET_LUID));
> -    if (!NT_SUCCESS(status))
> -        goto fail2;
> -
> -    (VOID) RegistryDeleteValue(SubKey,
> -                               "HasSettings");
> -
> -    return STATUS_SUCCESS;
> -
> -fail2:
> -    Error("fail2\n");
> -
> -fail1:
> -    Error("fail1 (%08x)\n", status);
> -
> -    return status;
> -}
> -
> -static NTSTATUS
> -SettingsCopy(
> -    IN  PCHAR           SubKeyName,
> -    IN  PANSI_STRING    OldGuid,
> -    IN  PNET_LUID       OldLuid,
> -    IN  PANSI_STRING    NewGuid,
> -    IN  PNET_LUID       NewLuid
> -     )
> -{
> -    HANDLE              SettingsKey;
> -    HANDLE              SubKey;
> -    NTSTATUS            status;
> -
> -    Trace("====>\n");
> -    Info("VIF/%s: FROM %Z\n", SubKeyName, OldGuid);
> -    Info("VIF/%s: TO   %Z\n", SubKeyName, NewGuid);
> -
> -    (VOID) SettingsCopyInterface(INTERFACES_PATH(NetBT),
> -                                 "Tcpip_",
> -                                 OldGuid,
> -                                 NewGuid);
> -
> -    (VOID) SettingsCopyInterface(INTERFACES_PATH(Tcpip),
> -                                 "",
> -                                 OldGuid,
> -                                 NewGuid);
> -
> -    (VOID) SettingsCopyInterface(INTERFACES_PATH(Tcpip6),
> -                                 "",
> -                                 OldGuid,
> -                                 NewGuid);
> -
> -    (VOID) SettingsCopyIpAddresses(4,
> -                                   OldLuid,
> -                                   NewLuid);
> -
> -    (VOID) SettingsCopyIpAddresses(6,
> -                                   OldLuid,
> -                                   NewLuid);
> -
> -    SettingsKey = DriverGetSettingsKey();
> -
> -    status = RegistryCreateSubKey(SettingsKey,
> -                                  SubKeyName,
> -                                  REG_OPTION_NON_VOLATILE,
> -                                  &SubKey);
> -    if (!NT_SUCCESS(status))
> -        goto fail1;
> -
> -    status = SettingsStoreCurrent(SubKey,
> -                                  NewGuid,
> -                                  NewLuid);
> -    if (!NT_SUCCESS(status))
> -        goto fail2;
> -
> -    RegistryCloseKey(SubKey);
> -
> -    Trace("<====\n");
> -
> -    return STATUS_SUCCESS;
> -
> -fail2:
> -    Error("fail2\n");
> -
> -    RegistryCloseKey(SubKey);
> -
> -fail1:
> -    Error("fail1 (%08x)\n", status);
> -
> -    return status;
> -}
> -
> -NTSTATUS
> -SettingsSave(
> -    IN  PCHAR       SubKeyName,
> -    IN  PWCHAR      Alias,
> -    IN  PWCHAR      Description,
> -    IN  LPGUID      InterfaceGuid,
> -    IN  PNET_LUID   InterfaceLuid
> -    )
> -{
> -    HANDLE          SettingsKey;
> -    HANDLE          SubKey;
> -    ANSI_STRING     Ansi;
> -    ULONG           HasSettings;
> -    NTSTATUS        status;
> -
> -    Info("FROM %ws (%ws)\n", Alias, Description);
> -
> -    status = __GuidToString(InterfaceGuid, &Ansi);
> -    if (!NT_SUCCESS(status))
> -        goto fail1;
> -
> -    SettingsKey = DriverGetSettingsKey();
> -
> -    status = RegistryCreateSubKey(SettingsKey,
> -                                  SubKeyName,
> -                                  REG_OPTION_NON_VOLATILE,
> -                                  &SubKey);
> -    if (!NT_SUCCESS(status))
> -        goto fail2;
> -
> -    HasSettings = 0;
> -    status = RegistryQueryDwordValue(SubKey,
> -                                     "HasSettings",
> -                                     &HasSettings);
> -    if (!NT_SUCCESS(status))
> -        HasSettings = 0;
> -    if (HasSettings != 0)
> -        goto done;
> -
> -    Info("FROM %Z\n", Ansi);
> -    Info("FROM %016llx\n", InterfaceLuid->Value);
> -
> -    status = SettingsStoreCurrent(SubKey,
> -                                  &Ansi,
> -                                  InterfaceLuid);
> -    if (!NT_SUCCESS(status))
> -        goto fail3;
> -
> -    RtlFreeAnsiString(&Ansi);
> -
> -done:
> -    RegistryCloseKey(SubKey);
> -
> -    return STATUS_SUCCESS;
> -
> -fail3:
> -    Error("fail3\n");
> -
> -    RegistryCloseKey(SubKey);
> -
> -fail2:
> -    Error("fail2\n");
> -
> -    RtlFreeAnsiString(&Ansi);
> -
> -fail1:
> -    Error("fail1 (%08x)\n", status);
> -
> -    return status;
> -}
> -
> -NTSTATUS
> -SettingsRestore(
> -    IN  PCHAR       SubKeyName,
> -    IN  PWCHAR      Alias,
> -    IN  PWCHAR      Description,
> -    IN  LPGUID      InterfaceGuid,
> -    IN  PNET_LUID   InterfaceLuid
> -    )
> -{
> -    HANDLE          SettingsKey;
> -    HANDLE          SubKey;
> -    ANSI_STRING     Ansi;
> -    PANSI_STRING    NetCfgInstanceId;
> -    PNET_LUID       NetLuid;
> -    ULONG           NetLuidLength;
> -    NTSTATUS        status;
> -
> -    SettingsKey = DriverGetSettingsKey();
> -
> -    status = RegistryOpenSubKey(SettingsKey,
> -                                SubKeyName,
> -                                KEY_READ,
> -                                &SubKey);
> -    if (!NT_SUCCESS(status))
> -        goto fail1;
> -
> -    status = RegistryQuerySzValue(SubKey,
> -                                  "NetCfgInstanceId",
> -                                  NULL,
> -                                  &NetCfgInstanceId);
> -    if (!NT_SUCCESS(status))
> -        goto fail2;
> -
> -    NetLuidLength = 0;
> -    status = RegistryQueryBinaryValue(SubKey,
> -                                      "NetLuid",
> -                                      &NetLuid,
> -                                      &NetLuidLength);
> -    if (!NT_SUCCESS(status))
> -        goto fail3;
> -
> -    status = __GuidToString(InterfaceGuid, &Ansi);
> -    if (!NT_SUCCESS(status))
> -        goto fail4;
> -
> -    if (RtlCompareString(NetCfgInstanceId, &Ansi, TRUE) != 0) {
> -        Info("TO %ws (%ws)\n", Alias, Description);
> -        Info("TO %Z\n", Ansi);
> -        Info("TO %016llx\n", InterfaceLuid->Value);
> -
> -        SettingsCopy(SubKeyName,
> -                     NetCfgInstanceId,
> -                     NetLuid,
> -                     &Ansi,
> -                     InterfaceLuid);
> -    } else {
> -        Info("%s: SettingsCopy not required for %ws\n",
> -             SubKeyName,
> -             Description);
> -    }
> -
> -    RtlFreeAnsiString(&Ansi);
> -
> -    if (NetLuidLength != 0)
> -        RegistryFreeBinaryValue(NetLuid);
> -
> -    RegistryFreeSzValue(NetCfgInstanceId);
> -
> -    RegistryCloseKey(SubKey);
> -
> -    return STATUS_SUCCESS;
> -
> -fail4:
> -    Error("fail4\n");
> -
> -    if (NetLuidLength != 0)
> -        RegistryFreeBinaryValue(NetLuid);
> -
> -fail3:
> -    Error("fail3\n");
> -
> -    RegistryFreeSzValue(NetCfgInstanceId);
> -
> -fail2:
> -    Error("fail2\n");
> -
> -    RegistryCloseKey(SubKey);
> -
> -fail1:
> -    Error("fail1 (%08x)\n", status);
> -
> -    return status;
> -}
> diff --git a/src/xenvif/settings.h b/src/xenvif/settings.h
> deleted file mode 100644
> index 3f964bb..0000000
> --- a/src/xenvif/settings.h
> +++ /dev/null
> @@ -1,54 +0,0 @@
> -/* Copyright (c) Xen Project.
> - * Copyright (c) Cloud Software Group, Inc.
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms,
> - * with or without modification, are permitted provided
> - * that the following conditions are met:
> - *
> - * *   Redistributions of source code must retain the above
> - *     copyright notice, this list of conditions and the
> - *     following disclaimer.
> - * *   Redistributions in binary form must reproduce the above
> - *     copyright notice, this list of conditions and the
> - *     following disclaimer in the documentation and/or other
> - *     materials provided with the distribution.
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
> - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
> - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
> - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
> - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
> - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
> - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> - * SUCH DAMAGE.
> - */
> -
> -#ifndef _XENVIF_SETTINGS_H
> -#define _XENVIF_SETTINGS_H
> -
> -extern NTSTATUS
> -SettingsSave(
> -    IN  PCHAR       SubKeyName,
> -    IN  PWCHAR      Alias,
> -    IN  PWCHAR      Description,
> -    IN  LPGUID      InterfaceGuid,
> -    IN  PNET_LUID   InterfaceLuid
> -    );
> -
> -extern NTSTATUS
> -SettingsRestore(
> -    IN  PCHAR       SubKeyName,
> -    IN  PWCHAR      Alias,
> -    IN  PWCHAR      Description,
> -    IN  LPGUID      InterfaceGuid,
> -    IN  PNET_LUID   InterfaceLuid
> -    );
> -
> -#endif  // _XENVIF_SETTINGS_H
> diff --git a/vs2019/xenvif/xenvif.vcxproj b/vs2019/xenvif/xenvif.vcxproj
> index 0412426..3e48cf7 100644
> --- a/vs2019/xenvif/xenvif.vcxproj
> +++ b/vs2019/xenvif/xenvif.vcxproj
> @@ -82,7 +82,6 @@
>       <ClCompile Include="../../src/xenvif/pdo.c" />
>       <ClCompile Include="../../src/xenvif/receiver.c" />
>       <ClCompile Include="../../src/xenvif/registry.c" />
> -    <ClCompile Include="../../src/xenvif/settings.c" />
>       <ClCompile Include="../../src/xenvif/thread.c" />
>       <ClCompile Include="../../src/xenvif/transmitter.c" />
>       <ClCompile Include="../../src/xenvif/controller.c" />
> diff --git a/vs2022/xenvif/xenvif.vcxproj b/vs2022/xenvif/xenvif.vcxproj
> index be84232..af9fe96 100644
> --- a/vs2022/xenvif/xenvif.vcxproj
> +++ b/vs2022/xenvif/xenvif.vcxproj
> @@ -74,7 +74,6 @@
>       <ClCompile Include="../../src/xenvif/pdo.c" />
>       <ClCompile Include="../../src/xenvif/receiver.c" />
>       <ClCompile Include="../../src/xenvif/registry.c" />
> -    <ClCompile Include="../../src/xenvif/settings.c" />
>       <ClCompile Include="../../src/xenvif/thread.c" />
>       <ClCompile Include="../../src/xenvif/transmitter.c" />
>       <ClCompile Include="../../src/xenvif/controller.c" />



From win-pv-devel-bounces@lists.xenproject.org Wed Jul 24 08:13:58 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jul 2024 08:13:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.763905.1174224 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWX8I-0008Ai-FR; Wed, 24 Jul 2024 08:13:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 763905.1174224; Wed, 24 Jul 2024 08:13:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWX8I-0008Ab-CL; Wed, 24 Jul 2024 08:13:58 +0000
Received: by outflank-mailman (input) for mailman id 763905;
 Wed, 24 Jul 2024 08:13:57 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i0Yy=OY=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sWX8H-0008AS-6t
 for win-pv-devel@lists.xenproject.org; Wed, 24 Jul 2024 08:13:57 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ab871591-4994-11ef-8776-851b0ebba9a2;
 Wed, 24 Jul 2024 10:13:55 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-52efd855adbso5313369e87.2
 for <win-pv-devel@lists.xenproject.org>; Wed, 24 Jul 2024 01:13:55 -0700 (PDT)
Received: from [192.168.12.134] (54-240-197-227.amazon.com. [54.240.197.227])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7ab0796f4bsm46901366b.170.2024.07.24.01.13.53
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 24 Jul 2024 01:13:53 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ab871591-4994-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721808835; x=1722413635; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=WtY1G2NwnbSOJs6xCTOqA5IVWFTEZHmjUgxAXVVfsFo=;
        b=O+d/KwhORcMPm0dtSDf122mNEBRuJHDpAyxXtwLKh0jxFn8WbgR2C+JFcDMQJpN4mx
         VhqcN6FY/6ES/5gDKFZbPKmbt1hKrgpM1oIkByhuMUl7L7lVmkpmIovnwi2jWbxHso1Y
         aQ+/l/8Tfl+eVx2BtOtJohrgpd19cDu0ADY75um7vvx6iwKC5Xdpcqn3La8HaDmcqUzq
         SrnxpoUwdhjK1RfKePxJkFApScduw8i1lRlFbcV5ragRGoVEaENcbMcQBJDT6AzPRAip
         24+RNDW4ufCOvEZNyUvFHwwUp6BprbQSJeLt5w4fmsY32lY3zkRP0zNxUW9y9u5FT+qC
         gOUA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721808835; x=1722413635;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=WtY1G2NwnbSOJs6xCTOqA5IVWFTEZHmjUgxAXVVfsFo=;
        b=lgbmUR2ua+LPEgC2hdnqr8u+LC9byORZjwIbXGbIjxezmXZiU1cpOt+1iI8jPJ53Pk
         hOcPerR9r+Ln4Gh91NejYccwuoCrYXadUgYz7Ag0fIWh4CB+CrC6+/iPc+7Jjy50rbRx
         K/Wz2cgVUbzMGQ75WVYUrBgXSud7KdIeZnkUNG5Dni2p8PAMlsZ1ZGomkEr4LCTDCufI
         lbhpgEmELj9qX1KU5uDey7pAWxaYHnX9PugynCxL459/fnbI37kjdPFkscW+L9FNy8gJ
         UfKpg5xkuW0RF8G8aJE1mNpL+TCcFT6AJP5Gf9zrJjUyYvxGDl9SqqoUPquDQ5NL+Mbz
         wqyA==
X-Gm-Message-State: AOJu0YwpHh4DWh03MQlRgudtQC5Fp1RwNtS54X+S6Fsja0B+HheREEzy
	rMFnYvmiPZ4wxfbqBzHJTN5VI7MdpUJovoGgD7WZXWT5vDe5Y+AM2Bd60g4D
X-Google-Smtp-Source: AGHT+IGXJYK3mz8ehxXFK5c1SdfNxOECQtR62FsLdqyVOpehVokQ+2q26U6QKGcKDqxmYgrDrF96zw==
X-Received: by 2002:a05:6512:2316:b0:52c:a88b:9992 with SMTP id 2adb3069b0e04-52fcf13a2a5mr869934e87.52.1721808833671;
        Wed, 24 Jul 2024 01:13:53 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <f5012b70-e045-4f55-a3ec-c438989b91d1@xen.org>
Date: Wed, 24 Jul 2024 09:13:49 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XENVIF PATCH 3/3] Use UNPLUG v3
To: win-pv-devel@lists.xenproject.org
References: <20240709104500.1392-1-owen.smith@cloud.com>
 <20240709104500.1392-3-owen.smith@cloud.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <20240709104500.1392-3-owen.smith@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 09/07/2024 11:45, Owen Smith wrote:
> Uses UnplugReboot to request a reboot from xenbus_monitor, rather than
> writing values into an absolute registry path, which is a driver verifier
> violation during Server 2025 WHQL testing.
> Also removes the RequestKey from the INF file
> 
> Signed-off-by: Owen Smith <owen.smith@cloud.com>
> ---
>   include/revision.h         |  3 +-
>   include/unplug_interface.h | 40 +++++++++++++++-
>   src/xenvif.inf             |  8 ++--
>   src/xenvif/driver.c        | 93 --------------------------------------
>   src/xenvif/driver.h        |  5 --
>   src/xenvif/pdo.c           | 20 +++++++-
>   6 files changed, 62 insertions(+), 107 deletions(-)
> 

Acked-by: Paul Durrant <paul@xen.org>



From win-pv-devel-bounces@lists.xenproject.org Wed Jul 24 08:15:15 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jul 2024 08:15:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.763915.1174228 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWX9X-0008G9-Jv; Wed, 24 Jul 2024 08:15:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 763915.1174228; Wed, 24 Jul 2024 08:15:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWX9X-0008G2-Gw; Wed, 24 Jul 2024 08:15:15 +0000
Received: by outflank-mailman (input) for mailman id 763915;
 Wed, 24 Jul 2024 08:15:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i0Yy=OY=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sWX9W-0008F8-IS
 for win-pv-devel@lists.xenproject.org; Wed, 24 Jul 2024 08:15:14 +0000
Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com
 [2a00:1450:4864:20::531])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id da53b76b-4994-11ef-bbfe-fd08da9f4363;
 Wed, 24 Jul 2024 10:15:14 +0200 (CEST)
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5a10bb7bcd0so6468835a12.3
 for <win-pv-devel@lists.xenproject.org>; Wed, 24 Jul 2024 01:15:14 -0700 (PDT)
Received: from [192.168.12.134] (54-240-197-235.amazon.com. [54.240.197.235])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7a3c9273a5sm619075766b.165.2024.07.24.01.15.12
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 24 Jul 2024 01:15:13 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: da53b76b-4994-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721808913; x=1722413713; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=xxppXP+281ZacFgopAG+zRSfIh5ucP4TPnuJhuSXMEc=;
        b=j4POpV0P1SWSb1BMoDiyrDOCNi3Vn1fucona0d/odeIOequdNIa4FrmKminzF4yv+z
         Cpxew7MLXpsB/zSGjTuW2Z37GeEJFuleD5R5W4QTBfEgZTSoiXI6MN524G8gR3cignb1
         GyTaMwNv6dj1p4juHZEhO8XnMg6F6HyVbW/XB7hf10XOkjc5MEgnjqekgx6YtjqJ3yuM
         yZrjPDZN1nEdAtvLULPff/ysl3gZVfIEE1urhNwLA0HyjAd0D3EAM6+GQmjpN2fh5BF5
         Ym9wFVX32K9nyx76uHZgJCJpCiTih3AIkD0NbPS7OFLdX9t6nvtn/91dnVAK4+P3vl4u
         PF7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721808913; x=1722413713;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=xxppXP+281ZacFgopAG+zRSfIh5ucP4TPnuJhuSXMEc=;
        b=WdztJhXC3rna9OLVT4kWuDJ/TZduMD7sNfgypKWXgRi8pWzbqBb1CcH5fih1Rqg7LH
         Q3aOFoNDVa0WuU/uJU8TTIym4SsgrQnwwz8+F/jJjM9mtENEheKMHSFR1mrZeF8SCwtg
         PTvLeoe5RCiISbpwWmd2VJEpkjMWBkWbhp/GgzpN0Xkten2Zm5yAtjYk+eWvJaQwaDCl
         BIiM8iGE1K6pDmgXeM5STNZPNF5GrxBdRfEn0lgVh4gYIFchpkfC/VEWlIWJJS6fGtVe
         7w6Qb5gezFk+g8hW6J0Y+wXsEouRF2cnjI9BwJiEXZ9ys8+I+E7EJtKfrN3gx57C1fEL
         kxKg==
X-Gm-Message-State: AOJu0Yxo4UZafBsujrKq2O+znS3vpHJUHDN5de2Tf8UPczq8bMHZfrmh
	p4V5kX8wJHA2oxZQKJgtfyYLz4ASzZuSjvJu0QGLQFqLL2V1AMqwoqBDdGGi
X-Google-Smtp-Source: AGHT+IEqb7cMAbxLzbZEVFNyVc9ii5vyx6eiKJTDZZpfsn6t2S+qAfwJIzHyUdFBKo53nwvm+RRWog==
X-Received: by 2002:a17:907:97d0:b0:a77:c314:d621 with SMTP id a640c23a62f3a-a7ab0e251c6mr89842266b.13.1721808913373;
        Wed, 24 Jul 2024 01:15:13 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <3735947d-155e-4665-afdb-5444ebcee2ab@xen.org>
Date: Wed, 24 Jul 2024 09:15:09 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XENVBD PATCH 1/2] Add RegistryOpenParametersKey
To: win-pv-devel@lists.xenproject.org
References: <20240709104319.1273-1-owen.smith@cloud.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <20240709104319.1273-1-owen.smith@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 09/07/2024 11:43, Owen Smith wrote:
> Server 2025 WHQL tests enables "verifier.exe /onecheck /rc 33 36" on some drivers
> under test, which will detect a violation if drivers attempt to access absolute
> registry paths.
> IoOpenDriverRegistryKey will open the parameters key for a driver, but its not
> defined for Server 2016. Use MmGetSystemRoutineAddress to dynamically find the
> function so that a single binary can be used on Server 2016 and Server 2025.
> 
> Signed-off-by: Owen Smith <owen.smith@cloud.com>
> ---
>   src/xendisk/driver.c   | 19 ++---------
>   src/xendisk/registry.c | 72 ++++++++++++++++++++++++++++++++++++++++-
>   src/xendisk/registry.h |  9 +++++-
>   src/xenvbd/driver.c    | 27 +++-------------
>   src/xenvbd/registry.c  | 73 +++++++++++++++++++++++++++++++++++++++++-
>   src/xenvbd/registry.h  | 10 +++++-
>   6 files changed, 167 insertions(+), 43 deletions(-)
> 

Acked-by: Paul Durrant <paul@xen.org>



From win-pv-devel-bounces@lists.xenproject.org Wed Jul 24 08:16:10 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jul 2024 08:16:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.763924.1174231 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWXAQ-0008Kj-Nr; Wed, 24 Jul 2024 08:16:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 763924.1174231; Wed, 24 Jul 2024 08:16:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWXAQ-0008Kc-LP; Wed, 24 Jul 2024 08:16:10 +0000
Received: by outflank-mailman (input) for mailman id 763924;
 Wed, 24 Jul 2024 08:16:09 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i0Yy=OY=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sWXAP-0008JR-3j
 for win-pv-devel@lists.xenproject.org; Wed, 24 Jul 2024 08:16:09 +0000
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com
 [2a00:1450:4864:20::12b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fa5501e7-4994-11ef-8776-851b0ebba9a2;
 Wed, 24 Jul 2024 10:16:07 +0200 (CEST)
Received: by mail-lf1-x12b.google.com with SMTP id
 2adb3069b0e04-52f04b3cb33so6029317e87.0
 for <win-pv-devel@lists.xenproject.org>; Wed, 24 Jul 2024 01:16:07 -0700 (PDT)
Received: from [192.168.12.134] (54-240-197-235.amazon.com. [54.240.197.235])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7aa887d386sm82369866b.125.2024.07.24.01.16.06
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 24 Jul 2024 01:16:06 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fa5501e7-4994-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721808967; x=1722413767; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=DkTkiXuueg2KZtSKef0wKBaST/+S6aZEcYXn+w3X0GI=;
        b=iKfg8QobvgQ26MGuac+GK2Gn/DCuGma+4MmcT93xUzlk0TjiHf7v23hl7rPX7uOuu+
         ZXm0+sGwYzQx+9KH5d9c9s8XmjLEBRtmbYtkXMu6WfPxF3yF5IJaZ7ZOcKF1Vz9dm06Z
         sJbyO0r95eaqaF6Qorfu4flKTGUgN/cI6yxBMViOYzaXUcmwvcAumPzIGLFIn/tbBHic
         hx8hlYioT2wPgW4LYNerxRBwktJjxEsAfeXlVxpQbEGqFxpDJQkmjw6NvYZ400EC+dso
         hGdqaMad2IB0vEA93GNkt+5K7JUjEq5th9CU0E/gOF/Iv1NmUNV10GMtKu+FhNs/QAIh
         ajcA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721808967; x=1722413767;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=DkTkiXuueg2KZtSKef0wKBaST/+S6aZEcYXn+w3X0GI=;
        b=AvVTYraY5ieKixAvpWPwGmN+7usRXe32CdxviPsHK6RRG7a1j5+ICejr0rAkNQKG23
         ZR3X8GNNEaJ6gwu5VfmseeP6szPiNQWXHXE7c+5809vjNlFO39Jy4CIsCW4SQjff7oGJ
         dpi9FAQ6KPm/M57vUXhXyS2jxB+e4C/eLX0J/uXkA3wzGOncJQTa5Fw5IMmQTI9kxKNv
         BShQvQijQiIHGNF/ISDo72pCJMKpzQi6sgGfaGcQfgBl+KaDUhDjuY44fFrHmLZOHCw7
         UJNIm/f+KyxcEyHepQvbmu1fZhjk7e+HWwYqgeueEzlUtfGucmacSGURaJogZkXyL0Hd
         Jggg==
X-Gm-Message-State: AOJu0YzLCkRCCAc6YAJEJOg92p+eLx961hB6TIqPiBXvtwHpNe/rcNmN
	7SDRoGWGNM/VhYpiT6dZFw5iqULIZDp8qgCelNnEUlIS4SZpSVBb6l/Zrjds
X-Google-Smtp-Source: AGHT+IENfM5c//TQuthRt5CsK8bJZlJgnZUQ3YbonMXOcCD8kxfB9S46y0qbTORPwHYxwW26McrGQg==
X-Received: by 2002:a05:6512:3e0e:b0:52c:d76f:4604 with SMTP id 2adb3069b0e04-52fcda995b4mr1737682e87.46.1721808966665;
        Wed, 24 Jul 2024 01:16:06 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <3a2e5b56-1450-4592-aa40-19cafc84e17e@xen.org>
Date: Wed, 24 Jul 2024 09:16:02 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XENVBD PATCH 2/2] Use UNPLUG v3
To: win-pv-devel@lists.xenproject.org
References: <20240709104319.1273-1-owen.smith@cloud.com>
 <20240709104319.1273-2-owen.smith@cloud.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <20240709104319.1273-2-owen.smith@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 09/07/2024 11:43, Owen Smith wrote:
> Use UnplugBootEmulated to detect whether the boot disk should remain emulated
> to avoid openning an absolute registry path.
> Use UnplugReboot to request a reboot from xenbus_monitor. Also removes the
> RequestKey property from the INF file, as its no longer needed.
> Bumps binding in INF file to match revision exposed by xenbus that implements
> UNPLUG v3 (0x0900000B)
> 
> Signed-off-by: Owen Smith <owen.smith@cloud.com>
> ---
>   include/unplug_interface.h | 40 +++++++++++++++++++-
>   src/xenvbd.inf             |  8 ++--
>   src/xenvbd/adapter.c       | 35 ++++++++++++------
>   src/xenvbd/adapter.h       |  5 +++
>   src/xenvbd/driver.c        | 76 --------------------------------------
>   src/xenvbd/driver.h        |  6 ---
>   6 files changed, 69 insertions(+), 101 deletions(-)
> 

Acked-by: Paul Durrant <paul@xen.org>



From win-pv-devel-bounces@lists.xenproject.org Wed Jul 24 08:16:45 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jul 2024 08:16:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.763935.1174235 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWXAz-0000BX-QR; Wed, 24 Jul 2024 08:16:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 763935.1174235; Wed, 24 Jul 2024 08:16:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWXAz-0000BQ-Nz; Wed, 24 Jul 2024 08:16:45 +0000
Received: by outflank-mailman (input) for mailman id 763935;
 Wed, 24 Jul 2024 08:16:44 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i0Yy=OY=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sWX2x-0006Zp-RV
 for win-pv-devel@lists.xenproject.org; Wed, 24 Jul 2024 08:08:27 +0000
Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com
 [2a00:1450:4864:20::329])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e7564e6e-4993-11ef-8776-851b0ebba9a2;
 Wed, 24 Jul 2024 10:08:26 +0200 (CEST)
Received: by mail-wm1-x329.google.com with SMTP id
 5b1f17b1804b1-427d2c8c632so46342215e9.2
 for <win-pv-devel@lists.xenproject.org>; Wed, 24 Jul 2024 01:08:26 -0700 (PDT)
Received: from [192.168.12.134] (54-240-197-227.amazon.com. [54.240.197.227])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-427ef3f30fcsm46160545e9.0.2024.07.24.01.08.25
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 24 Jul 2024 01:08:25 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e7564e6e-4993-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721808506; x=1722413306; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=MFOMQQ5hFLexX2hwPX+DB9EOgJQDHVzSR96SHfWBPCY=;
        b=eDJ9KK24OJoigR/Te0AqJaTjRcyHW4AUzjTUkrMrY4WULWb4thFqw4YmRwNNzduaun
         NgYXHXkRy19wTiWp3hnvYk3je0g19czuCZJ4BznLENs6JO2aTnWJYKKMWTcyhD+FO4LN
         FCZi5eRIdUvTHqudPLEXRNLaZAYn5np2LXcCPr7j9sGfly6RFKGgzFHzIiUDnKOnUmmV
         gV73dYx6HMemSVB/7iJUrbf3C9iyK1AOGS7SBcT8edNLNBCuDyR1Q6TMFRgGLytLl5YI
         8vWlkhYOAaZ5s5dPj7fexuiGEFI6lz3cOj95j17sklkU/YU+xhT+XrGp+R5lPfZ32blT
         Afnw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721808506; x=1722413306;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=MFOMQQ5hFLexX2hwPX+DB9EOgJQDHVzSR96SHfWBPCY=;
        b=tVjDOAxrCvXGJQPE6ZmBfFuE/6Xf3xw6aTMts3n3Tk9bWrBeUVdyAt8t8Suim+ExGG
         S+W5KgHTaeBC/7qfv07TGakDWHZ5D/Vfy2VNGaVuxMEuEiE2bcpnq6PYZcLlyMyrhYRL
         0QvvH1iiQxvKAL4E+oqzVtsS9/C/WvOpvM1ZfIPKIOO9JGSP+0T/Tp8WUnJSdQ0Q+FsY
         5QWK6lC8RkgSBd92GDZSF8Jh89KDWu8pUzyoL3vtI/hdiL8n4S9ulaLbgnnvFmU9TzQt
         Wh3ad/msJC0uI0CcZvEuzJav/atvkAn/hv8kiDvgZfjaJX7XGmUE/GGEIS4PFx4Re1om
         yNjw==
X-Gm-Message-State: AOJu0Yy4s9wEZ1OlRdLT2YvweltFjlUpZr5Ys3S/6ohhDyModkMKvBnY
	OVxT2R4OEP990ujRL8Ubb8k2shDXmKX7B9FARSySEQF6ZbafUUP+7pntGPwd
X-Google-Smtp-Source: AGHT+IGteFgIYUzCdhVKEgjhaqqSoS6pXgaiyuv7M2wAB8ViorwdVPw7AoNvSDCXebZCQ0U4k6xVcw==
X-Received: by 2002:a05:600c:4589:b0:426:602d:a246 with SMTP id 5b1f17b1804b1-427dc59e752mr102329845e9.32.1721808505617;
        Wed, 24 Jul 2024 01:08:25 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <bc549603-39b9-42d2-b556-91bed4e39c12@xen.org>
Date: Wed, 24 Jul 2024 09:08:21 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XENVIF PATCH 1/3] Avoid returning STATUS_PNP_REBOOT_REQUIRED
To: win-pv-devel@lists.xenproject.org
References: <20240709104500.1392-1-owen.smith@cloud.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <20240709104500.1392-1-owen.smith@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 09/07/2024 11:44, Owen Smith wrote:
> When emulated devices are present, returning STATUS_PNP_REBOOT_REQUIRED
> will display the 'reboot required' toast popup, but will also count as
> a failure when distributing XenNet via Windows Update, which will
> result in Microsoft pulling the XenNet update.
> Note: PnpUnplugRequest is called twice in this startup codepath, as
>        the reference count is decreased by PdoStopDevice later and
>        keeping the reference count above zero is needed to unplug
>        the emulated device.
> 
> Signed-off-by: Owen Smith <owen.smith@cloud.com>
> ---
>   src/xenvif/pdo.c | 13 +++----------
>   1 file changed, 3 insertions(+), 10 deletions(-)
> 

Acked-by: Paul Durrant <paul@xen.org>



From win-pv-devel-bounces@lists.xenproject.org Wed Jul 24 08:19:03 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jul 2024 08:19:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.763945.1174240 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWXDC-0000UW-0l; Wed, 24 Jul 2024 08:19:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 763945.1174240; Wed, 24 Jul 2024 08:19:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWXDB-0000UP-UN; Wed, 24 Jul 2024 08:19:01 +0000
Received: by outflank-mailman (input) for mailman id 763945;
 Wed, 24 Jul 2024 08:19:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i0Yy=OY=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sWXDA-0000UJ-2x
 for win-pv-devel@lists.xenproject.org; Wed, 24 Jul 2024 08:19:00 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 608b221b-4995-11ef-bbfe-fd08da9f4363;
 Wed, 24 Jul 2024 10:18:59 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a77d85f7fa3so112215066b.0
 for <win-pv-devel@lists.xenproject.org>; Wed, 24 Jul 2024 01:18:59 -0700 (PDT)
Received: from [192.168.12.134] (54-240-197-227.amazon.com. [54.240.197.227])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7a8a480342sm188605366b.172.2024.07.24.01.18.57
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 24 Jul 2024 01:18:58 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 608b221b-4995-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721809139; x=1722413939; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=WlfeEgwnybkhV8KqEN8wnnBP/7sGB0D2bjUJhOZNdq0=;
        b=lg4g08EXBz/6UKoyio9UuzU/REGGYZRWRShySU3l4b2oItJuoy+88qDOdOvOzLA4wU
         EcCWEfBOiNy8x99jqCAIL2mwJ8oPR1kQoKxNIOcFrpY9id5CjkQCZblg49hVkOgDdOWs
         q4rNWZABYQmBYnHwMnVJ67p5F93EwIcK7Un+99o0XrbBsD+eRO1eLPp5Y8m5T7jkGME4
         szASTByzOVeWwzFt9VXZjhnx62r1sICkEpZcvunEPUilYI0Ulw83W5LEZRB5JNLw6++E
         5pVQsH8vd87OQ77f1sHQscHXG/9jVanSUaHlYkkkrV3VOgbOzht/ihnamoJQA4O9MVue
         eBMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721809139; x=1722413939;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=WlfeEgwnybkhV8KqEN8wnnBP/7sGB0D2bjUJhOZNdq0=;
        b=siGykiCHAp1BY46hUljjRea6oFduUyUtLb4dIn9y9RHe7f7NxLDElbqk2N9YSKwSqJ
         SbgQ1x5fBFETCFg0F4jRcXZdoxoJFs8Kf2Yst/L4LEwt5+LgzKfi+v1UWwGFRdsqqGwK
         vppbGri7IlAm4yyESX2fFsDtk6T4jJNH8vQydFmvc7AKC/6iidkf7LT/PtJylY4ZiwG2
         17J60ujM242VnqnXDLrn3lDsHAbtbYkBbeLcJp8vfu7/pW/IxwDx40A9rPYa8WgQKJXu
         5+XYwNYVznQIwiWt42SVUCsxZxD6IZQ8qUadHSpq1YgN1j3UGGadwgWnC69+vvouFFIP
         DL8g==
X-Gm-Message-State: AOJu0YyEOOa/wki/zD0qrlylZdNBXM1hkgEf/LWMmtqJchRNCaUgT3nU
	mHIEvGgyh8Dd2ZYoVguwO7FZObpZvVXZ3xpRn860SPy60PsoilVRs1Ble4a0
X-Google-Smtp-Source: AGHT+IHOPObzY0i0yJ2hyVI/baGGwk+YPmKCvnbYBkkE1C+duLBykU9aCg91NDtOC/62HdJ/jERbQA==
X-Received: by 2002:a17:906:dc8f:b0:a7a:b18a:6c with SMTP id a640c23a62f3a-a7ab2d282a8mr110484166b.16.1721809138535;
        Wed, 24 Jul 2024 01:18:58 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <388e4e24-747e-4d13-87eb-5386c8a89301@xen.org>
Date: Wed, 24 Jul 2024 09:18:54 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XENIFACE PATCH 2/2] Bump binding to 0x0900000B
To: win-pv-devel@lists.xenproject.org
References: <20240709104123.1415-1-owen.smith@cloud.com>
 <20240709104123.1415-2-owen.smith@cloud.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <20240709104123.1415-2-owen.smith@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 09/07/2024 11:41, Owen Smith wrote:
> Require UNPLUGv3 be present, so that drivers are all using the same binding
> revision number.
> Also refactors the INF file to match other drivers
> 
> Signed-off-by: Owen Smith <owen.smith@cloud.com>
> ---
>   src/xeniface.inf | 123 ++++++++++++++++++++++++++---------------------
>   1 file changed, 67 insertions(+), 56 deletions(-)
> 

Acked-by: Paul Durrant <paul@xen.org>



From win-pv-devel-bounces@lists.xenproject.org Wed Jul 24 08:20:18 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jul 2024 08:20:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.763953.1174243 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWXEQ-0001T2-4n; Wed, 24 Jul 2024 08:20:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 763953.1174243; Wed, 24 Jul 2024 08:20:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWXEQ-0001Sv-28; Wed, 24 Jul 2024 08:20:18 +0000
Received: by outflank-mailman (input) for mailman id 763953;
 Wed, 24 Jul 2024 08:20:17 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i0Yy=OY=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sWXEP-0000YJ-1P
 for win-pv-devel@lists.xenproject.org; Wed, 24 Jul 2024 08:20:17 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8e12215c-4995-11ef-8776-851b0ebba9a2;
 Wed, 24 Jul 2024 10:20:15 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a7aac70e30dso64817766b.1
 for <win-pv-devel@lists.xenproject.org>; Wed, 24 Jul 2024 01:20:15 -0700 (PDT)
Received: from [192.168.12.134] (54-240-197-235.amazon.com. [54.240.197.235])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7a3c8c022dsm616592266b.102.2024.07.24.01.20.14
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 24 Jul 2024 01:20:14 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8e12215c-4995-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721809215; x=1722414015; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=qWv/pd5L6pJwrWsqH6GGfoeL+4gkZG4dpRnep0jJr5M=;
        b=FT3MaTPg6iHmkwcI59rVkm9HYbB5YjZoSRGGwVBLFsxvA8zYiPauxhWdwjzB2B0RHu
         r4N7T6p7QJS6gqeRlUaq+JkwnfNEiZhNI6TNY5vShUA0ZB8er1to80KbAJBqFWobDGMb
         q2LWNjGWxi1IaN2I/YBAGIDhSp+gaNp6ZQvwyZiGa2dp63gbJu1C7p3uAOMh9KMUsh71
         WUmt1KW738kJzU/ukpFQRqZLpmHBYdeSeDo9JrbL7wFdaaR9HS/qpAtsH35ggFrJQkpG
         nd4xFTajkHKZ+p1RLrHwBTSHEnsL95sOa+ekRS5Vp5cf2CdtPEPdyol3UvdGPSMye3Tk
         n0qQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721809215; x=1722414015;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=qWv/pd5L6pJwrWsqH6GGfoeL+4gkZG4dpRnep0jJr5M=;
        b=ZfscLkWLHFeH9P1EALIzwjtwg+DVVNqnKPoU860m9b4uWyb0W2ac2AzvNXk2m2eIS+
         VQsx7qIh8YouHNScjGLAaMLHn+ljrEku88rrj9TuJnI6oyHCSjNK7WteR6dnwifttj4u
         hlUn/HilLU2rkDfoCpj6mbMNk1Qf/Gh9ryTgvq1wlOTo8bn48Z0PHcmNRuq56zsIHoMh
         W+sny8B6mi55gNQssberG5PN6ISwOVpA90EQCD6R96VBaFYw3/U2sBG6iB3jJN2sVtap
         J7zfBWOkVuA95+enqOX72DCdP3IYUmZBcrg0bAegPTeTeKEKg3O8sN6Yk2txiq62WYPO
         OZGg==
X-Gm-Message-State: AOJu0YxrdgsV4YhRHFLTd2aOv4JPSxfNVLja3X3jhoGNpJb3mxWzi1eG
	k11qeskjZfPgNXezhG67T4IucOWI3QGCzCp+tzrFPE+wElXAL4Cyi8fmdXpC
X-Google-Smtp-Source: AGHT+IFMluiPZg5+VmNP+hv6mGAn008Fu20u4AuAjOFOS3eY7AwaPynYUJLHVXZZ/MOH/lH8DdKnpg==
X-Received: by 2002:a17:906:6a18:b0:a7a:97a9:ba23 with SMTP id a640c23a62f3a-a7a97a9bad2mr337647266b.22.1721809214887;
        Wed, 24 Jul 2024 01:20:14 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <126263c3-2cce-4838-ae7a-a267fdd59c46@xen.org>
Date: Wed, 24 Jul 2024 09:20:11 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/2] Use MmGetSystemRoutineAddress to test for
 IoOpenDriverRegistryKey
To: win-pv-devel@lists.xenproject.org
References: <20240705073221.305-1-owen.smith@cloud.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <20240705073221.305-1-owen.smith@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 05/07/2024 08:32, Owen Smith wrote:
> Server 2016 does not define the function IoOpenDriverRegistryKey, use
> MmGetSystemRoutineAddress to dynamically find the function so that a
> single binary can be used on Server 2016 (and Win10-1607) and Server 2025.
> 
> Signed-off-by: Owen Smith <owen.smith@cloud.com>
> ---
>   src/common/registry.c | 47 ++++++++++++++++++++++++++++++++-----------
>   1 file changed, 35 insertions(+), 12 deletions(-)
> 

Acked-by: Paul Durrant <paul@xen.org>



From win-pv-devel-bounces@lists.xenproject.org Wed Jul 24 08:22:18 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jul 2024 08:22:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.763966.1174248 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWXGM-0001at-C4; Wed, 24 Jul 2024 08:22:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 763966.1174248; Wed, 24 Jul 2024 08:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWXGM-0001ah-8s; Wed, 24 Jul 2024 08:22:18 +0000
Received: by outflank-mailman (input) for mailman id 763966;
 Wed, 24 Jul 2024 08:22:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i0Yy=OY=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sWXGL-0001Ym-3q
 for win-pv-devel@lists.xenproject.org; Wed, 24 Jul 2024 08:22:17 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d629338b-4995-11ef-bbfe-fd08da9f4363;
 Wed, 24 Jul 2024 10:22:16 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-595856e2336so1123841a12.1
 for <win-pv-devel@lists.xenproject.org>; Wed, 24 Jul 2024 01:22:16 -0700 (PDT)
Received: from [192.168.12.134] (54-240-197-227.amazon.com. [54.240.197.227])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5a30aaa2d5esm8629558a12.30.2024.07.24.01.22.14
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 24 Jul 2024 01:22:15 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d629338b-4995-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721809336; x=1722414136; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=PeKV/eofDFC/4hOmrTg7lMdSKOEBt/GkTPoEZbwxEAk=;
        b=BYMpJe7A6QB58c9Zah1H93IZh/NWu02tYw/sGdj0q3u3a3tRgQ1l0Aze+ol5CFQj2d
         IRSmGE5BDqhrXj2ayFUZUMLBCB1AR4m7JIBQJIA6Z5U7Fo9NiK9Z/vZTPuD6u1BBZudR
         VnpIGxwwc34Bs8W23SlwgTaDqpihtpT2u4hWcGmxtO5JNqUuNV7tvvoISjtsk5DOkqmV
         wiqCcJY97clDo0oInKx2F9Bfdstxu7/2vJTLuSeBmuW18lhmVu4h13tGwglMg0g2RbEz
         S/sWTfb5RCY2dIyKe5Lx0lQQHxu0I/dHTGsyqulM07R+bQOWHE9AIUx9J+Y8HxV/U/gh
         k0fg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721809336; x=1722414136;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=PeKV/eofDFC/4hOmrTg7lMdSKOEBt/GkTPoEZbwxEAk=;
        b=U1HndhoYOABEZ/4Qdr7hDnAMd4NmqjbaPKT1YQ10qKvZI1QiXyVccltV0Rh0tpjFtg
         LAtasDJaDvRM9Tqp+1P02nwhoX2BfrQDBuH9tfwkqoYfKODttS9OiQuog/T5U9ttp6/L
         euDhJMurN4GcFQQpwClsPRpReUWx2aojF5VbR3DeiX6xFI0Mce6DzPfjHbsh3rugG43H
         62IfLi8bf12BsriR5RmyeGppt1Osstbiu72UkZudliLrdeIoPn1DDpQcdivitNNrfcUr
         njHirEYYLGYtBLTI6kmF9SchwZYOKLwmAZD6qEzGHDYlNF+jLMtAV5NtgBrReumkTuJV
         uMmw==
X-Gm-Message-State: AOJu0YzNfSlZgsFrqx/VzJrNJvFl5soS1Ed+0iHLDM4pXywGwv5qIn58
	91vhse6yYaAEjL1yf4kMHNpeIOVLyUMufm9ngZotsxnD1VcB9drQ6pBiMyhh
X-Google-Smtp-Source: AGHT+IGjHHSUfXlCIdPBWaHpg8hdZ6PHHvhTt64GeJ7KEG/106BSsL8zaMgDIHaRM8bLyoBbg73MaQ==
X-Received: by 2002:a50:cddd:0:b0:57d:4692:ba54 with SMTP id 4fb4d7f45d1cf-5ab1a4c106fmr904437a12.6.1721809335845;
        Wed, 24 Jul 2024 01:22:15 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <608b7467-4baa-4159-8eb5-9b9369cb38d1@xen.org>
Date: Wed, 24 Jul 2024 09:22:11 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] Add safety check to Unplug
To: win-pv-devel@lists.xenproject.org
References: <20240705073221.305-1-owen.smith@cloud.com>
 <20240705073221.305-2-owen.smith@cloud.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <20240705073221.305-2-owen.smith@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 05/07/2024 08:32, Owen Smith wrote:
> If a driver does not have the matching Enum keys to trigger an AddDevice,
> then block the Unplug of any emulated device.
> When a boot start driver is removed, the Enum keys are removed, but the
> driver is not unloaded. Since there is no CoInstaller to remove the Unplug
> value, there needs to be a check to prevent emulated devices from being
> unplugged while there is no driver bindings for the child device, so the
> child device will not create the PV device.
> 
> Signed-off-by: Owen Smith <owen.smith@cloud.com>
> ---
>   src/xen/unplug.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 80 insertions(+)
> 

Acked-by: Paul Durrant <paul@xen.org>



From win-pv-devel-bounces@lists.xenproject.org Wed Jul 24 08:26:56 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 24 Jul 2024 08:26:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.763979.1174251 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWXKo-0001vI-Mr; Wed, 24 Jul 2024 08:26:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 763979.1174251; Wed, 24 Jul 2024 08:26:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sWXKo-0001vB-KM; Wed, 24 Jul 2024 08:26:54 +0000
Received: by outflank-mailman (input) for mailman id 763979;
 Wed, 24 Jul 2024 08:26:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i0Yy=OY=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sWXCF-0008F8-RJ
 for win-pv-devel@lists.xenproject.org; Wed, 24 Jul 2024 08:18:03 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3f25042a-4995-11ef-bbfe-fd08da9f4363;
 Wed, 24 Jul 2024 10:18:03 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a7ab76558a9so43392466b.1
 for <win-pv-devel@lists.xenproject.org>; Wed, 24 Jul 2024 01:18:03 -0700 (PDT)
Received: from [192.168.12.134] (54-240-197-227.amazon.com. [54.240.197.227])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7a3c8bebe5sm613820066b.119.2024.07.24.01.18.02
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 24 Jul 2024 01:18:02 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3f25042a-4995-11ef-bbfe-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1721809082; x=1722413882; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=6SmNtA4ZWvb67tTeCknpqf4rylhI0UV2RHq2Gm4Gigs=;
        b=caLys7/dHpNKJmDC9Ry6DxEcPeuIgeUZHzu58cPycFRxnQcaMOJIAMPDPAXRMZzrv/
         yeu+/cDom76i9QvQcc5RIVPi/QwE6JzuqpU9BOoF0PgLbmUtONCiqxNP805E18K3aCX3
         41/6ezwWGmdfRluUP6Iy8o9UNP42ayaSnvAJiN1f9m6TfqRymDBHxdlkmIpD4gZHYGM7
         VxNfW5WOyhr8pLbY57BsAj9Rx3FGXmf2EiCP79hnmKHqqCpc/kis4pK0aTWkMAFo08AP
         uKm0l7VtoiJxTVwmWJI8h9+ACuMgvGVTb319OJtyGBrU+AjcqFJZZwjREugeHJs70KMs
         C9rA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1721809082; x=1722413882;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=6SmNtA4ZWvb67tTeCknpqf4rylhI0UV2RHq2Gm4Gigs=;
        b=a5mQnK3fhpyIxYohIeDKECZ6px0/aFc5zU+dzGMZgtXKPYzhniJ4T4eBX/1cdACEMV
         U7FaI+6g0duTvJT+yTKrLkL/SSKY/r2YZ+ztIUigNlvZ2ACtdCfThHWyZCGmsI2doWSd
         5sRhhzJP+IFzgqfRzmKSRU48RJHhY6clsdi+vwuH6KPjoWNbNUwow3rj1yQUb2UrVBxM
         +iS79RYpeZqMrcBpl6ZgVtVPAXYumxhLKhpfOnRSkuLYH5P2+S0m9jf3kF8ywQAGcFsl
         O+ihNJ70Gy/0TNRpptb0qOEyEFnb+07MwdJpfT40Gpjd5cskRB2aswRukrXZDYxKTsKw
         p0ng==
X-Gm-Message-State: AOJu0YyQaee3edsPAhvi8kDIO+9Y9hZ1TH49+os7R+SGcqdwtt94c2t/
	cu58mBT/pw6haPhpC0Q9p3JHMmtd0RTwze9CPBfkKv5EgDS0kT98PYOauGY7
X-Google-Smtp-Source: AGHT+IFuvFZ8uw3HDEHgb4Eac+9OkkSh5J2lWrs5gdMahwNkFI3vvgjE/sYXbm7id1OGFNvAK5tTvw==
X-Received: by 2002:a17:907:d86:b0:a7a:abd8:77b6 with SMTP id a640c23a62f3a-a7ab3029b1cmr116645866b.23.1721809082490;
        Wed, 24 Jul 2024 01:18:02 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <72915856-7ae3-4f8f-8b6c-08895153efee@xen.org>
Date: Wed, 24 Jul 2024 09:17:58 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XENIFACE PATCH 1/2] Fix Registry Isolation issues with Server
 2025
To: win-pv-devel@lists.xenproject.org
References: <20240709104123.1415-1-owen.smith@cloud.com>
Content-Language: en-US
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <20240709104123.1415-1-owen.smith@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 09/07/2024 11:41, Owen Smith wrote:
> Use MmGetSystemRoutineAddress to dynamically get IoOpenDriverRegistryKey,
> which is not present on Server 2016.
> Where possible, use IoOpenDriverRegistryKey to avoid opening absolute registry
> paths, which is a driver verifier violation on Server 2025 WHQL testing.
> 
> Also refactors all registry access to use functions in registry.h and cleans up
> driver.c to be more inline with other drivers.
> 
> Signed-off-by: Owen Smith <owen.smith@cloud.com>
> ---
>   src/xeniface/driver.c   | 146 +++++++++++++++++++++++++++++++---------
>   src/xeniface/driver.h   |  17 ++---
>   src/xeniface/fdo.c      |  94 ++++++++++----------------
>   src/xeniface/registry.c |  81 +++++++++++++++++++++-
>   src/xeniface/registry.h |  14 +++-
>   src/xeniface/wmi.c      |   7 +-
>   6 files changed, 258 insertions(+), 101 deletions(-)
> 

Acked-by: Paul Durrant <paul@xen.org>



From win-pv-devel-bounces@lists.xenproject.org Tue Jul 30 08:02:56 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 30 Jul 2024 08:02:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.767331.1177935 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sYhos-0000aH-QA; Tue, 30 Jul 2024 08:02:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 767331.1177935; Tue, 30 Jul 2024 08:02:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sYhos-0000aA-NJ; Tue, 30 Jul 2024 08:02:54 +0000
Received: by outflank-mailman (input) for mailman id 767331;
 Tue, 30 Jul 2024 08:02:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=PK9p=O6=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sYhor-0000a4-Hs
 for win-pv-devel@lists.xenproject.org; Tue, 30 Jul 2024 08:02:54 +0000
Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com
 [2a00:1450:4864:20::22e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1c7be99d-4e4a-11ef-bc01-fd08da9f4363;
 Tue, 30 Jul 2024 10:02:50 +0200 (CEST)
Received: by mail-lj1-x22e.google.com with SMTP id
 38308e7fff4ca-2f032cb782dso46699411fa.3
 for <win-pv-devel@lists.xenproject.org>; Tue, 30 Jul 2024 01:02:48 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1c7be99d-4e4a-11ef-bc01-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722326568; x=1722931368; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=GTPXWbIqE7nSJ/BT11CI7GE3rCxb6jpBvSxPe7mVRMA=;
        b=FaDsLTI1HP65M7mO8Sg/+zb6HUWUC+I8fbebVw3hho1JVmwdYaJhXq/xCXhEgdvA1/
         wuwATx8OpLx4H5ISlwn05XXemlVm8cDF3N2bOnggTVgxiLH6B7tJygtOEMS8OXVPg0Fw
         VLme451wQSA98InENrWCH+jteZLJhfLNjDQkE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722326568; x=1722931368;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=GTPXWbIqE7nSJ/BT11CI7GE3rCxb6jpBvSxPe7mVRMA=;
        b=NInj47popbVy6A8Ej5iUch5ARkZueX8ZqxC77qqX4VypTfZUoEHGOn5yHnS9TwOdUK
         D5NczimFIZBETaCxmsFNxf7jOXVqEGo+Gzf0Cp8RdN0jiPLNw2otGomLwDlFXlYlCgmN
         V5fDxJSe7XAzlr0X3JEqw02OGdMmC9K0UG+cSRij0nI8B24uN0T+6EDhPGa7GPAVpUoM
         EIom3jv9EFn0bCTPV6xow3tPLih0vnj9e9DheSKRVx/W0mD7F6SVIOqA7F4B53Hu6j+r
         yoNg2w1nFBdAKw4mOeMSw349bvTzkeeP4MR/35rhcYwqteUsWbj9bs2rWV1Bs9fh6xxX
         m7kQ==
X-Gm-Message-State: AOJu0Yz9B3HGTBVAWjBGbDbFyQ8G+C/A0UVrHZ0AmPP4Qr4UErieMpJR
	/q8xt2D9uEt935ROIJQ0ZvXRNaDzasb0COMX8IXU6yrK/2EKxDTL/XtiOg0IqTKxBUY+3o9PhWY
	d3JDkHd3ivmxjWH04jKzp36KdLLMeeGXEGM/8B5F6FjkjGX0=
X-Google-Smtp-Source: AGHT+IFUVhLogs36bys7EgyKnvt2YQaCBxmV6gmpPNDeFNNJnanvcrIX6T3ND15RuiEVkfQJGZSMOkz8rXJWaC1hXeA=
X-Received: by 2002:a2e:a271:0:b0:2ee:88d8:e807 with SMTP id
 38308e7fff4ca-2f12ee066e5mr61102591fa.16.1722326567336; Tue, 30 Jul 2024
 01:02:47 -0700 (PDT)
MIME-Version: 1.0
References: <20240709104500.1392-1-owen.smith@cloud.com> <20240709104500.1392-2-owen.smith@cloud.com>
 <c838bfdc-4abe-4f95-b114-0e6dfcb95a79@xen.org>
In-Reply-To: <c838bfdc-4abe-4f95-b114-0e6dfcb95a79@xen.org>
From: Owen Smith <owen.smith@citrix.com>
Date: Tue, 30 Jul 2024 09:02:36 +0100
Message-ID: <CAC_UY8-Nv65O_PdfL3THcZUJnmy1pNzG7mGZjcvwVjrS-Eccmw@mail.gmail.com>
Subject: Re: [XENVIF PATCH 2/3] Fix Registry Isolation issues with Server 2025
To: paul@xen.org
Cc: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="0000000000003bdcb4061e7267ef"

--0000000000003bdcb4061e7267ef
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Since Driver Verifier's registry isolation detects opening absolute paths
to registry keys as a violation (and bugchecks), it's not possible to copy
settings from emulated to PV.

On Wed, Jul 24, 2024 at 9:13=E2=80=AFAM Paul Durrant <xadimgnik@gmail.com> =
wrote:

> On 09/07/2024 11:44, Owen Smith wrote:
> > Use MmGetSystemRoutineAddress to dynamically get IoOpenDriverRegistryKe=
y,
> > which is not present on Server 2016.
> > Where possible, use IoOpenDriverRegistryKey to avoid opening absolute
> registry
> > paths, which is a driver verifier violation on Server 2025 WHQL testing=
.
> >
> > This does remove PdoSetFriendlyName and SettingsSave/SettingsRestore
> > - PdoSetFriendlyName gets an absolute path to the parent of a key opene=
d
> by an
> >    allowed API
> > - SettingsSave/SettingsRestore directly manipulate several absolute
> paths, but
> >    due to the recent DeviceID changes, the settings copy code should no=
t
> be
> >    neccessary, as the network connection will not be re-created on
> driver update.
> >
>
> What abou when moving from an emulated device to the PV device? That's
> why all the settings copy nastiness was originally implemented... it
> wasn't about PV driver update.
>
> > Signed-off-by: Owen Smith <owen.smith@cloud.com>
> > ---
> >   src/xenvif/driver.c          | 113 +-----
> >   src/xenvif/driver.h          |  10 -
> >   src/xenvif/pdo.c             | 151 +-------
> >   src/xenvif/registry.c        |  72 +++-
> >   src/xenvif/registry.h        |   9 +-
> >   src/xenvif/settings.c        | 694 ----------------------------------=
-
> >   src/xenvif/settings.h        |  54 ---
> >   vs2019/xenvif/xenvif.vcxproj |   1 -
> >   vs2022/xenvif/xenvif.vcxproj |   1 -
> >   9 files changed, 87 insertions(+), 1018 deletions(-)
> >   delete mode 100644 src/xenvif/settings.c
> >   delete mode 100644 src/xenvif/settings.h
> >
> > diff --git a/src/xenvif/driver.c b/src/xenvif/driver.c
> > index 3345607..2ac793d 100644
> > --- a/src/xenvif/driver.c
> > +++ b/src/xenvif/driver.c
> > @@ -120,54 +120,6 @@ DriverGetParametersKey(
> >       return __DriverGetParametersKey();
> >   }
> >
> > -static FORCEINLINE VOID
> > -__DriverSetAddressesKey(
> > -    IN  HANDLE  Key
> > -    )
> > -{
> > -    Driver.AddressesKey =3D Key;
> > -}
> > -
> > -static FORCEINLINE HANDLE
> > -__DriverGetAddressesKey(
> > -    VOID
> > -    )
> > -{
> > -    return Driver.AddressesKey;
> > -}
> > -
> > -HANDLE
> > -DriverGetAddressesKey(
> > -    VOID
> > -    )
> > -{
> > -    return __DriverGetAddressesKey();
> > -}
> > -
> > -static FORCEINLINE VOID
> > -__DriverSetSettingsKey(
> > -    IN  HANDLE  Key
> > -    )
> > -{
> > -    Driver.SettingsKey =3D Key;
> > -}
> > -
> > -static FORCEINLINE HANDLE
> > -__DriverGetSettingsKey(
> > -    VOID
> > -    )
> > -{
> > -    return Driver.SettingsKey;
> > -}
> > -
> > -HANDLE
> > -DriverGetSettingsKey(
> > -    VOID
> > -    )
> > -{
> > -    return __DriverGetSettingsKey();
> > -}
> > -
> >   #define MAXNAMELEN  256
> >
> >   static FORCEINLINE VOID
> > @@ -265,8 +217,6 @@ DriverUnload(
> >       IN  PDRIVER_OBJECT  DriverObject
> >       )
> >   {
> > -    HANDLE              SettingsKey;
> > -    HANDLE              AddressesKey;
> >       HANDLE              ParametersKey;
> >
> >       ASSERT3P(DriverObject, =3D=3D, __DriverGetDriverObject());
> > @@ -275,16 +225,6 @@ DriverUnload(
> >
> >       Driver.NeedReboot =3D FALSE;
> >
> > -    SettingsKey =3D __DriverGetSettingsKey();
> > -    __DriverSetSettingsKey(NULL);
> > -
> > -    RegistryCloseKey(SettingsKey);
> > -
> > -    AddressesKey =3D __DriverGetAddressesKey();
> > -    __DriverSetAddressesKey(NULL);
> > -
> > -    RegistryCloseKey(AddressesKey);
> > -
> >       ParametersKey =3D __DriverGetParametersKey();
> >       __DriverSetParametersKey(NULL);
> >
> > @@ -401,10 +341,7 @@ DriverEntry(
> >       IN  PUNICODE_STRING RegistryPath
> >       )
> >   {
> > -    HANDLE              ServiceKey;
> >       HANDLE              ParametersKey;
> > -    HANDLE              AddressesKey;
> > -    HANDLE              SettingsKey;
> >       ULONG               Index;
> >       NTSTATUS            status;
> >
> > @@ -428,43 +365,16 @@ DriverEntry(
> >            MONTH,
> >            YEAR);
> >
> > -    status =3D RegistryInitialize(RegistryPath);
> > +    status =3D RegistryInitialize(DriverObject, RegistryPath);
> >       if (!NT_SUCCESS(status))
> >           goto fail1;
> >
> > -    status =3D RegistryOpenServiceKey(KEY_ALL_ACCESS, &ServiceKey);
> > +    status =3D RegistryOpenParametersKey(KEY_READ, &ParametersKey);
> >       if (!NT_SUCCESS(status))
> >           goto fail2;
> >
> > -    status =3D RegistryOpenSubKey(ServiceKey,
> > -                                "Parameters",
> > -                                KEY_READ,
> > -                                &ParametersKey);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail3;
> > -
> >       __DriverSetParametersKey(ParametersKey);
> >
> > -    status =3D RegistryCreateSubKey(ServiceKey,
> > -                                  "Addresses",
> > -                                  REG_OPTION_VOLATILE,
> > -                                  &AddressesKey);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail4;
> > -
> > -    __DriverSetAddressesKey(AddressesKey);
> > -
> > -    status =3D RegistryCreateSubKey(ServiceKey,
> > -                                  "Settings",
> > -                                  REG_OPTION_NON_VOLATILE,
> > -                                  &SettingsKey);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail5;
> > -
> > -    __DriverSetSettingsKey(SettingsKey);
> > -
> > -    RegistryCloseKey(ServiceKey);
> > -
> >       DriverObject->DriverExtension->AddDevice =3D AddDevice;
> >
> >       for (Index =3D 0; Index <=3D IRP_MJ_MAXIMUM_FUNCTION; Index++) {
> > @@ -477,25 +387,6 @@ DriverEntry(
> >
> >       return STATUS_SUCCESS;
> >
> > -fail5:
> > -    Error("fail5\n");
> > -
> > -    __DriverSetAddressesKey(NULL);
> > -
> > -    RegistryCloseKey(AddressesKey);
> > -
> > -fail4:
> > -    Error("fail4\n");
> > -
> > -    __DriverSetParametersKey(NULL);
> > -
> > -    RegistryCloseKey(ParametersKey);
> > -
> > -fail3:
> > -    Error("fail3\n");
> > -
> > -    RegistryCloseKey(ServiceKey);
> > -
> >   fail2:
> >       Error("fail2\n");
> >
> > diff --git a/src/xenvif/driver.h b/src/xenvif/driver.h
> > index b5b9a3d..a9b47d4 100644
> > --- a/src/xenvif/driver.h
> > +++ b/src/xenvif/driver.h
> > @@ -48,16 +48,6 @@ DriverGetParametersKey(
> >       VOID
> >       );
> >
> > -extern HANDLE
> > -DriverGetAddressesKey(
> > -    VOID
> > -    );
> > -
> > -extern HANDLE
> > -DriverGetSettingsKey(
> > -    VOID
> > -    );
> > -
> >   extern VOID
> >   DriverRequestReboot(
> >       VOID
> > diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
> > index 8ec9814..51cbd97 100644
> > --- a/src/xenvif/pdo.c
> > +++ b/src/xenvif/pdo.c
> > @@ -54,7 +54,6 @@
> >   #include "registry.h"
> >   #include "thread.h"
> >   #include "link.h"
> > -#include "settings.h"
> >   #include "dbg_print.h"
> >   #include "assert.h"
> >   #include "util.h"
> > @@ -727,30 +726,16 @@ __PdoSetPermanentAddress(
> >       IN  PCHAR       Buffer
> >       )
> >   {
> > -    ANSI_STRING     Ansi[2];
> >       NTSTATUS        status;
> >
> >       status =3D __PdoParseAddress(Buffer, &Pdo->PermanentAddress);
> >       if (!NT_SUCCESS(status))
> >           goto fail1;
> >
> > -    RtlZeroMemory(Ansi, sizeof (ANSI_STRING) * 2);
> > -    RtlInitAnsiString(&Ansi[0], Buffer);
> > -
> > -    status =3D RegistryUpdateSzValue(DriverGetAddressesKey(),
> > -                                   __PdoGetName(Pdo),
> > -                                   REG_SZ,
> > -                                   Ansi);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail2;
> > -
> > -    Info("%s: %Z\n", __PdoGetName(Pdo), &Ansi[0]);
> > +    Info("%s: %s\n", __PdoGetName(Pdo), Buffer);
> >
> >       return STATUS_SUCCESS;
> >
> > -fail2:
> > -    Error("fail2\n");
> > -
> >   fail1:
> >       Error("fail1 (%08x)\n", status);
> >
> > @@ -778,68 +763,9 @@ __PdoClearPermanentAddress(
> >       IN  PXENVIF_PDO Pdo
> >       )
> >   {
> > -    (VOID) RegistryDeleteValue(DriverGetAddressesKey(),
> > -                               __PdoGetName(Pdo));
> > -
> >       RtlZeroMemory(&Pdo->PermanentAddress, sizeof (ETHERNET_ADDRESS));
> >   }
> >
> > -static NTSTATUS
> > -PdoSetFriendlyName(
> > -    IN  PXENVIF_PDO Pdo,
> > -    IN  HANDLE      SoftwareKey,
> > -    IN  HANDLE      HardwareKey
> > -    )
> > -{
> > -    PANSI_STRING    DriverDesc;
> > -    CHAR            Buffer[MAXNAMELEN];
> > -    ANSI_STRING     Ansi[2];
> > -    NTSTATUS        status;
> > -
> > -    status =3D RegistryQuerySzValue(SoftwareKey,
> > -                                  "DriverDesc",
> > -                                  NULL,
> > -                                  &DriverDesc);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail1;
> > -
> > -    status =3D RtlStringCbPrintfA(Buffer,
> > -                                MAXNAMELEN,
> > -                                "%Z #%s",
> > -                                &DriverDesc[0],
> > -                                __PdoGetName(Pdo)
> > -                                );
> > -    if (!NT_SUCCESS(status))
> > -        goto fail2;
> > -
> > -    RtlZeroMemory(Ansi, sizeof (ANSI_STRING) * 2);
> > -    RtlInitAnsiString(&Ansi[0], Buffer);
> > -
> > -    status =3D RegistryUpdateSzValue(HardwareKey,
> > -                                   "FriendlyName",
> > -                                   REG_SZ,
> > -                                   Ansi);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail3;
> > -
> > -    Info("%s: %Z\n", __PdoGetName(Pdo), &Ansi[0]);
> > -
> > -    RegistryFreeSzValue(DriverDesc);
> > -
> > -    return STATUS_SUCCESS;
> > -
> > -fail3:
> > -    Error("fail3\n");
> > -
> > -fail2:
> > -    Error("fail2\n");
> > -
> > -fail1:
> > -    Error("fail1 (%08x)\n", status);
> > -
> > -    return status;
> > -}
> > -
> >   static FORCEINLINE NTSTATUS
> >   __PdoSetCurrentAddress(
> >       IN  PXENVIF_PDO Pdo,
> > @@ -1276,15 +1202,13 @@ PdoUnplugRequested(
> >
> >   static FORCEINLINE NTSTATUS
> >   PdoParseMibTable(
> > -    IN  PXENVIF_PDO     Pdo,
> > -    IN  HANDLE          SoftwareKey
> > +    IN  PXENVIF_PDO     Pdo
> >       )
> >   {
> >       NTSTATUS            (*__GetIfTable2)(PMIB_IF_TABLE2 *);
> >       VOID                (*__FreeMibTable)(PVOID);
> >       PMIB_IF_TABLE2      Table;
> >       ULONG               Index;
> > -    GUID                Guid;
> >       NTSTATUS            status;
> >
> >       status =3D LinkGetRoutineAddress("netio.sys",
> > @@ -1330,56 +1254,10 @@ PdoParseMibTable(
> >           if (Row->OperStatus !=3D IfOperStatusUp)
> >               continue;
> >
> > -        (VOID) SettingsSave(__PdoGetName(Pdo),
> > -                            Row->Alias,
> > -                            Row->Description,
> > -                            &Row->InterfaceGuid,
> > -                            &Row->InterfaceLuid);
> > -
> >           status =3D STATUS_PNP_REBOOT_REQUIRED;
> >           goto fail4;
> >       }
> >
> > -    //
> > -    // If there is a stack bound then restore any settings that
> > -    // may have been saved from an aliasing device.
> > -    //
> > -    status =3D PdoGetInterfaceGuid(Pdo, SoftwareKey, &Guid);
> > -    if (NT_SUCCESS(status)) {
> > -        NET_LUID        Luid;
> > -        PWCHAR          Alias;
> > -        PWCHAR          Description;
> > -
> > -        RtlZeroMemory(&Luid, sizeof(NET_LUID));
> > -        Alias =3D NULL;
> > -        Description =3D NULL;
> > -
> > -        status =3D PdoGetInterfaceLuid(Pdo, SoftwareKey, &Luid);
> > -        if (NT_SUCCESS(status)) {
> > -            for (Index =3D 0; Index < Table->NumEntries; Index++) {
> > -                PMIB_IF_ROW2    Row =3D &Table->Table[Index];
> > -
> > -                Trace("%s: CHECKING %ws (%ws)\n",
> > -                    __PdoGetName(Pdo),
> > -                    Row->Alias,
> > -                    Row->Description);
> > -
> > -                if (Row->InterfaceLuid.Value !=3D Luid.Value)
> > -                    continue;
> > -
> > -                Alias =3D Row->Alias;
> > -                Description =3D Row->Description;
> > -                break;
> > -            }
> > -        }
> > -
> > -        (VOID) SettingsRestore(__PdoGetName(Pdo),
> > -                               Alias,
> > -                               Description,
> > -                               &Guid,
> > -                               &Luid);
> > -    }
> > -
> >       __FreeMibTable(Table);
> >
> >       return STATUS_SUCCESS;
> > @@ -1408,7 +1286,6 @@ PdoStartDevice(
> >       )
> >   {
> >       HANDLE              SoftwareKey;
> > -    HANDLE              HardwareKey;
> >       NTSTATUS            status;
> >
> >       status =3D STATUS_UNSUCCESSFUL;
> > @@ -1421,21 +1298,11 @@ PdoStartDevice(
> >       if (!NT_SUCCESS(status))
> >           goto fail2;
> >
> > -    status =3D RegistryOpenHardwareKey(__PdoGetDeviceObject(Pdo),
> > -                                     KEY_ALL_ACCESS,
> > -                                     &HardwareKey);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail3;
> > -
> > -    (VOID) PdoSetFriendlyName(Pdo,
> > -                              SoftwareKey,
> > -                              HardwareKey);
> > -
> >       status =3D __PdoSetCurrentAddress(Pdo, SoftwareKey);
> >       if (!NT_SUCCESS(status))
> > -        goto fail4;
> > +        goto fail3;
> >
> > -    status =3D PdoParseMibTable(Pdo, SoftwareKey);
> > +    status =3D PdoParseMibTable(Pdo);
> >       if (status =3D=3D STATUS_PNP_REBOOT_REQUIRED ||
> !PdoUnplugRequested(Pdo)) {
> >           PdoUnplugRequest(Pdo, TRUE); // fix unplug reference count
> >           DriverRequestReboot();
> > @@ -1445,7 +1312,7 @@ PdoStartDevice(
> >
> >       status =3D PdoD3ToD0(Pdo);
> >       if (!NT_SUCCESS(status))
> > -        goto fail5;
> > +        goto fail4;
> >
> >       PdoUnplugRequest(Pdo, TRUE);
> >
> > @@ -1454,20 +1321,14 @@ PdoStartDevice(
> >       Irp->IoStatus.Status =3D STATUS_SUCCESS;
> >       IoCompleteRequest(Irp, IO_NO_INCREMENT);
> >
> > -    RegistryCloseKey(HardwareKey);
> >       RegistryCloseKey(SoftwareKey);
> >
> >       return STATUS_SUCCESS;
> >
> > -fail5:
> > -    Error("fail5\n");
> > -
> > -    RtlZeroMemory(&Pdo->CurrentAddress, sizeof (ETHERNET_ADDRESS));
> > -
> >   fail4:
> >       Error("fail4\n");
> >
> > -    RegistryCloseKey(HardwareKey);
> > +    RtlZeroMemory(&Pdo->CurrentAddress, sizeof (ETHERNET_ADDRESS));
> >
> >   fail3:
> >       Error("fail3\n");
> > diff --git a/src/xenvif/registry.c b/src/xenvif/registry.c
> > index 8f84818..792ce03 100644
> > --- a/src/xenvif/registry.c
> > +++ b/src/xenvif/registry.c
> > @@ -38,8 +38,13 @@
> >
> >   #define REGISTRY_TAG 'GERX'
> >
> > +static PDRIVER_OBJECT   RegistryDriverObject;
> >   static UNICODE_STRING   RegistryPath;
> >
> > +typedef NTSTATUS(*IOOPENDRIVERREGISTRYKEY)(PDRIVER_OBJECT,
> DRIVER_REGKEY_TYPE, ACCESS_MASK, ULONG, PHANDLE);
> > +
> > +static IOOPENDRIVERREGISTRYKEY __IoOpenDriverRegistryKey;
> > +
> >   static FORCEINLINE PVOID
> >   __RegistryAllocate(
> >       IN  ULONG   Length
> > @@ -58,9 +63,12 @@ __RegistryFree(
> >
> >   NTSTATUS
> >   RegistryInitialize(
> > -    IN PUNICODE_STRING  Path
> > +    IN  PDRIVER_OBJECT  DriverObject,
> > +    IN  PUNICODE_STRING Path
> >       )
> >   {
> > +    UNICODE_STRING      Unicode;
> > +    PVOID               Func;
> >       NTSTATUS            status;
> >
> >       ASSERT3P(RegistryPath.Buffer, =3D=3D, NULL);
> > @@ -69,6 +77,16 @@ RegistryInitialize(
> >       if (!NT_SUCCESS(status))
> >           goto fail1;
> >
> > +    ASSERT3P(RegistryDriverObject, =3D=3D, NULL);
> > +    RegistryDriverObject =3D DriverObject;
> > +
> > +    ASSERT3P(__IoOpenDriverRegistryKey, =3D=3D, NULL);
> > +    RtlInitUnicodeString(&Unicode, L"IoOpenDriverRegistryKey");
> > +
> > +    Func =3D MmGetSystemRoutineAddress(&Unicode);
> > +    if (Func !=3D NULL)
> > +        __IoOpenDriverRegistryKey =3D (IOOPENDRIVERREGISTRYKEY)Func;
> > +
> >       return STATUS_SUCCESS;
> >
> >   fail1:
> > @@ -82,6 +100,10 @@ RegistryTeardown(
> >       VOID
> >       )
> >   {
> > +    __IoOpenDriverRegistryKey =3D NULL;
> > +
> > +    RegistryDriverObject =3D NULL;
> > +
> >       RtlFreeUnicodeString(&RegistryPath);
> >       RegistryPath.Buffer =3D NULL;
> >       RegistryPath.MaximumLength =3D RegistryPath.Length =3D 0;
> > @@ -266,6 +288,54 @@ RegistryCreateServiceKey(
> >       return RegistryCreateKey(NULL, &RegistryPath,
> REG_OPTION_NON_VOLATILE, Key);
> >   }
> >
> > +NTSTATUS
> > +RegistryOpenParametersKey(
> > +    IN  ACCESS_MASK     DesiredAccess,
> > +    OUT PHANDLE         Key
> > +    )
> > +{
> > +    HANDLE              ServiceKey;
> > +    NTSTATUS            status;
> > +
> > +    if (__IoOpenDriverRegistryKey !=3D NULL) {
> > +        status =3D __IoOpenDriverRegistryKey(RegistryDriverObject,
> > +                                           DriverRegKeyParameters,
> > +                                           DesiredAccess,
> > +                                           0,
> > +                                           Key);
> > +        if (!NT_SUCCESS(status))
> > +            goto fail1;
> > +
> > +        goto done;
> > +    }
> > +
> > +    status =3D RegistryOpenKey(NULL, &RegistryPath, DesiredAccess,
> &ServiceKey);
> > +    if (!NT_SUCCESS(status))
> > +        goto fail2;
> > +
> > +    status =3D RegistryOpenSubKey(ServiceKey, "Parameters",
> DesiredAccess, Key);
> > +    if (!NT_SUCCESS(status))
> > +        goto fail3;
> > +
> > +    RegistryCloseKey(ServiceKey);
> > +
> > +done:
> > +    return STATUS_SUCCESS;
> > +
> > +fail3:
> > +    Error("fail3\n");
> > +
> > +    RegistryCloseKey(ServiceKey);
> > +
> > +fail2:
> > +    Error("fail2\n");
> > +
> > +fail1:
> > +    Error("fail1 %08x\n", status);
> > +
> > +    return status;
> > +}
> > +
> >   NTSTATUS
> >   RegistryOpenSoftwareKey(
> >       IN  PDEVICE_OBJECT  DeviceObject,
> > diff --git a/src/xenvif/registry.h b/src/xenvif/registry.h
> > index c656806..60c50e8 100644
> > --- a/src/xenvif/registry.h
> > +++ b/src/xenvif/registry.h
> > @@ -37,7 +37,8 @@
> >
> >   extern NTSTATUS
> >   RegistryInitialize(
> > -    IN PUNICODE_STRING  Path
> > +    IN  PDRIVER_OBJECT  DriverObject,
> > +    IN  PUNICODE_STRING Path
> >       );
> >
> >   extern VOID
> > @@ -72,6 +73,12 @@ RegistryCreateServiceKey(
> >       OUT PHANDLE     Key
> >       );
> >
> > +extern NTSTATUS
> > +RegistryOpenParametersKey(
> > +    IN  ACCESS_MASK     DesiredAccess,
> > +    OUT PHANDLE         Key
> > +    );
> > +
> >   extern NTSTATUS
> >   RegistryOpenSoftwareKey(
> >       IN  PDEVICE_OBJECT  DeviceObject,
> > diff --git a/src/xenvif/settings.c b/src/xenvif/settings.c
> > deleted file mode 100644
> > index 4dd4ec4..0000000
> > --- a/src/xenvif/settings.c
> > +++ /dev/null
> > @@ -1,694 +0,0 @@
> > -/* Copyright (c) Xen Project.
> > - * Copyright (c) Cloud Software Group, Inc.
> > - * All rights reserved.
> > - *
> > - * Redistribution and use in source and binary forms,
> > - * with or without modification, are permitted provided
> > - * that the following conditions are met:
> > - *
> > - * *   Redistributions of source code must retain the above
> > - *     copyright notice, this list of conditions and the
> > - *     following disclaimer.
> > - * *   Redistributions in binary form must reproduce the above
> > - *     copyright notice, this list of conditions and the
> > - *     following disclaimer in the documentation and/or other
> > - *     materials provided with the distribution.
> > - *
> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
> > - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
> > - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
> > - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> > - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
> > - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> > - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
> > - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> > - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
> > - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> > - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> > - * SUCH DAMAGE.
> > - */
> > -
> > -#include <ntddk.h>
> > -#include <ntstrsafe.h>
> > -
> > -#include "registry.h"
> > -#include "driver.h"
> > -#include "dbg_print.h"
> > -#include "assert.h"
> > -#include "util.h"
> > -
> > -#define SETTINGS_TAG 'TTES'
> > -
> > -#define INTERFACES_PATH(_Name)      \
> > -    "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services\\" ##
> #_Name ## "\\Parameters\\Interfaces\\"
> > -
> > -#define IPV6_PATH   \
> > -
> "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Nsi\\{eb004a01-=
9b1a-11d4-9123-0050047759bc}\\10"
> > -
> > -#define IPV4_PATH   \
> > -
> "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Nsi\\{eb004a00-=
9b1a-11d4-9123-0050047759bc}\\10"
> > -
> > -#define NETLUID_STRING_LENGTH 16
> > -
> > -typedef struct _SETTINGS_COPY_IP_ADDRESS_PARAMETERS {
> > -    CHAR        SrcPrefix[NETLUID_STRING_LENGTH + 1];
> > -    CHAR        DstPrefix[NETLUID_STRING_LENGTH + 1];
> > -} SETTINGS_COPY_IP_ADDRESS_PARAMETERS,
> *PSETTINGS_COPY_IP_ADDRESS_PARAMETERS;
> > -
> > -static FORCEINLINE PVOID
> > -__SettingsAllocate(
> > -    IN  ULONG   Length
> > -    )
> > -{
> > -    return __AllocatePoolWithTag(NonPagedPool, Length, SETTINGS_TAG);
> > -}
> > -
> > -static FORCEINLINE VOID
> > -__SettingsFree(
> > -    IN  PVOID   Buffer
> > -    )
> > -{
> > -    __FreePoolWithTag(Buffer, SETTINGS_TAG);
> > -}
> > -
> > -static FORCEINLINE NTSTATUS
> > -__GuidToString(
> > -    IN  LPGUID          Guid,
> > -    OUT PANSI_STRING    Ansi
> > -    )
> > -{
> > -    NTSTATUS            status;
> > -    UNICODE_STRING      Unicode;
> > -
> > -    status =3D RtlStringFromGUID(Guid, &Unicode);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail1;
> > -
> > -    status =3D RtlUnicodeStringToAnsiString(Ansi, &Unicode, TRUE);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail2;
> > -
> > -    RtlFreeUnicodeString(&Unicode);
> > -
> > -    return STATUS_SUCCESS;
> > -
> > -fail2:
> > -    Error("fail2\n");
> > -
> > -    RtlFreeUnicodeString(&Unicode);
> > -
> > -fail1:
> > -    Error("fail1 (%08x)\n", status);
> > -
> > -    return status;
> > -}
> > -
> > -static NTSTATUS
> > -SettingsCopyIpAddressesValue(
> > -    IN  PVOID                               Context,
> > -    IN  HANDLE                              Key,
> > -    IN  PANSI_STRING                        ValueName,
> > -    IN  ULONG                               Type
> > -    )
> > -{
> > -    PSETTINGS_COPY_IP_ADDRESS_PARAMETERS    Parameters =3D Context;
> > -    PVOID                                   Value;
> > -    ULONG                                   ValueLength;
> > -    NTSTATUS                                status;
> > -
> > -    UNREFERENCED_PARAMETER(Type);
> > -
> > -    if (_strnicmp(ValueName->Buffer,
> > -                  Parameters->SrcPrefix,
> > -                  NETLUID_STRING_LENGTH) !=3D 0)
> > -        goto done;
> > -
> > -    Trace("    -> %Z\n", ValueName);
> > -
> > -    status =3D RegistryQueryBinaryValue(Key,
> > -                                      ValueName->Buffer,
> > -                                      &Value,
> > -                                      &ValueLength);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail1;
> > -
> > -    status =3D RegistryDeleteValue(Key,
> > -                                 ValueName->Buffer);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail2;
> > -
> > -    ASSERT(NETLUID_STRING_LENGTH < ValueName->Length);
> > -    memcpy(ValueName->Buffer, Parameters->DstPrefix,
> NETLUID_STRING_LENGTH);
> > -
> > -    Trace("    <- %Z\n", ValueName);
> > -
> > -    status =3D RegistryUpdateBinaryValue(Key,
> > -                                       ValueName->Buffer,
> > -                                       Value,
> > -                                       ValueLength);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail3;
> > -
> > -    if (ValueLength !=3D 0)
> > -        RegistryFreeBinaryValue(Value);
> > -
> > -done:
> > -    return STATUS_SUCCESS;
> > -
> > -fail3:
> > -    Error("fail3\n");
> > -
> > -fail2:
> > -    Error("fail2\n");
> > -
> > -    if (ValueLength !=3D 0)
> > -        RegistryFreeBinaryValue(Value);
> > -
> > -fail1:
> > -    Error("fail1 (%08x)\n", status);
> > -
> > -    return status;
> > -}
> > -
> > -static NTSTATUS
> > -SettingsCopyIpAddresses(
> > -    IN  ULONG                           Version,
> > -    IN  PNET_LUID                       OldLuid,
> > -    IN  PNET_LUID                       NewLuid
> > -    )
> > -{
> > -    SETTINGS_COPY_IP_ADDRESS_PARAMETERS Parameters;
> > -    HANDLE                              Key;
> > -    NTSTATUS                            status;
> > -
> > -    status =3D RtlStringCbPrintfA(Parameters.SrcPrefix,
> > -                                sizeof(Parameters.SrcPrefix),
> > -                                "%016llx",
> > -                                _byteswap_uint64(OldLuid->Value));
> > -    if (!NT_SUCCESS(status))
> > -        goto fail1;
> > -
> > -    status =3D RtlStringCbPrintfA(Parameters.DstPrefix,
> > -                                sizeof(Parameters.DstPrefix),
> > -                                "%016llx",
> > -                                _byteswap_uint64(NewLuid->Value));
> > -    if (!NT_SUCCESS(status))
> > -        goto fail2;
> > -
> > -    status =3D RegistryOpenSubKey(NULL,
> > -                                (Version =3D=3D 4) ? IPV4_PATH : IPV6_=
PATH,
> > -                                KEY_ALL_ACCESS,
> > -                                &Key);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail3;
> > -
> > -    Info("IPv%u: %s -> %s\n",
> > -         Version,
> > -         Parameters.SrcPrefix,
> > -         Parameters.DstPrefix);
> > -
> > -    status =3D RegistryEnumerateValues(Key,
> > -                                     SettingsCopyIpAddressesValue,
> > -                                     &Parameters);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail4;
> > -
> > -    RegistryCloseKey(Key);
> > -
> > -    return STATUS_SUCCESS;
> > -
> > -fail4:
> > -    Error("fail4\n");
> > -
> > -    RegistryCloseKey(Key);
> > -
> > -fail3:
> > -    Error("fail3\n");
> > -
> > -fail2:
> > -    Error("fail2\n");
> > -
> > -fail1:
> > -    Error("fail1 (%08x)\n", status);
> > -
> > -    return status;
> > -}
> > -
> > -static NTSTATUS
> > -SettingsCopyInterfaceValue(
> > -    IN  PVOID            Context,
> > -    IN  HANDLE           SourceKey,
> > -    IN  PANSI_STRING     ValueName,
> > -    IN  ULONG            Type
> > -    )
> > -{
> > -    HANDLE               DestinationKey =3D Context;
> > -    NTSTATUS             status;
> > -
> > -    Trace(" - %Z\n", ValueName);
> > -
> > -    switch (Type) {
> > -    case REG_DWORD: {
> > -        ULONG   Value;
> > -
> > -        status =3D RegistryQueryDwordValue(SourceKey,
> > -                                         ValueName->Buffer,
> > -                                         &Value);
> > -        if (NT_SUCCESS(status))
> > -            (VOID) RegistryUpdateDwordValue(DestinationKey,
> > -                                            ValueName->Buffer,
> > -                                            Value);
> > -
> > -        break;
> > -    }
> > -    case REG_SZ:
> > -    case REG_MULTI_SZ: {
> > -        PANSI_STRING    Value;
> > -
> > -        status =3D RegistryQuerySzValue(SourceKey,
> > -                                      ValueName->Buffer,
> > -                                      NULL,
> > -                                      &Value);
> > -        if (NT_SUCCESS(status)) {
> > -            (VOID) RegistryUpdateSzValue(DestinationKey,
> > -                                         ValueName->Buffer,
> > -                                         Type,
> > -                                         Value);
> > -            RegistryFreeSzValue(Value);
> > -        }
> > -
> > -        break;
> > -    }
> > -    case REG_BINARY: {
> > -        PVOID   Value;
> > -        ULONG   Length;
> > -
> > -        status =3D RegistryQueryBinaryValue(SourceKey,
> > -                                          ValueName->Buffer,
> > -                                          &Value,
> > -                                          &Length);
> > -        if (NT_SUCCESS(status)) {
> > -            (VOID) RegistryUpdateBinaryValue(DestinationKey,
> > -                                             ValueName->Buffer,
> > -                                             Value,
> > -                                             Length);
> > -            if (Length !=3D 0)
> > -                RegistryFreeBinaryValue(Value);
> > -        }
> > -
> > -        break;
> > -    }
> > -    default:
> > -        ASSERT(FALSE);
> > -    }
> > -
> > -    return STATUS_SUCCESS;
> > -}
> > -
> > -static NTSTATUS
> > -SettingsCopyInterface(
> > -    IN  PCHAR           InterfacePath,
> > -    IN  PCHAR           InterfacePrefix,
> > -    IN  PANSI_STRING    OldGuid,
> > -    IN  PANSI_STRING    NewGuid
> > -    )
> > -{
> > -    HANDLE              OldKey;
> > -    HANDLE              NewKey;
> > -    PCHAR               OldKeyName;
> > -    PCHAR               NewKeyName;
> > -    ULONG               OldKeyLength;
> > -    ULONG               NewKeyLength;
> > -    NTSTATUS            status;
> > -
> > -    OldKeyLength =3D (ULONG)(strlen(InterfacePath) +
> > -                           strlen(InterfacePrefix) +
> > -                           OldGuid->Length +
> > -                           1) * sizeof(CHAR);
> > -    NewKeyLength =3D (ULONG)(strlen(InterfacePath) +
> > -                           strlen(InterfacePrefix) +
> > -                           NewGuid->Length +
> > -                           1) * sizeof(CHAR);
> > -
> > -    status =3D STATUS_NO_MEMORY;
> > -    OldKeyName =3D __SettingsAllocate(OldKeyLength);
> > -    if (OldKeyName =3D=3D NULL)
> > -        goto fail1;
> > -
> > -    NewKeyName =3D __SettingsAllocate(NewKeyLength);
> > -    if (NewKeyName =3D=3D NULL)
> > -        goto fail2;
> > -
> > -    status =3D RtlStringCbPrintfA(OldKeyName,
> > -                                OldKeyLength,
> > -                                "%s%s%Z",
> > -                                InterfacePath,
> > -                                InterfacePrefix,
> > -                                OldGuid);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail3;
> > -
> > -    status =3D RtlStringCbPrintfA(NewKeyName,
> > -                                NewKeyLength,
> > -                                "%s%s%Z",
> > -                                InterfacePath,
> > -                                InterfacePrefix,
> > -                                NewGuid);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail4;
> > -
> > -    status =3D RegistryOpenSubKey(NULL,
> > -                                OldKeyName,
> > -                                KEY_READ,
> > -                                &OldKey);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail5;
> > -
> > -    status =3D RegistryCreateSubKey(NULL,
> > -                                  NewKeyName,
> > -                                  REG_OPTION_NON_VOLATILE,
> > -                                  &NewKey);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail6;
> > -
> > -    status =3D RegistryEnumerateValues(OldKey,
> > -                                     SettingsCopyInterfaceValue,
> > -                                     NewKey);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail7;
> > -
> > -    RegistryCloseKey(NewKey);
> > -    RegistryCloseKey(OldKey);
> > -    __SettingsFree(NewKeyName);
> > -    __SettingsFree(OldKeyName);
> > -
> > -    return STATUS_SUCCESS;
> > -
> > -fail7:
> > -    Error("fail7\n");
> > -
> > -    RegistryCloseKey(NewKey);
> > -
> > -fail6:
> > -    Error("fail6\n");
> > -
> > -    RegistryCloseKey(OldKey);
> > -
> > -fail5:
> > -    Error("fail5\n");
> > -
> > -fail4:
> > -    Error("fail4\n");
> > -
> > -fail3:
> > -    Error("fail3\n");
> > -
> > -    __SettingsFree(NewKeyName);
> > -
> > -fail2:
> > -    Error("fail2\n");
> > -
> > -    __SettingsFree(OldKeyName);
> > -
> > -fail1:
> > -    Error("fail1 (%08x)\n", status);
> > -
> > -    return status;
> > -}
> > -
> > -static NTSTATUS
> > -SettingsStoreCurrent(
> > -    IN  HANDLE          SubKey,
> > -    IN  PANSI_STRING    Guid,
> > -    IN  PNET_LUID       Luid
> > -    )
> > -{
> > -
> > -    NTSTATUS            status;
> > -
> > -    status =3D RegistryUpdateSzValue(SubKey,
> > -                                   "NetCfgInstanceId",
> > -                                   REG_SZ,
> > -                                   Guid);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail1;
> > -
> > -    status =3D RegistryUpdateBinaryValue(SubKey,
> > -                                       "NetLuid",
> > -                                       Luid,
> > -                                       sizeof(NET_LUID));
> > -    if (!NT_SUCCESS(status))
> > -        goto fail2;
> > -
> > -    (VOID) RegistryDeleteValue(SubKey,
> > -                               "HasSettings");
> > -
> > -    return STATUS_SUCCESS;
> > -
> > -fail2:
> > -    Error("fail2\n");
> > -
> > -fail1:
> > -    Error("fail1 (%08x)\n", status);
> > -
> > -    return status;
> > -}
> > -
> > -static NTSTATUS
> > -SettingsCopy(
> > -    IN  PCHAR           SubKeyName,
> > -    IN  PANSI_STRING    OldGuid,
> > -    IN  PNET_LUID       OldLuid,
> > -    IN  PANSI_STRING    NewGuid,
> > -    IN  PNET_LUID       NewLuid
> > -     )
> > -{
> > -    HANDLE              SettingsKey;
> > -    HANDLE              SubKey;
> > -    NTSTATUS            status;
> > -
> > -    Trace("=3D=3D=3D=3D>\n");
> > -    Info("VIF/%s: FROM %Z\n", SubKeyName, OldGuid);
> > -    Info("VIF/%s: TO   %Z\n", SubKeyName, NewGuid);
> > -
> > -    (VOID) SettingsCopyInterface(INTERFACES_PATH(NetBT),
> > -                                 "Tcpip_",
> > -                                 OldGuid,
> > -                                 NewGuid);
> > -
> > -    (VOID) SettingsCopyInterface(INTERFACES_PATH(Tcpip),
> > -                                 "",
> > -                                 OldGuid,
> > -                                 NewGuid);
> > -
> > -    (VOID) SettingsCopyInterface(INTERFACES_PATH(Tcpip6),
> > -                                 "",
> > -                                 OldGuid,
> > -                                 NewGuid);
> > -
> > -    (VOID) SettingsCopyIpAddresses(4,
> > -                                   OldLuid,
> > -                                   NewLuid);
> > -
> > -    (VOID) SettingsCopyIpAddresses(6,
> > -                                   OldLuid,
> > -                                   NewLuid);
> > -
> > -    SettingsKey =3D DriverGetSettingsKey();
> > -
> > -    status =3D RegistryCreateSubKey(SettingsKey,
> > -                                  SubKeyName,
> > -                                  REG_OPTION_NON_VOLATILE,
> > -                                  &SubKey);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail1;
> > -
> > -    status =3D SettingsStoreCurrent(SubKey,
> > -                                  NewGuid,
> > -                                  NewLuid);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail2;
> > -
> > -    RegistryCloseKey(SubKey);
> > -
> > -    Trace("<=3D=3D=3D=3D\n");
> > -
> > -    return STATUS_SUCCESS;
> > -
> > -fail2:
> > -    Error("fail2\n");
> > -
> > -    RegistryCloseKey(SubKey);
> > -
> > -fail1:
> > -    Error("fail1 (%08x)\n", status);
> > -
> > -    return status;
> > -}
> > -
> > -NTSTATUS
> > -SettingsSave(
> > -    IN  PCHAR       SubKeyName,
> > -    IN  PWCHAR      Alias,
> > -    IN  PWCHAR      Description,
> > -    IN  LPGUID      InterfaceGuid,
> > -    IN  PNET_LUID   InterfaceLuid
> > -    )
> > -{
> > -    HANDLE          SettingsKey;
> > -    HANDLE          SubKey;
> > -    ANSI_STRING     Ansi;
> > -    ULONG           HasSettings;
> > -    NTSTATUS        status;
> > -
> > -    Info("FROM %ws (%ws)\n", Alias, Description);
> > -
> > -    status =3D __GuidToString(InterfaceGuid, &Ansi);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail1;
> > -
> > -    SettingsKey =3D DriverGetSettingsKey();
> > -
> > -    status =3D RegistryCreateSubKey(SettingsKey,
> > -                                  SubKeyName,
> > -                                  REG_OPTION_NON_VOLATILE,
> > -                                  &SubKey);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail2;
> > -
> > -    HasSettings =3D 0;
> > -    status =3D RegistryQueryDwordValue(SubKey,
> > -                                     "HasSettings",
> > -                                     &HasSettings);
> > -    if (!NT_SUCCESS(status))
> > -        HasSettings =3D 0;
> > -    if (HasSettings !=3D 0)
> > -        goto done;
> > -
> > -    Info("FROM %Z\n", Ansi);
> > -    Info("FROM %016llx\n", InterfaceLuid->Value);
> > -
> > -    status =3D SettingsStoreCurrent(SubKey,
> > -                                  &Ansi,
> > -                                  InterfaceLuid);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail3;
> > -
> > -    RtlFreeAnsiString(&Ansi);
> > -
> > -done:
> > -    RegistryCloseKey(SubKey);
> > -
> > -    return STATUS_SUCCESS;
> > -
> > -fail3:
> > -    Error("fail3\n");
> > -
> > -    RegistryCloseKey(SubKey);
> > -
> > -fail2:
> > -    Error("fail2\n");
> > -
> > -    RtlFreeAnsiString(&Ansi);
> > -
> > -fail1:
> > -    Error("fail1 (%08x)\n", status);
> > -
> > -    return status;
> > -}
> > -
> > -NTSTATUS
> > -SettingsRestore(
> > -    IN  PCHAR       SubKeyName,
> > -    IN  PWCHAR      Alias,
> > -    IN  PWCHAR      Description,
> > -    IN  LPGUID      InterfaceGuid,
> > -    IN  PNET_LUID   InterfaceLuid
> > -    )
> > -{
> > -    HANDLE          SettingsKey;
> > -    HANDLE          SubKey;
> > -    ANSI_STRING     Ansi;
> > -    PANSI_STRING    NetCfgInstanceId;
> > -    PNET_LUID       NetLuid;
> > -    ULONG           NetLuidLength;
> > -    NTSTATUS        status;
> > -
> > -    SettingsKey =3D DriverGetSettingsKey();
> > -
> > -    status =3D RegistryOpenSubKey(SettingsKey,
> > -                                SubKeyName,
> > -                                KEY_READ,
> > -                                &SubKey);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail1;
> > -
> > -    status =3D RegistryQuerySzValue(SubKey,
> > -                                  "NetCfgInstanceId",
> > -                                  NULL,
> > -                                  &NetCfgInstanceId);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail2;
> > -
> > -    NetLuidLength =3D 0;
> > -    status =3D RegistryQueryBinaryValue(SubKey,
> > -                                      "NetLuid",
> > -                                      &NetLuid,
> > -                                      &NetLuidLength);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail3;
> > -
> > -    status =3D __GuidToString(InterfaceGuid, &Ansi);
> > -    if (!NT_SUCCESS(status))
> > -        goto fail4;
> > -
> > -    if (RtlCompareString(NetCfgInstanceId, &Ansi, TRUE) !=3D 0) {
> > -        Info("TO %ws (%ws)\n", Alias, Description);
> > -        Info("TO %Z\n", Ansi);
> > -        Info("TO %016llx\n", InterfaceLuid->Value);
> > -
> > -        SettingsCopy(SubKeyName,
> > -                     NetCfgInstanceId,
> > -                     NetLuid,
> > -                     &Ansi,
> > -                     InterfaceLuid);
> > -    } else {
> > -        Info("%s: SettingsCopy not required for %ws\n",
> > -             SubKeyName,
> > -             Description);
> > -    }
> > -
> > -    RtlFreeAnsiString(&Ansi);
> > -
> > -    if (NetLuidLength !=3D 0)
> > -        RegistryFreeBinaryValue(NetLuid);
> > -
> > -    RegistryFreeSzValue(NetCfgInstanceId);
> > -
> > -    RegistryCloseKey(SubKey);
> > -
> > -    return STATUS_SUCCESS;
> > -
> > -fail4:
> > -    Error("fail4\n");
> > -
> > -    if (NetLuidLength !=3D 0)
> > -        RegistryFreeBinaryValue(NetLuid);
> > -
> > -fail3:
> > -    Error("fail3\n");
> > -
> > -    RegistryFreeSzValue(NetCfgInstanceId);
> > -
> > -fail2:
> > -    Error("fail2\n");
> > -
> > -    RegistryCloseKey(SubKey);
> > -
> > -fail1:
> > -    Error("fail1 (%08x)\n", status);
> > -
> > -    return status;
> > -}
> > diff --git a/src/xenvif/settings.h b/src/xenvif/settings.h
> > deleted file mode 100644
> > index 3f964bb..0000000
> > --- a/src/xenvif/settings.h
> > +++ /dev/null
> > @@ -1,54 +0,0 @@
> > -/* Copyright (c) Xen Project.
> > - * Copyright (c) Cloud Software Group, Inc.
> > - * All rights reserved.
> > - *
> > - * Redistribution and use in source and binary forms,
> > - * with or without modification, are permitted provided
> > - * that the following conditions are met:
> > - *
> > - * *   Redistributions of source code must retain the above
> > - *     copyright notice, this list of conditions and the
> > - *     following disclaimer.
> > - * *   Redistributions in binary form must reproduce the above
> > - *     copyright notice, this list of conditions and the
> > - *     following disclaimer in the documentation and/or other
> > - *     materials provided with the distribution.
> > - *
> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
> > - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
> > - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
> > - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> > - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
> > - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> > - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
> > - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> > - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
> > - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> > - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> > - * SUCH DAMAGE.
> > - */
> > -
> > -#ifndef _XENVIF_SETTINGS_H
> > -#define _XENVIF_SETTINGS_H
> > -
> > -extern NTSTATUS
> > -SettingsSave(
> > -    IN  PCHAR       SubKeyName,
> > -    IN  PWCHAR      Alias,
> > -    IN  PWCHAR      Description,
> > -    IN  LPGUID      InterfaceGuid,
> > -    IN  PNET_LUID   InterfaceLuid
> > -    );
> > -
> > -extern NTSTATUS
> > -SettingsRestore(
> > -    IN  PCHAR       SubKeyName,
> > -    IN  PWCHAR      Alias,
> > -    IN  PWCHAR      Description,
> > -    IN  LPGUID      InterfaceGuid,
> > -    IN  PNET_LUID   InterfaceLuid
> > -    );
> > -
> > -#endif  // _XENVIF_SETTINGS_H
> > diff --git a/vs2019/xenvif/xenvif.vcxproj b/vs2019/xenvif/xenvif.vcxpro=
j
> > index 0412426..3e48cf7 100644
> > --- a/vs2019/xenvif/xenvif.vcxproj
> > +++ b/vs2019/xenvif/xenvif.vcxproj
> > @@ -82,7 +82,6 @@
> >       <ClCompile Include=3D"../../src/xenvif/pdo.c" />
> >       <ClCompile Include=3D"../../src/xenvif/receiver.c" />
> >       <ClCompile Include=3D"../../src/xenvif/registry.c" />
> > -    <ClCompile Include=3D"../../src/xenvif/settings.c" />
> >       <ClCompile Include=3D"../../src/xenvif/thread.c" />
> >       <ClCompile Include=3D"../../src/xenvif/transmitter.c" />
> >       <ClCompile Include=3D"../../src/xenvif/controller.c" />
> > diff --git a/vs2022/xenvif/xenvif.vcxproj b/vs2022/xenvif/xenvif.vcxpro=
j
> > index be84232..af9fe96 100644
> > --- a/vs2022/xenvif/xenvif.vcxproj
> > +++ b/vs2022/xenvif/xenvif.vcxproj
> > @@ -74,7 +74,6 @@
> >       <ClCompile Include=3D"../../src/xenvif/pdo.c" />
> >       <ClCompile Include=3D"../../src/xenvif/receiver.c" />
> >       <ClCompile Include=3D"../../src/xenvif/registry.c" />
> > -    <ClCompile Include=3D"../../src/xenvif/settings.c" />
> >       <ClCompile Include=3D"../../src/xenvif/thread.c" />
> >       <ClCompile Include=3D"../../src/xenvif/transmitter.c" />
> >       <ClCompile Include=3D"../../src/xenvif/controller.c" />
>
>
>

--0000000000003bdcb4061e7267ef
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e">Since Driver Verifier&#39;s=C2=A0registry isolation detects opening=C2=
=A0absolute paths to registry keys as a violation (and bugchecks), it&#39;s=
 not possible to copy settings from emulated to PV.</div></div><br><div cla=
ss=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Jul 24, 20=
24 at 9:13=E2=80=AFAM Paul Durrant &lt;<a href=3D"mailto:xadimgnik@gmail.co=
m">xadimgnik@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_q=
uote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,2=
04);padding-left:1ex">On 09/07/2024 11:44, Owen Smith wrote:<br>
&gt; Use MmGetSystemRoutineAddress to dynamically get IoOpenDriverRegistryK=
ey,<br>
&gt; which is not present on Server 2016.<br>
&gt; Where possible, use IoOpenDriverRegistryKey to avoid opening absolute =
registry<br>
&gt; paths, which is a driver verifier violation on Server 2025 WHQL testin=
g.<br>
&gt; <br>
&gt; This does remove PdoSetFriendlyName and SettingsSave/SettingsRestore<b=
r>
&gt; - PdoSetFriendlyName gets an absolute path to the parent of a key open=
ed by an<br>
&gt;=C2=A0 =C2=A0 allowed API<br>
&gt; - SettingsSave/SettingsRestore directly manipulate several absolute pa=
ths, but<br>
&gt;=C2=A0 =C2=A0 due to the recent DeviceID changes, the settings copy cod=
e should not be<br>
&gt;=C2=A0 =C2=A0 neccessary, as the network connection will not be re-crea=
ted on driver update.<br>
&gt; <br>
<br>
What abou when moving from an emulated device to the PV device? That&#39;s =
<br>
why all the settings copy nastiness was originally implemented... it <br>
wasn&#39;t about PV driver update.<br>
<br>
&gt; Signed-off-by: Owen Smith &lt;<a href=3D"mailto:owen.smith@cloud.com" =
target=3D"_blank">owen.smith@cloud.com</a>&gt;<br>
&gt; ---<br>
&gt;=C2=A0 =C2=A0src/xenvif/driver.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 11=
3 +-----<br>
&gt;=C2=A0 =C2=A0src/xenvif/driver.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=
=A0 10 -<br>
&gt;=C2=A0 =C2=A0src/xenvif/pdo.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0| 151 +-------<br>
&gt;=C2=A0 =C2=A0src/xenvif/registry.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 7=
2 +++-<br>
&gt;=C2=A0 =C2=A0src/xenvif/registry.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =
=C2=A09 +-<br>
&gt;=C2=A0 =C2=A0src/xenvif/settings.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 694 ---=
--------------------------------<br>
&gt;=C2=A0 =C2=A0src/xenvif/settings.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 5=
4 ---<br>
&gt;=C2=A0 =C2=A0vs2019/xenvif/xenvif.vcxproj |=C2=A0 =C2=A01 -<br>
&gt;=C2=A0 =C2=A0vs2022/xenvif/xenvif.vcxproj |=C2=A0 =C2=A01 -<br>
&gt;=C2=A0 =C2=A09 files changed, 87 insertions(+), 1018 deletions(-)<br>
&gt;=C2=A0 =C2=A0delete mode 100644 src/xenvif/settings.c<br>
&gt;=C2=A0 =C2=A0delete mode 100644 src/xenvif/settings.h<br>
&gt; <br>
&gt; diff --git a/src/xenvif/driver.c b/src/xenvif/driver.c<br>
&gt; index 3345607..2ac793d 100644<br>
&gt; --- a/src/xenvif/driver.c<br>
&gt; +++ b/src/xenvif/driver.c<br>
&gt; @@ -120,54 +120,6 @@ DriverGetParametersKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return __DriverGetParametersKey();<br>
&gt;=C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -static FORCEINLINE VOID<br>
&gt; -__DriverSetAddressesKey(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 Key<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 Driver.AddressesKey =3D Key;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static FORCEINLINE HANDLE<br>
&gt; -__DriverGetAddressesKey(<br>
&gt; -=C2=A0 =C2=A0 VOID<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 return Driver.AddressesKey;<br>
&gt; -}<br>
&gt; -<br>
&gt; -HANDLE<br>
&gt; -DriverGetAddressesKey(<br>
&gt; -=C2=A0 =C2=A0 VOID<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 return __DriverGetAddressesKey();<br>
&gt; -}<br>
&gt; -<br>
&gt; -static FORCEINLINE VOID<br>
&gt; -__DriverSetSettingsKey(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 Key<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 Driver.SettingsKey =3D Key;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static FORCEINLINE HANDLE<br>
&gt; -__DriverGetSettingsKey(<br>
&gt; -=C2=A0 =C2=A0 VOID<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 return Driver.SettingsKey;<br>
&gt; -}<br>
&gt; -<br>
&gt; -HANDLE<br>
&gt; -DriverGetSettingsKey(<br>
&gt; -=C2=A0 =C2=A0 VOID<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 return __DriverGetSettingsKey();<br>
&gt; -}<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0#define MAXNAMELEN=C2=A0 256<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0static FORCEINLINE VOID<br>
&gt; @@ -265,8 +217,6 @@ DriverUnload(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PDRIVER_OBJECT=C2=A0 DriverObject<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
SettingsKey;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
AddressesKey;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 ParametersKey;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0ASSERT3P(DriverObject, =3D=3D, __DriverGetDr=
iverObject());<br>
&gt; @@ -275,16 +225,6 @@ DriverUnload(<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Driver.NeedReboot =3D FALSE;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 SettingsKey =3D __DriverGetSettingsKey();<br>
&gt; -=C2=A0 =C2=A0 __DriverSetSettingsKey(NULL);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SettingsKey);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 AddressesKey =3D __DriverGetAddressesKey();<br>
&gt; -=C2=A0 =C2=A0 __DriverSetAddressesKey(NULL);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(AddressesKey);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0ParametersKey =3D __DriverGetParametersKey()=
;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0__DriverSetParametersKey(NULL);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; @@ -401,10 +341,7 @@ DriverEntry(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PUNICODE_STRING RegistryPath<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
ServiceKey;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 ParametersKey;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
AddressesKey;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
SettingsKey;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0Index;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 status;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; @@ -428,43 +365,16 @@ DriverEntry(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MONTH,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 YEAR);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryInitialize(RegistryPath);<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryInitialize(DriverObject, RegistryPat=
h);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail1;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenServiceKey(KEY_ALL_ACCESS, &amp;=
ServiceKey);<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryOpenParametersKey(KEY_READ, &amp;Par=
ametersKey);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail2;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenSubKey(ServiceKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Parameters&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KEY_READ,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;ParametersKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0__DriverSetParametersKey(ParametersKey);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryCreateSubKey(ServiceKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Addresses&quot;,<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 REG_OPTION_VOLATILE,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;AddressesKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 __DriverSetAddressesKey(AddressesKey);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryCreateSubKey(ServiceKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Settings&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 REG_OPTION_NON_VOLATILE,<=
br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;SettingsKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail5;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 __DriverSetSettingsKey(SettingsKey);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0DriverObject-&gt;DriverExtension-&gt;AddDevi=
ce =3D AddDevice;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0for (Index =3D 0; Index &lt;=3D IRP_MJ_MAXIM=
UM_FUNCTION; Index++) {<br>
&gt; @@ -477,25 +387,6 @@ DriverEntry(<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -fail5:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail5\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 __DriverSetAddressesKey(NULL);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(AddressesKey);<br>
&gt; -<br>
&gt; -fail4:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail4\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 __DriverSetParametersKey(NULL);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(ParametersKey);<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0fail2:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Error(&quot;fail2\n&quot;);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; diff --git a/src/xenvif/driver.h b/src/xenvif/driver.h<br>
&gt; index b5b9a3d..a9b47d4 100644<br>
&gt; --- a/src/xenvif/driver.h<br>
&gt; +++ b/src/xenvif/driver.h<br>
&gt; @@ -48,16 +48,6 @@ DriverGetParametersKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0VOID<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -extern HANDLE<br>
&gt; -DriverGetAddressesKey(<br>
&gt; -=C2=A0 =C2=A0 VOID<br>
&gt; -=C2=A0 =C2=A0 );<br>
&gt; -<br>
&gt; -extern HANDLE<br>
&gt; -DriverGetSettingsKey(<br>
&gt; -=C2=A0 =C2=A0 VOID<br>
&gt; -=C2=A0 =C2=A0 );<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0extern VOID<br>
&gt;=C2=A0 =C2=A0DriverRequestReboot(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0VOID<br>
&gt; diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c<br>
&gt; index 8ec9814..51cbd97 100644<br>
&gt; --- a/src/xenvif/pdo.c<br>
&gt; +++ b/src/xenvif/pdo.c<br>
&gt; @@ -54,7 +54,6 @@<br>
&gt;=C2=A0 =C2=A0#include &quot;registry.h&quot;<br>
&gt;=C2=A0 =C2=A0#include &quot;thread.h&quot;<br>
&gt;=C2=A0 =C2=A0#include &quot;link.h&quot;<br>
&gt; -#include &quot;settings.h&quot;<br>
&gt;=C2=A0 =C2=A0#include &quot;dbg_print.h&quot;<br>
&gt;=C2=A0 =C2=A0#include &quot;assert.h&quot;<br>
&gt;=C2=A0 =C2=A0#include &quot;util.h&quot;<br>
&gt; @@ -727,30 +726,16 @@ __PdoSetPermanentAddress(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0Buf=
fer<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; -=C2=A0 =C2=A0 ANSI_STRING=C2=A0 =C2=A0 =C2=A0Ansi[2];<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<=
br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D __PdoParseAddress(Buffer, &amp;Pd=
o-&gt;PermanentAddress);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail1;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 RtlZeroMemory(Ansi, sizeof (ANSI_STRING) * 2);<br>
&gt; -=C2=A0 =C2=A0 RtlInitAnsiString(&amp;Ansi[0], Buffer);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryUpdateSzValue(DriverGetAddressesKey(=
),<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__PdoGetName(Pdo),<=
br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0REG_SZ,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Ansi);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;%s: %Z\n&quot;, __PdoGetName(Pdo), &amp;Ansi=
[0]);<br>
&gt; +=C2=A0 =C2=A0 Info(&quot;%s: %s\n&quot;, __PdoGetName(Pdo), Buffer);<=
br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0fail1:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Error(&quot;fail1 (%08x)\n&quot;, status);<b=
r>
&gt;=C2=A0 =C2=A0<br>
&gt; @@ -778,68 +763,9 @@ __PdoClearPermanentAddress(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PXENVIF_PDO Pdo<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; -=C2=A0 =C2=A0 (VOID) RegistryDeleteValue(DriverGetAddressesKey(),<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__PdoGetName(Pdo));<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Pdo-&gt;PermanentAddress,=
 sizeof (ETHERNET_ADDRESS));<br>
&gt;=C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -static NTSTATUS<br>
&gt; -PdoSetFriendlyName(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PXENVIF_PDO Pdo,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 SoftwareKey,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 HardwareKey<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 PANSI_STRING=C2=A0 =C2=A0 DriverDesc;<br>
&gt; -=C2=A0 =C2=A0 CHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Buffer[MA=
XNAMELEN];<br>
&gt; -=C2=A0 =C2=A0 ANSI_STRING=C2=A0 =C2=A0 =C2=A0Ansi[2];<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryQuerySzValue(SoftwareKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;DriverDesc&quot;,<b=
r>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;DriverDesc);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlStringCbPrintfA(Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MAXNAMELEN,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;%Z #%s&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;DriverDesc[0],<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __PdoGetName(Pdo)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 );<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlZeroMemory(Ansi, sizeof (ANSI_STRING) * 2);<br>
&gt; -=C2=A0 =C2=A0 RtlInitAnsiString(&amp;Ansi[0], Buffer);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryUpdateSzValue(HardwareKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;FriendlyName&=
quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0REG_SZ,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Ansi);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;%s: %Z\n&quot;, __PdoGetName(Pdo), &amp;Ansi=
[0]);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryFreeSzValue(DriverDesc);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0static FORCEINLINE NTSTATUS<br>
&gt;=C2=A0 =C2=A0__PdoSetCurrentAddress(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PXENVIF_PDO Pdo,<br>
&gt; @@ -1276,15 +1202,13 @@ PdoUnplugRequested(<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0static FORCEINLINE NTSTATUS<br>
&gt;=C2=A0 =C2=A0PdoParseMibTable(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PXENVIF_PDO=C2=A0 =C2=A0 =C2=A0Pdo,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Softw=
areKey<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PXENVIF_PDO=C2=A0 =C2=A0 =C2=A0Pdo<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 (*__GetIfTable2)(PMIB_IF_TABLE2 *);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0VOID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 (*__FreeMibTable)(PVOID);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0PMIB_IF_TABLE2=C2=A0 =C2=A0 =C2=A0 Table;<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0Index;<br>
&gt; -=C2=A0 =C2=A0 GUID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 Guid;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 status;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D LinkGetRoutineAddress(&quot;netio=
.sys&quot;,<br>
&gt; @@ -1330,56 +1254,10 @@ PdoParseMibTable(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (Row-&gt;OperStatus !=3D If=
OperStatusUp)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0continue;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID) SettingsSave(__PdoGetName(Pdo),<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Row-&gt;Alias,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Row-&gt;Description,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;Row-&gt;InterfaceGuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;Row-&gt;InterfaceLuid);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D STATUS_PNP_REBOOT_R=
EQUIRED;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail4;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 //<br>
&gt; -=C2=A0 =C2=A0 // If there is a stack bound then restore any settings =
that<br>
&gt; -=C2=A0 =C2=A0 // may have been saved from an aliasing device.<br>
&gt; -=C2=A0 =C2=A0 //<br>
&gt; -=C2=A0 =C2=A0 status =3D PdoGetInterfaceGuid(Pdo, SoftwareKey, &amp;G=
uid);<br>
&gt; -=C2=A0 =C2=A0 if (NT_SUCCESS(status)) {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 NET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0 Luid;=
<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
Alias;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
Description;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 RtlZeroMemory(&amp;Luid, sizeof(NET_LUID)=
);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 Alias =3D NULL;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 Description =3D NULL;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D PdoGetInterfaceLuid(Pdo, Softw=
areKey, &amp;Luid);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (NT_SUCCESS(status)) {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for (Index =3D 0; Index &lt=
; Table-&gt;NumEntries; Index++) {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMIB_IF_ROW2=
=C2=A0 =C2=A0 Row =3D &amp;Table-&gt;Table[Index];<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Trace(&quot;%=
s: CHECKING %ws (%ws)\n&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 __PdoGetName(Pdo),<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 Row-&gt;Alias,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 Row-&gt;Description);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (Row-&gt;I=
nterfaceLuid.Value !=3D Luid.Value)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 continue;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Alias =3D Row=
-&gt;Alias;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Description =
=3D Row-&gt;Description;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID) SettingsRestore(__PdoGetName(Pdo),=
<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Alias,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Description,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;Guid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;Luid);<br>
&gt; -=C2=A0 =C2=A0 }<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0__FreeMibTable(Table);<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
&gt; @@ -1408,7 +1286,6 @@ PdoStartDevice(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 SoftwareKey;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
HardwareKey;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 status;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D STATUS_UNSUCCESSFUL;<br>
&gt; @@ -1421,21 +1298,11 @@ PdoStartDevice(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail2;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenHardwareKey(__PdoGetDeviceObject=
(Pdo),<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0KEY_ALL_ACCE=
SS,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;Hardwar=
eKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) PdoSetFriendlyName(Pdo,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SoftwareKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 HardwareKey);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D __PdoSetCurrentAddress(Pdo, Softw=
areKey);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D PdoParseMibTable(Pdo, SoftwareKey);<br>
&gt; +=C2=A0 =C2=A0 status =3D PdoParseMibTable(Pdo);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (status =3D=3D STATUS_PNP_REBOOT_REQUIRED=
 || !PdoUnplugRequested(Pdo)) {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PdoUnplugRequest(Pdo, TRUE); /=
/ fix unplug reference count<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DriverRequestReboot();<br>
&gt; @@ -1445,7 +1312,7 @@ PdoStartDevice(<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D PdoD3ToD0(Pdo);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail5;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0PdoUnplugRequest(Pdo, TRUE);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; @@ -1454,20 +1321,14 @@ PdoStartDevice(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Irp-&gt;IoStatus.Status =3D STATUS_SUCCESS;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IoCompleteRequest(Irp, IO_NO_INCREMENT);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(HardwareKey);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0RegistryCloseKey(SoftwareKey);<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -fail5:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail5\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlZeroMemory(&amp;Pdo-&gt;CurrentAddress, sizeof (ETHE=
RNET_ADDRESS));<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0fail4:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Error(&quot;fail4\n&quot;);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(HardwareKey);<br>
&gt; +=C2=A0 =C2=A0 RtlZeroMemory(&amp;Pdo-&gt;CurrentAddress, sizeof (ETHE=
RNET_ADDRESS));<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0fail3:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Error(&quot;fail3\n&quot;);<br>
&gt; diff --git a/src/xenvif/registry.c b/src/xenvif/registry.c<br>
&gt; index 8f84818..792ce03 100644<br>
&gt; --- a/src/xenvif/registry.c<br>
&gt; +++ b/src/xenvif/registry.c<br>
&gt; @@ -38,8 +38,13 @@<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0#define REGISTRY_TAG &#39;GERX&#39;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +static PDRIVER_OBJECT=C2=A0 =C2=A0RegistryDriverObject;<br>
&gt;=C2=A0 =C2=A0static UNICODE_STRING=C2=A0 =C2=A0RegistryPath;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +typedef NTSTATUS(*IOOPENDRIVERREGISTRYKEY)(PDRIVER_OBJECT, DRIVER_REG=
KEY_TYPE, ACCESS_MASK, ULONG, PHANDLE);<br>
&gt; +<br>
&gt; +static IOOPENDRIVERREGISTRYKEY __IoOpenDriverRegistryKey;<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0static FORCEINLINE PVOID<br>
&gt;=C2=A0 =C2=A0__RegistryAllocate(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 ULONG=C2=A0 =C2=A0Length<br>
&gt; @@ -58,9 +63,12 @@ __RegistryFree(<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0NTSTATUS<br>
&gt;=C2=A0 =C2=A0RegistryInitialize(<br>
&gt; -=C2=A0 =C2=A0 IN PUNICODE_STRING=C2=A0 Path<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PDRIVER_OBJECT=C2=A0 DriverObject,<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PUNICODE_STRING Path<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; +=C2=A0 =C2=A0 UNICODE_STRING=C2=A0 =C2=A0 =C2=A0 Unicode;<br>
&gt; +=C2=A0 =C2=A0 PVOID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0Func;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 status;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0ASSERT3P(RegistryPath.Buffer, =3D=3D, NULL);=
<br>
&gt; @@ -69,6 +77,16 @@ RegistryInitialize(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail1;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +=C2=A0 =C2=A0 ASSERT3P(RegistryDriverObject, =3D=3D, NULL);<br>
&gt; +=C2=A0 =C2=A0 RegistryDriverObject =3D DriverObject;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 ASSERT3P(__IoOpenDriverRegistryKey, =3D=3D, NULL);<br>
&gt; +=C2=A0 =C2=A0 RtlInitUnicodeString(&amp;Unicode, L&quot;IoOpenDriverR=
egistryKey&quot;);<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 Func =3D MmGetSystemRoutineAddress(&amp;Unicode);<br>
&gt; +=C2=A0 =C2=A0 if (Func !=3D NULL)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __IoOpenDriverRegistryKey =3D (IOOPENDRIV=
ERREGISTRYKEY)Func;<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0fail1:<br>
&gt; @@ -82,6 +100,10 @@ RegistryTeardown(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0VOID<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; +=C2=A0 =C2=A0 __IoOpenDriverRegistryKey =3D NULL;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 RegistryDriverObject =3D NULL;<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0RtlFreeUnicodeString(&amp;RegistryPath);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0RegistryPath.Buffer =3D NULL;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0RegistryPath.MaximumLength =3D RegistryPath.=
Length =3D 0;<br>
&gt; @@ -266,6 +288,54 @@ RegistryCreateServiceKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return RegistryCreateKey(NULL, &amp;Registry=
Path, REG_OPTION_NON_VOLATILE, Key);<br>
&gt;=C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +NTSTATUS<br>
&gt; +RegistryOpenParametersKey(<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 ACCESS_MASK=C2=A0 =C2=A0 =C2=A0DesiredAccess,<=
br>
&gt; +=C2=A0 =C2=A0 OUT PHANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Key<br>
&gt; +=C2=A0 =C2=A0 )<br>
&gt; +{<br>
&gt; +=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
ServiceKey;<br>
&gt; +=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 statu=
s;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 if (__IoOpenDriverRegistryKey !=3D NULL) {<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D __IoOpenDriverRegistryKey(Regi=
stryDriverObject,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0DriverRegKeyParameters,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0DesiredAccess,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A00,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0Key);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
&gt; +=C2=A0 =C2=A0 }<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryOpenKey(NULL, &amp;RegistryPath, Des=
iredAccess, &amp;ServiceKey);<br>
&gt; +=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryOpenSubKey(ServiceKey, &quot;Paramet=
ers&quot;, DesiredAccess, Key);<br>
&gt; +=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; +<br>
&gt; +done:<br>
&gt; +=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; +<br>
&gt; +fail3:<br>
&gt; +=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; +<br>
&gt; +fail2:<br>
&gt; +=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; +<br>
&gt; +fail1:<br>
&gt; +=C2=A0 =C2=A0 Error(&quot;fail1 %08x\n&quot;, status);<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 return status;<br>
&gt; +}<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0NTSTATUS<br>
&gt;=C2=A0 =C2=A0RegistryOpenSoftwareKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PDEVICE_OBJECT=C2=A0 DeviceObject,<=
br>
&gt; diff --git a/src/xenvif/registry.h b/src/xenvif/registry.h<br>
&gt; index c656806..60c50e8 100644<br>
&gt; --- a/src/xenvif/registry.h<br>
&gt; +++ b/src/xenvif/registry.h<br>
&gt; @@ -37,7 +37,8 @@<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0extern NTSTATUS<br>
&gt;=C2=A0 =C2=A0RegistryInitialize(<br>
&gt; -=C2=A0 =C2=A0 IN PUNICODE_STRING=C2=A0 Path<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PDRIVER_OBJECT=C2=A0 DriverObject,<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PUNICODE_STRING Path<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0);<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0extern VOID<br>
&gt; @@ -72,6 +73,12 @@ RegistryCreateServiceKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0OUT PHANDLE=C2=A0 =C2=A0 =C2=A0Key<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +extern NTSTATUS<br>
&gt; +RegistryOpenParametersKey(<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 ACCESS_MASK=C2=A0 =C2=A0 =C2=A0DesiredAccess,<=
br>
&gt; +=C2=A0 =C2=A0 OUT PHANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Key<br>
&gt; +=C2=A0 =C2=A0 );<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0extern NTSTATUS<br>
&gt;=C2=A0 =C2=A0RegistryOpenSoftwareKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PDEVICE_OBJECT=C2=A0 DeviceObject,<=
br>
&gt; diff --git a/src/xenvif/settings.c b/src/xenvif/settings.c<br>
&gt; deleted file mode 100644<br>
&gt; index 4dd4ec4..0000000<br>
&gt; --- a/src/xenvif/settings.c<br>
&gt; +++ /dev/null<br>
&gt; @@ -1,694 +0,0 @@<br>
&gt; -/* Copyright (c) Xen Project.<br>
&gt; - * Copyright (c) Cloud Software Group, Inc.<br>
&gt; - * All rights reserved.<br>
&gt; - *<br>
&gt; - * Redistribution and use in source and binary forms,<br>
&gt; - * with or without modification, are permitted provided<br>
&gt; - * that the following conditions are met:<br>
&gt; - *<br>
&gt; - * *=C2=A0 =C2=A0Redistributions of source code must retain the above=
<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0copyright notice, this list of conditions and t=
he<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0following disclaimer.<br>
&gt; - * *=C2=A0 =C2=A0Redistributions in binary form must reproduce the ab=
ove<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0copyright notice, this list of conditions and t=
he<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0following disclaimer in the documentation and/o=
r other<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0materials provided with the distribution.<br>
&gt; - *<br>
&gt; - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND<br>
&gt; - * CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTI=
ES,<br>
&gt; - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF<br>
&gt; - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE<br>
&gt; - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR<br>
&gt; - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,<br>
&gt; - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,<br>
&gt; - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR<br>
&gt; - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
&gt; - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,<br>
&gt; - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING<br>
&gt; - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE<br>
&gt; - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF<br>
&gt; - * SUCH DAMAGE.<br>
&gt; - */<br>
&gt; -<br>
&gt; -#include &lt;ntddk.h&gt;<br>
&gt; -#include &lt;ntstrsafe.h&gt;<br>
&gt; -<br>
&gt; -#include &quot;registry.h&quot;<br>
&gt; -#include &quot;driver.h&quot;<br>
&gt; -#include &quot;dbg_print.h&quot;<br>
&gt; -#include &quot;assert.h&quot;<br>
&gt; -#include &quot;util.h&quot;<br>
&gt; -<br>
&gt; -#define SETTINGS_TAG &#39;TTES&#39;<br>
&gt; -<br>
&gt; -#define INTERFACES_PATH(_Name)=C2=A0 =C2=A0 =C2=A0 \<br>
&gt; -=C2=A0 =C2=A0 &quot;\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\S=
ervices\\&quot; ## #_Name ## &quot;\\Parameters\\Interfaces\\&quot;<br>
&gt; -<br>
&gt; -#define IPV6_PATH=C2=A0 =C2=A0\<br>
&gt; -=C2=A0 =C2=A0 &quot;\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\C=
ontrol\\Nsi\\{eb004a01-9b1a-11d4-9123-0050047759bc}\\10&quot;<br>
&gt; -<br>
&gt; -#define IPV4_PATH=C2=A0 =C2=A0\<br>
&gt; -=C2=A0 =C2=A0 &quot;\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\C=
ontrol\\Nsi\\{eb004a00-9b1a-11d4-9123-0050047759bc}\\10&quot;<br>
&gt; -<br>
&gt; -#define NETLUID_STRING_LENGTH 16<br>
&gt; -<br>
&gt; -typedef struct _SETTINGS_COPY_IP_ADDRESS_PARAMETERS {<br>
&gt; -=C2=A0 =C2=A0 CHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 SrcPrefix[NETLUID_STRIN=
G_LENGTH + 1];<br>
&gt; -=C2=A0 =C2=A0 CHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 DstPrefix[NETLUID_STRIN=
G_LENGTH + 1];<br>
&gt; -} SETTINGS_COPY_IP_ADDRESS_PARAMETERS, *PSETTINGS_COPY_IP_ADDRESS_PAR=
AMETERS;<br>
&gt; -<br>
&gt; -static FORCEINLINE PVOID<br>
&gt; -__SettingsAllocate(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 ULONG=C2=A0 =C2=A0Length<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 return __AllocatePoolWithTag(NonPagedPool, Length, SETT=
INGS_TAG);<br>
&gt; -}<br>
&gt; -<br>
&gt; -static FORCEINLINE VOID<br>
&gt; -__SettingsFree(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PVOID=C2=A0 =C2=A0Buffer<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 __FreePoolWithTag(Buffer, SETTINGS_TAG);<br>
&gt; -}<br>
&gt; -<br>
&gt; -static FORCEINLINE NTSTATUS<br>
&gt; -__GuidToString(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 LPGUID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Guid,=
<br>
&gt; -=C2=A0 =C2=A0 OUT PANSI_STRING=C2=A0 =C2=A0 Ansi<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 statu=
s;<br>
&gt; -=C2=A0 =C2=A0 UNICODE_STRING=C2=A0 =C2=A0 =C2=A0 Unicode;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlStringFromGUID(Guid, &amp;Unicode);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlUnicodeStringToAnsiString(Ansi, &amp;Unic=
ode, TRUE);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlFreeUnicodeString(&amp;Unicode);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlFreeUnicodeString(&amp;Unicode);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static NTSTATUS<br>
&gt; -SettingsCopyIpAddressesValue(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PVOID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Conte=
xt,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Key,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ValueName,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Type<=
br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 PSETTINGS_COPY_IP_ADDRESS_PARAMETERS=C2=A0 =C2=A0 Param=
eters =3D Context;<br>
&gt; -=C2=A0 =C2=A0 PVOID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0Value;<br>
&gt; -=C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0ValueLength;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<=
br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 UNREFERENCED_PARAMETER(Type);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 if (_strnicmp(ValueName-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Parame=
ters-&gt;SrcPrefix,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NETLUI=
D_STRING_LENGTH) !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Trace(&quot;=C2=A0 =C2=A0 -&gt; %Z\n&quot;, ValueName);=
<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryQueryBinaryValue(Key,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ValueName-&=
gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;Value,=
<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;ValueL=
ength);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryDeleteValue(Key,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ValueName-&gt;Buffer);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 ASSERT(NETLUID_STRING_LENGTH &lt; ValueName-&gt;Length)=
;<br>
&gt; -=C2=A0 =C2=A0 memcpy(ValueName-&gt;Buffer, Parameters-&gt;DstPrefix, =
NETLUID_STRING_LENGTH);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Trace(&quot;=C2=A0 =C2=A0 &lt;- %Z\n&quot;, ValueName);=
<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryUpdateBinaryValue(Key,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Value=
Name-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Value=
,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Value=
Length);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 if (ValueLength !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 RegistryFreeBinaryValue(Value);<br>
&gt; -<br>
&gt; -done:<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 if (ValueLength !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 RegistryFreeBinaryValue(Value);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static NTSTATUS<br>
&gt; -SettingsCopyIpAddresses(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Version,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldLuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewLuid<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 SETTINGS_COPY_IP_ADDRESS_PARAMETERS Parameters;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Key;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlStringCbPrintfA(Parameters.SrcPrefix,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeof(Parameters.SrcPrefix),<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;%016llx&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 _byteswap_uint64(OldLuid-&gt;Val=
ue));<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlStringCbPrintfA(Parameters.DstPrefix,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeof(Parameters.DstPrefix),<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;%016llx&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 _byteswap_uint64(NewLuid-&gt;Val=
ue));<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenSubKey(NULL,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (Version =3D=3D 4) ? IPV4_PATH :=
 IPV6_PATH,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KEY_ALL_ACCESS,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;Key);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;IPv%u: %s -&gt; %s\n&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Version,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Parameters.SrcPrefix,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Parameters.DstPrefix);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryEnumerateValues(Key,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0SettingsCopy=
IpAddressesValue,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;Paramet=
ers);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(Key);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail4:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail4\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(Key);<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static NTSTATUS<br>
&gt; -SettingsCopyInterfaceValue(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PVOID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 Context,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0SourceKey,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 =C2=A0ValueName,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 Type<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0DestinationKey =3D Context;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0status;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Trace(&quot; - %Z\n&quot;, ValueName);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 switch (Type) {<br>
&gt; -=C2=A0 =C2=A0 case REG_DWORD: {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0Value;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D RegistryQueryDwordValue(Source=
Key,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0ValueName-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0&amp;Value);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID) RegistryUpdateDwordV=
alue(DestinationKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 ValueName-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 Value);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
&gt; -=C2=A0 =C2=A0 }<br>
&gt; -=C2=A0 =C2=A0 case REG_SZ:<br>
&gt; -=C2=A0 =C2=A0 case REG_MULTI_SZ: {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 PANSI_STRING=C2=A0 =C2=A0 Value;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D RegistryQuerySzValue(SourceKey=
,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ValueName-&=
gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;Value)=
;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (NT_SUCCESS(status)) {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID) RegistryUpdateSzValu=
e(DestinationKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0ValueName-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0Type,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0Value);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RegistryFreeSzValue(Value);=
<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
&gt; -=C2=A0 =C2=A0 }<br>
&gt; -=C2=A0 =C2=A0 case REG_BINARY: {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 PVOID=C2=A0 =C2=A0Value;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0Length;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D RegistryQueryBinaryValue(Sourc=
eKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 ValueName-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 &amp;Value,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 &amp;Length);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (NT_SUCCESS(status)) {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID) RegistryUpdateBinary=
Value(DestinationKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0ValueName-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0Value,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0Length);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (Length !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RegistryFreeB=
inaryValue(Value);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
&gt; -=C2=A0 =C2=A0 }<br>
&gt; -=C2=A0 =C2=A0 default:<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 ASSERT(FALSE);<br>
&gt; -=C2=A0 =C2=A0 }<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static NTSTATUS<br>
&gt; -SettingsCopyInterface(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
InterfacePath,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
InterfacePrefix,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 OldGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 NewGuid<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
OldKey;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
NewKey;<br>
&gt; -=C2=A0 =C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0OldKeyName;<br>
&gt; -=C2=A0 =C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0NewKeyName;<br>
&gt; -=C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0OldKeyLength;<br>
&gt; -=C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0NewKeyLength;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 statu=
s;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 OldKeyLength =3D (ULONG)(strlen(InterfacePath) +<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0strlen(InterfacePrefix) +<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldGuid-&gt;Length +<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A01) * sizeof(CHAR);<br>
&gt; -=C2=A0 =C2=A0 NewKeyLength =3D (ULONG)(strlen(InterfacePath) +<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0strlen(InterfacePrefix) +<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewGuid-&gt;Length +<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A01) * sizeof(CHAR);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D STATUS_NO_MEMORY;<br>
&gt; -=C2=A0 =C2=A0 OldKeyName =3D __SettingsAllocate(OldKeyLength);<br>
&gt; -=C2=A0 =C2=A0 if (OldKeyName =3D=3D NULL)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 NewKeyName =3D __SettingsAllocate(NewKeyLength);<br>
&gt; -=C2=A0 =C2=A0 if (NewKeyName =3D=3D NULL)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlStringCbPrintfA(OldKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 OldKeyLength,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;%s%s%Z&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 InterfacePath,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 InterfacePrefix,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 OldGuid);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlStringCbPrintfA(NewKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NewKeyLength,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;%s%s%Z&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 InterfacePath,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 InterfacePrefix,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NewGuid);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenSubKey(NULL,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 OldKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KEY_READ,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;OldKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail5;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryCreateSubKey(NULL,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NewKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 REG_OPTION_NON_VOLATILE,<=
br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;NewKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail6;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryEnumerateValues(OldKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0SettingsCopy=
InterfaceValue,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail7;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(NewKey);<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(OldKey);<br>
&gt; -=C2=A0 =C2=A0 __SettingsFree(NewKeyName);<br>
&gt; -=C2=A0 =C2=A0 __SettingsFree(OldKeyName);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail7:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail7\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(NewKey);<br>
&gt; -<br>
&gt; -fail6:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail6\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(OldKey);<br>
&gt; -<br>
&gt; -fail5:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail5\n&quot;);<br>
&gt; -<br>
&gt; -fail4:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail4\n&quot;);<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 __SettingsFree(NewKeyName);<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 __SettingsFree(OldKeyName);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static NTSTATUS<br>
&gt; -SettingsStoreCurrent(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SubKe=
y,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 Guid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0Luid<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 statu=
s;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryUpdateSzValue(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;NetCfgInstanc=
eId&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0REG_SZ,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Guid);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryUpdateBinaryValue(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot=
;NetLuid&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Luid,=
<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeo=
f(NET_LUID));<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) RegistryDeleteValue(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;HasSettings&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static NTSTATUS<br>
&gt; -SettingsCopy(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
SubKeyName,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 OldGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0OldLuid,<b=
r>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 NewGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0NewLuid<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0)<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
SettingsKey;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
SubKey;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 statu=
s;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Trace(&quot;=3D=3D=3D=3D&gt;\n&quot;);<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;VIF/%s: FROM %Z\n&quot;, SubKeyName, OldGuid=
);<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;VIF/%s: TO=C2=A0 =C2=A0%Z\n&quot;, SubKeyNam=
e, NewGuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) SettingsCopyInterface(INTERFACES_PATH(NetBT),<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;Tcpip_&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldGuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewGuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) SettingsCopyInterface(INTERFACES_PATH(Tcpip),<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldGuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewGuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) SettingsCopyInterface(INTERFACES_PATH(Tcpip6),<b=
r>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldGuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewGuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) SettingsCopyIpAddresses(4,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldLuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewLuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) SettingsCopyIpAddresses(6,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldLuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewLuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 SettingsKey =3D DriverGetSettingsKey();<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryCreateSubKey(SettingsKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SubKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 REG_OPTION_NON_VOLATILE,<=
br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;SubKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D SettingsStoreCurrent(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NewGuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NewLuid);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SubKey);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Trace(&quot;&lt;=3D=3D=3D=3D\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SubKey);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -NTSTATUS<br>
&gt; -SettingsSave(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0SubKeyName,<br=
>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Alias,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Description,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 LPGUID=C2=A0 =C2=A0 =C2=A0 InterfaceGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0InterfaceLuid<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SettingsKey;<b=
r>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SubKey;<br>
&gt; -=C2=A0 =C2=A0 ANSI_STRING=C2=A0 =C2=A0 =C2=A0Ansi;<br>
&gt; -=C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0HasSettin=
gs;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;FROM %ws (%ws)\n&quot;, Alias, Description);=
<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D __GuidToString(InterfaceGuid, &amp;Ansi);<br=
>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 SettingsKey =3D DriverGetSettingsKey();<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryCreateSubKey(SettingsKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SubKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 REG_OPTION_NON_VOLATILE,<=
br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;SubKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 HasSettings =3D 0;<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryQueryDwordValue(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;HasSet=
tings&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;HasSett=
ings);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 HasSettings =3D 0;<br>
&gt; -=C2=A0 =C2=A0 if (HasSettings !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;FROM %Z\n&quot;, Ansi);<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;FROM %016llx\n&quot;, InterfaceLuid-&gt;Valu=
e);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D SettingsStoreCurrent(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;Ansi,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 InterfaceLuid);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlFreeAnsiString(&amp;Ansi);<br>
&gt; -<br>
&gt; -done:<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SubKey);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SubKey);<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlFreeAnsiString(&amp;Ansi);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -NTSTATUS<br>
&gt; -SettingsRestore(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0SubKeyName,<br=
>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Alias,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Description,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 LPGUID=C2=A0 =C2=A0 =C2=A0 InterfaceGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0InterfaceLuid<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SettingsKey;<b=
r>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SubKey;<br>
&gt; -=C2=A0 =C2=A0 ANSI_STRING=C2=A0 =C2=A0 =C2=A0Ansi;<br>
&gt; -=C2=A0 =C2=A0 PANSI_STRING=C2=A0 =C2=A0 NetCfgInstanceId;<br>
&gt; -=C2=A0 =C2=A0 PNET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0NetLuid;<br>
&gt; -=C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NetLuidLe=
ngth;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 SettingsKey =3D DriverGetSettingsKey();<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenSubKey(SettingsKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SubKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KEY_READ,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;SubKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryQuerySzValue(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;NetCfgInstanceId&qu=
ot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;NetCfgInstanceId);<b=
r>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 NetLuidLength =3D 0;<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryQueryBinaryValue(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;NetLu=
id&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;NetLui=
d,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;NetLui=
dLength);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D __GuidToString(InterfaceGuid, &amp;Ansi);<br=
>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 if (RtlCompareString(NetCfgInstanceId, &amp;Ansi, TRUE)=
 !=3D 0) {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 Info(&quot;TO %ws (%ws)\n&quot;, Alias, D=
escription);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 Info(&quot;TO %Z\n&quot;, Ansi);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 Info(&quot;TO %016llx\n&quot;, InterfaceL=
uid-&gt;Value);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 SettingsCopy(SubKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0NetCfgInstanceId,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0NetLuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0&amp;Ansi,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0InterfaceLuid);<br>
&gt; -=C2=A0 =C2=A0 } else {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 Info(&quot;%s: SettingsCopy not required =
for %ws\n&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0SubKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Description);<br>
&gt; -=C2=A0 =C2=A0 }<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlFreeAnsiString(&amp;Ansi);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 if (NetLuidLength !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 RegistryFreeBinaryValue(NetLuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryFreeSzValue(NetCfgInstanceId);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SubKey);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail4:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail4\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 if (NetLuidLength !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 RegistryFreeBinaryValue(NetLuid);<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryFreeSzValue(NetCfgInstanceId);<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SubKey);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; diff --git a/src/xenvif/settings.h b/src/xenvif/settings.h<br>
&gt; deleted file mode 100644<br>
&gt; index 3f964bb..0000000<br>
&gt; --- a/src/xenvif/settings.h<br>
&gt; +++ /dev/null<br>
&gt; @@ -1,54 +0,0 @@<br>
&gt; -/* Copyright (c) Xen Project.<br>
&gt; - * Copyright (c) Cloud Software Group, Inc.<br>
&gt; - * All rights reserved.<br>
&gt; - *<br>
&gt; - * Redistribution and use in source and binary forms,<br>
&gt; - * with or without modification, are permitted provided<br>
&gt; - * that the following conditions are met:<br>
&gt; - *<br>
&gt; - * *=C2=A0 =C2=A0Redistributions of source code must retain the above=
<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0copyright notice, this list of conditions and t=
he<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0following disclaimer.<br>
&gt; - * *=C2=A0 =C2=A0Redistributions in binary form must reproduce the ab=
ove<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0copyright notice, this list of conditions and t=
he<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0following disclaimer in the documentation and/o=
r other<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0materials provided with the distribution.<br>
&gt; - *<br>
&gt; - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND<br>
&gt; - * CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTI=
ES,<br>
&gt; - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF<br>
&gt; - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE<br>
&gt; - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR<br>
&gt; - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,<br>
&gt; - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,<br>
&gt; - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR<br>
&gt; - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
&gt; - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,<br>
&gt; - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING<br>
&gt; - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE<br>
&gt; - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF<br>
&gt; - * SUCH DAMAGE.<br>
&gt; - */<br>
&gt; -<br>
&gt; -#ifndef _XENVIF_SETTINGS_H<br>
&gt; -#define _XENVIF_SETTINGS_H<br>
&gt; -<br>
&gt; -extern NTSTATUS<br>
&gt; -SettingsSave(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0SubKeyName,<br=
>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Alias,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Description,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 LPGUID=C2=A0 =C2=A0 =C2=A0 InterfaceGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0InterfaceLuid<br>
&gt; -=C2=A0 =C2=A0 );<br>
&gt; -<br>
&gt; -extern NTSTATUS<br>
&gt; -SettingsRestore(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0SubKeyName,<br=
>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Alias,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Description,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 LPGUID=C2=A0 =C2=A0 =C2=A0 InterfaceGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0InterfaceLuid<br>
&gt; -=C2=A0 =C2=A0 );<br>
&gt; -<br>
&gt; -#endif=C2=A0 // _XENVIF_SETTINGS_H<br>
&gt; diff --git a/vs2019/xenvif/xenvif.vcxproj b/vs2019/xenvif/xenvif.vcxpr=
oj<br>
&gt; index 0412426..3e48cf7 100644<br>
&gt; --- a/vs2019/xenvif/xenvif.vcxproj<br>
&gt; +++ b/vs2019/xenvif/xenvif.vcxproj<br>
&gt; @@ -82,7 +82,6 @@<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/pdo.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/receiver.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/registry.c&quot; /&gt;<br>
&gt; -=C2=A0 =C2=A0 &lt;ClCompile Include=3D&quot;../../src/xenvif/settings=
.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/thread.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/transmitter.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/controller.c&quot; /&gt;<br>
&gt; diff --git a/vs2022/xenvif/xenvif.vcxproj b/vs2022/xenvif/xenvif.vcxpr=
oj<br>
&gt; index be84232..af9fe96 100644<br>
&gt; --- a/vs2022/xenvif/xenvif.vcxproj<br>
&gt; +++ b/vs2022/xenvif/xenvif.vcxproj<br>
&gt; @@ -74,7 +74,6 @@<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/pdo.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/receiver.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/registry.c&quot; /&gt;<br>
&gt; -=C2=A0 =C2=A0 &lt;ClCompile Include=3D&quot;../../src/xenvif/settings=
.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/thread.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/transmitter.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/controller.c&quot; /&gt;<br>
<br>
<br>
</blockquote></div>

--0000000000003bdcb4061e7267ef--


From win-pv-devel-bounces@lists.xenproject.org Tue Jul 30 14:31:06 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 30 Jul 2024 14:31:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.767857.1178568 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sYnsX-0006EH-6B; Tue, 30 Jul 2024 14:31:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 767857.1178568; Tue, 30 Jul 2024 14:31:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sYnsX-0006EA-3a; Tue, 30 Jul 2024 14:31:05 +0000
Received: by outflank-mailman (input) for mailman id 767857;
 Tue, 30 Jul 2024 14:31:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=PK9p=O6=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sYnsW-0006E4-Df
 for win-pv-devel@lists.xenproject.org; Tue, 30 Jul 2024 14:31:04 +0000
Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com
 [2a00:1450:4864:20::22e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5896a77f-4e80-11ef-bc01-fd08da9f4363;
 Tue, 30 Jul 2024 16:31:02 +0200 (CEST)
Received: by mail-lj1-x22e.google.com with SMTP id
 38308e7fff4ca-2ef2cb7d562so61765961fa.3
 for <win-pv-devel@lists.xenproject.org>; Tue, 30 Jul 2024 07:31:02 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5896a77f-4e80-11ef-bc01-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722349861; x=1722954661; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=hHyYRWNVJZPpzrACDouEPm2UL9LaKqIktchIwmPsSks=;
        b=WmOaXVK5ttRTbmH5ue7w3b6Hr+Mp5UuYsfiOib50ailyMvXf35qQDKUBNMMMkrPPef
         A2rxbAb7KGLF7c7IjsKAkxpkabtN0IBvlJD9AYeafiMXqLHk7svMhzl/5Nvj8u+TwgzL
         jvel0djCCjzbwg8BfI/ZLxDYrncjYA30YrFvk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722349861; x=1722954661;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=hHyYRWNVJZPpzrACDouEPm2UL9LaKqIktchIwmPsSks=;
        b=Wu4Slpk2wSa9Z/zClMzfDnr17jlCJilmdpPxEcNZAMlYNWQvBfficGaYjt8P3toeVG
         Ngnf/R/DsMx1Hhi2zZK8Ov7oQXqcn70zKv90d3jNds+w5ncDu6v08Bycj1NKDUEZzFtJ
         qGRagj8cVcNpp0Aw8c8oNa4EY2kz8CCPYBm0xRmef5UV61qRRkueXZJMl8jLVAzDQsBx
         omccesavDWSWFxv3mFUIU5V0gogrcCN1L5Pul/CFBuu9uDYCuSCEV3PKC+V92oZO5Tcz
         NLkgS0J5TonkXNNaI97sjyDTQqDPPzpF0AyupEs6AdEgO8HXD30zBVZA0RXPgSqD87zS
         m2Dw==
X-Gm-Message-State: AOJu0YywWrnz96f7x7l73xNhQsyAdcpYwy6Vqt/OUP7q57cTmi3OX49Y
	0SUn+iwVMvNeB9ir+JgCak49zy+2uLaznc87ki+aXd3yQUvsWjOztpLqVt4PoKcHAfM2pXEEkAQ
	MzGVOyOMQaFo/sfIZSyaovxx8bq+oaDB6y4oNljegSTPqsIY=
X-Google-Smtp-Source: AGHT+IEUeu4zv4ESoLaZtyrLWvdU41JuujXBbt0JEj4CddRRwmDdQtr7x21xF6AcQe9tKVmIwo5JiZX3/iPuoEivNuY=
X-Received: by 2002:a2e:3009:0:b0:2ef:2c2e:598a with SMTP id
 38308e7fff4ca-2f12ecd28b1mr86433151fa.11.1722349861397; Tue, 30 Jul 2024
 07:31:01 -0700 (PDT)
MIME-Version: 1.0
References: <20240709104811.987-1-owen.smith@cloud.com> <005cf480-27df-4b09-a813-608d2ffc38d9@xen.org>
In-Reply-To: <005cf480-27df-4b09-a813-608d2ffc38d9@xen.org>
From: Owen Smith <owen.smith@citrix.com>
Date: Tue, 30 Jul 2024 15:30:49 +0100
Message-ID: <CAC_UY89A5521cnJu+-JPod6LaR5K1orghROg=d=NoV=F0+fiWA@mail.gmail.com>
Subject: Re: [XENNET PATCH 1/2] Report NDIS minor version as expected by OS
To: paul@xen.org
Cc: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000ab09fa061e77d3fc"

--000000000000ab09fa061e77d3fc
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Makes sense, I will update to pull Major and Minor from NdisGetVersion()

On Wed, Jul 24, 2024 at 9:06=E2=80=AFAM Paul Durrant <xadimgnik@gmail.com> =
wrote:

> On 09/07/2024 11:48, Owen Smith wrote:
> > WHQL requires NDIS minor versions to match the OS under test.
> > For Server 2022, this requires NDIS version 6.85 and Server 2025 requir=
es
> > NDIS version 6.89.
> > In order to build with EWDK 22000, the reported version is echoed from
> the
> > call to NdisGetVersion() without requiring updated headers.
> >
> > Note: NDIS 6.89 does add support for UDP Receive Segment Coalescing
> Offload
> > (URO), but XenNet does not support this new NDIS feature.
> >
> > Signed-off-by: Owen Smith <owen.smith@cloud.com>
> > ---
> >   src/xennet/miniport.c | 8 ++++----
> >   1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/xennet/miniport.c b/src/xennet/miniport.c
> > index 5dc9858..10717fa 100644
> > --- a/src/xennet/miniport.c
> > +++ b/src/xennet/miniport.c
> > @@ -348,16 +348,16 @@ MiniportRegister(
> >           MiniportDriverCharacteristics.Header.Size =3D
> NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3;
> >           MiniportDriverCharacteristics.Header.Revision =3D
> NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3;
> >
> > -        MiniportDriverCharacteristics.MajorNdisVersion =3D
> NDIS_MINIPORT_MAJOR_VERSION; // 6
> > -        MiniportDriverCharacteristics.MinorNdisVersion =3D
> NDIS_MINIPORT_MINOR_VERSION; // 85
> > +        MiniportDriverCharacteristics.MajorNdisVersion =3D 6;
> > +        MiniportDriverCharacteristics.MinorNdisVersion =3D
> (UCHAR)(NdisGetVersion() & 0x00FF);
>
> NdisGetVersion() should also return the 6 as well. I don't think we
> should be hardcoding the major and dynamically determining the minor...
> either both hardcoded, or neither.
>
> >       } else
> >   #endif
> >       if (NdisGetVersion() >=3D NDIS_RUNTIME_VERSION_660) {
> >           MiniportDriverCharacteristics.MajorNdisVersion =3D 6;
> >           MiniportDriverCharacteristics.MinorNdisVersion =3D 60;
> >       } else {
> > -        MiniportDriverCharacteristics.MajorNdisVersion =3D
> NDIS_MINIPORT_MINIMUM_MAJOR_VERSION; // 6
> > -        MiniportDriverCharacteristics.MinorNdisVersion =3D
> NDIS_MINIPORT_MINIMUM_MINOR_VERSION; // 30
> > +        MiniportDriverCharacteristics.MajorNdisVersion =3D 6;
> > +        MiniportDriverCharacteristics.MinorNdisVersion =3D 30;
> >       }
> >
> >       MiniportDriverCharacteristics.MajorDriverVersion =3D MAJOR_VERSIO=
N;
>
>
>

--000000000000ab09fa061e77d3fc
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e">Makes sense, I will update to pull Major and Minor from NdisGetVersion()=
</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_=
attr">On Wed, Jul 24, 2024 at 9:06=E2=80=AFAM Paul Durrant &lt;<a href=3D"m=
ailto:xadimgnik@gmail.com">xadimgnik@gmail.com</a>&gt; wrote:<br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left=
:1px solid rgb(204,204,204);padding-left:1ex">On 09/07/2024 11:48, Owen Smi=
th wrote:<br>
&gt; WHQL requires NDIS minor versions to match the OS under test.<br>
&gt; For Server 2022, this requires NDIS version 6.85 and Server 2025 requi=
res<br>
&gt; NDIS version 6.89.<br>
&gt; In order to build with EWDK 22000, the reported version is echoed from=
 the<br>
&gt; call to NdisGetVersion() without requiring updated headers.<br>
&gt; <br>
&gt; Note: NDIS 6.89 does add support for UDP Receive Segment Coalescing Of=
fload<br>
&gt; (URO), but XenNet does not support this new NDIS feature.<br>
&gt; <br>
&gt; Signed-off-by: Owen Smith &lt;<a href=3D"mailto:owen.smith@cloud.com" =
target=3D"_blank">owen.smith@cloud.com</a>&gt;<br>
&gt; ---<br>
&gt;=C2=A0 =C2=A0src/xennet/miniport.c | 8 ++++----<br>
&gt;=C2=A0 =C2=A01 file changed, 4 insertions(+), 4 deletions(-)<br>
&gt; <br>
&gt; diff --git a/src/xennet/miniport.c b/src/xennet/miniport.c<br>
&gt; index 5dc9858..10717fa 100644<br>
&gt; --- a/src/xennet/miniport.c<br>
&gt; +++ b/src/xennet/miniport.c<br>
&gt; @@ -348,16 +348,16 @@ MiniportRegister(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0MiniportDriverCharacteristics.=
Header.Size =3D NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0MiniportDriverCharacteristics.=
Header.Revision =3D NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 MiniportDriverCharacteristics.MajorNdisVe=
rsion =3D NDIS_MINIPORT_MAJOR_VERSION; // 6<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 MiniportDriverCharacteristics.MinorNdisVe=
rsion =3D NDIS_MINIPORT_MINOR_VERSION; // 85<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 MiniportDriverCharacteristics.MajorNdisVe=
rsion =3D 6;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 MiniportDriverCharacteristics.MinorNdisVe=
rsion =3D (UCHAR)(NdisGetVersion() &amp; 0x00FF);<br>
<br>
NdisGetVersion() should also return the 6 as well. I don&#39;t think we <br=
>
should be hardcoding the major and dynamically determining the minor... <br=
>
either both hardcoded, or neither.<br>
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0} else<br>
&gt;=C2=A0 =C2=A0#endif<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (NdisGetVersion() &gt;=3D NDIS_RUNTIME_VE=
RSION_660) {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0MiniportDriverCharacteristics.=
MajorNdisVersion =3D 6;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0MiniportDriverCharacteristics.=
MinorNdisVersion =3D 60;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0} else {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 MiniportDriverCharacteristics.MajorNdisVe=
rsion =3D NDIS_MINIPORT_MINIMUM_MAJOR_VERSION; // 6<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 MiniportDriverCharacteristics.MinorNdisVe=
rsion =3D NDIS_MINIPORT_MINIMUM_MINOR_VERSION; // 30<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 MiniportDriverCharacteristics.MajorNdisVe=
rsion =3D 6;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 MiniportDriverCharacteristics.MinorNdisVe=
rsion =3D 30;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0MiniportDriverCharacteristics.MajorDriverVer=
sion =3D MAJOR_VERSION;<br>
<br>
<br>
</blockquote></div>

--000000000000ab09fa061e77d3fc--


From win-pv-devel-bounces@lists.xenproject.org Tue Jul 30 14:35:02 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 30 Jul 2024 14:35:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.767875.1178582 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sYnwM-0006sr-NL; Tue, 30 Jul 2024 14:35:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 767875.1178582; Tue, 30 Jul 2024 14:35:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sYnwM-0006sk-Jy; Tue, 30 Jul 2024 14:35:02 +0000
Received: by outflank-mailman (input) for mailman id 767875;
 Tue, 30 Jul 2024 14:35:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=PK9p=O6=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1sYnwL-0006se-3y
 for win-pv-devel@lists.xenproject.org; Tue, 30 Jul 2024 14:35:01 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e53307a2-4e80-11ef-bc01-fd08da9f4363;
 Tue, 30 Jul 2024 16:34:58 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-52fc14d6689so4807227e87.1
 for <win-pv-devel@lists.xenproject.org>; Tue, 30 Jul 2024 07:34:58 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e53307a2-4e80-11ef-bc01-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722350097; x=1722954897; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=EmhYuQVX+OfeHwIAluG3GIVpo0nB9vWTA3C3dEu//QI=;
        b=rnZR7fTx3PdwJDNx+E2xUlIMTmOcFuJvhEecNmO5c/4rx899nnEBSC6leV9h5T+kkk
         WwzR5NgPS9n1adR5Sxvas0S7p6MUni7V/9C8ksiseVe9KJgARGAca7/Gu6Hw2pqcnK5l
         eQOSxcrAbyN+s+e0tT/kf8dUerMX64f3tbmSI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722350097; x=1722954897;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=EmhYuQVX+OfeHwIAluG3GIVpo0nB9vWTA3C3dEu//QI=;
        b=fy1MP05u393I863cSrCYum+bQSQnw4BbvaB2QcRSCBIH6LTAmjsWSX/vm29sHTx+fr
         McLZMxqenLF0JsY27kHXCX1TpCjcvdDm+WJb1qdM9smURy04vvRbGDYH2BnybS49yt9b
         EBPxZ7CBeSAW0/T9GP4RgQJ3JRkSLUEhqjDa8O2ScCGQ0xRXnrpvT3ydLaGyE4DUenyo
         +5xpNmxgapLjuI27D88A1OZtK2Mu0Zm4/cUpxwRMoUxg5gQm8z6bGayYECePzNVwGKQk
         k4E61vG+CfyQyxIaT673XMaRbNFhie8P/1epJ35YaBO2m0ZMHJJ2psJWCIDrb8ZjFEn7
         w24Q==
X-Gm-Message-State: AOJu0YwS4IB2QiJqbk6CO9BhcBCWNpoAfrMZEJm1IHfTfIsN+e1VxziV
	2wmBh0b5ANbAUNt4mBETam2BDP0xIT44nabjUKKROKDd/OdsfrMZrWQWai4NKFpyPiMVlouxz2p
	qQRnFbTO12ZRyM/icWGVwFy5dbwHlSDQDolT3Dl2FQL9MBes=
X-Google-Smtp-Source: AGHT+IFblqYaw1emN9W7TS8f/0Ij+bZ7yctJGB+pG5cJ0p1fXNFwPkFNBvFYYDC/xELcrPmWKZ1Xag1uX49PxmXC0z4=
X-Received: by 2002:a05:6512:3299:b0:52c:d6a1:5734 with SMTP id
 2adb3069b0e04-5309b270817mr7348457e87.14.1722350097071; Tue, 30 Jul 2024
 07:34:57 -0700 (PDT)
MIME-Version: 1.0
References: <20240709104500.1392-1-owen.smith@cloud.com> <20240709104500.1392-2-owen.smith@cloud.com>
 <c838bfdc-4abe-4f95-b114-0e6dfcb95a79@xen.org> <CAC_UY8-Nv65O_PdfL3THcZUJnmy1pNzG7mGZjcvwVjrS-Eccmw@mail.gmail.com>
In-Reply-To: <CAC_UY8-Nv65O_PdfL3THcZUJnmy1pNzG7mGZjcvwVjrS-Eccmw@mail.gmail.com>
From: Owen Smith <owen.smith@citrix.com>
Date: Tue, 30 Jul 2024 15:34:46 +0100
Message-ID: <CAC_UY8_z4C9rRD0gAByJvMz7zm+vhszKyYnft7qP2jparV_k9Q@mail.gmail.com>
Subject: Re: [XENVIF PATCH 2/3] Fix Registry Isolation issues with Server 2025
To: paul@xen.org
Cc: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000b7156d061e77e164"

--000000000000b7156d061e77e164
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I will update to attempt to copy settings, but make the settings copy code
and friendly name setting code non-fatal if any registry operation fails,
as when IoOpenDriverRegistryKey is used, it seems the Settings key can only
be opened read only, and any access to the tcpip, tcpip6 and netbt is not
allowed (due to absolute paths).

On Tue, Jul 30, 2024 at 9:02=E2=80=AFAM Owen Smith <owen.smith@citrix.com> =
wrote:

> Since Driver Verifier's registry isolation detects opening absolute paths
> to registry keys as a violation (and bugchecks), it's not possible to cop=
y
> settings from emulated to PV.
>
> On Wed, Jul 24, 2024 at 9:13=E2=80=AFAM Paul Durrant <xadimgnik@gmail.com=
> wrote:
>
>> On 09/07/2024 11:44, Owen Smith wrote:
>> > Use MmGetSystemRoutineAddress to dynamically get
>> IoOpenDriverRegistryKey,
>> > which is not present on Server 2016.
>> > Where possible, use IoOpenDriverRegistryKey to avoid opening absolute
>> registry
>> > paths, which is a driver verifier violation on Server 2025 WHQL testin=
g.
>> >
>> > This does remove PdoSetFriendlyName and SettingsSave/SettingsRestore
>> > - PdoSetFriendlyName gets an absolute path to the parent of a key
>> opened by an
>> >    allowed API
>> > - SettingsSave/SettingsRestore directly manipulate several absolute
>> paths, but
>> >    due to the recent DeviceID changes, the settings copy code should
>> not be
>> >    neccessary, as the network connection will not be re-created on
>> driver update.
>> >
>>
>> What abou when moving from an emulated device to the PV device? That's
>> why all the settings copy nastiness was originally implemented... it
>> wasn't about PV driver update.
>>
>> > Signed-off-by: Owen Smith <owen.smith@cloud.com>
>> > ---
>> >   src/xenvif/driver.c          | 113 +-----
>> >   src/xenvif/driver.h          |  10 -
>> >   src/xenvif/pdo.c             | 151 +-------
>> >   src/xenvif/registry.c        |  72 +++-
>> >   src/xenvif/registry.h        |   9 +-
>> >   src/xenvif/settings.c        | 694 ---------------------------------=
--
>> >   src/xenvif/settings.h        |  54 ---
>> >   vs2019/xenvif/xenvif.vcxproj |   1 -
>> >   vs2022/xenvif/xenvif.vcxproj |   1 -
>> >   9 files changed, 87 insertions(+), 1018 deletions(-)
>> >   delete mode 100644 src/xenvif/settings.c
>> >   delete mode 100644 src/xenvif/settings.h
>> >
>> > diff --git a/src/xenvif/driver.c b/src/xenvif/driver.c
>> > index 3345607..2ac793d 100644
>> > --- a/src/xenvif/driver.c
>> > +++ b/src/xenvif/driver.c
>> > @@ -120,54 +120,6 @@ DriverGetParametersKey(
>> >       return __DriverGetParametersKey();
>> >   }
>> >
>> > -static FORCEINLINE VOID
>> > -__DriverSetAddressesKey(
>> > -    IN  HANDLE  Key
>> > -    )
>> > -{
>> > -    Driver.AddressesKey =3D Key;
>> > -}
>> > -
>> > -static FORCEINLINE HANDLE
>> > -__DriverGetAddressesKey(
>> > -    VOID
>> > -    )
>> > -{
>> > -    return Driver.AddressesKey;
>> > -}
>> > -
>> > -HANDLE
>> > -DriverGetAddressesKey(
>> > -    VOID
>> > -    )
>> > -{
>> > -    return __DriverGetAddressesKey();
>> > -}
>> > -
>> > -static FORCEINLINE VOID
>> > -__DriverSetSettingsKey(
>> > -    IN  HANDLE  Key
>> > -    )
>> > -{
>> > -    Driver.SettingsKey =3D Key;
>> > -}
>> > -
>> > -static FORCEINLINE HANDLE
>> > -__DriverGetSettingsKey(
>> > -    VOID
>> > -    )
>> > -{
>> > -    return Driver.SettingsKey;
>> > -}
>> > -
>> > -HANDLE
>> > -DriverGetSettingsKey(
>> > -    VOID
>> > -    )
>> > -{
>> > -    return __DriverGetSettingsKey();
>> > -}
>> > -
>> >   #define MAXNAMELEN  256
>> >
>> >   static FORCEINLINE VOID
>> > @@ -265,8 +217,6 @@ DriverUnload(
>> >       IN  PDRIVER_OBJECT  DriverObject
>> >       )
>> >   {
>> > -    HANDLE              SettingsKey;
>> > -    HANDLE              AddressesKey;
>> >       HANDLE              ParametersKey;
>> >
>> >       ASSERT3P(DriverObject, =3D=3D, __DriverGetDriverObject());
>> > @@ -275,16 +225,6 @@ DriverUnload(
>> >
>> >       Driver.NeedReboot =3D FALSE;
>> >
>> > -    SettingsKey =3D __DriverGetSettingsKey();
>> > -    __DriverSetSettingsKey(NULL);
>> > -
>> > -    RegistryCloseKey(SettingsKey);
>> > -
>> > -    AddressesKey =3D __DriverGetAddressesKey();
>> > -    __DriverSetAddressesKey(NULL);
>> > -
>> > -    RegistryCloseKey(AddressesKey);
>> > -
>> >       ParametersKey =3D __DriverGetParametersKey();
>> >       __DriverSetParametersKey(NULL);
>> >
>> > @@ -401,10 +341,7 @@ DriverEntry(
>> >       IN  PUNICODE_STRING RegistryPath
>> >       )
>> >   {
>> > -    HANDLE              ServiceKey;
>> >       HANDLE              ParametersKey;
>> > -    HANDLE              AddressesKey;
>> > -    HANDLE              SettingsKey;
>> >       ULONG               Index;
>> >       NTSTATUS            status;
>> >
>> > @@ -428,43 +365,16 @@ DriverEntry(
>> >            MONTH,
>> >            YEAR);
>> >
>> > -    status =3D RegistryInitialize(RegistryPath);
>> > +    status =3D RegistryInitialize(DriverObject, RegistryPath);
>> >       if (!NT_SUCCESS(status))
>> >           goto fail1;
>> >
>> > -    status =3D RegistryOpenServiceKey(KEY_ALL_ACCESS, &ServiceKey);
>> > +    status =3D RegistryOpenParametersKey(KEY_READ, &ParametersKey);
>> >       if (!NT_SUCCESS(status))
>> >           goto fail2;
>> >
>> > -    status =3D RegistryOpenSubKey(ServiceKey,
>> > -                                "Parameters",
>> > -                                KEY_READ,
>> > -                                &ParametersKey);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail3;
>> > -
>> >       __DriverSetParametersKey(ParametersKey);
>> >
>> > -    status =3D RegistryCreateSubKey(ServiceKey,
>> > -                                  "Addresses",
>> > -                                  REG_OPTION_VOLATILE,
>> > -                                  &AddressesKey);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail4;
>> > -
>> > -    __DriverSetAddressesKey(AddressesKey);
>> > -
>> > -    status =3D RegistryCreateSubKey(ServiceKey,
>> > -                                  "Settings",
>> > -                                  REG_OPTION_NON_VOLATILE,
>> > -                                  &SettingsKey);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail5;
>> > -
>> > -    __DriverSetSettingsKey(SettingsKey);
>> > -
>> > -    RegistryCloseKey(ServiceKey);
>> > -
>> >       DriverObject->DriverExtension->AddDevice =3D AddDevice;
>> >
>> >       for (Index =3D 0; Index <=3D IRP_MJ_MAXIMUM_FUNCTION; Index++) {
>> > @@ -477,25 +387,6 @@ DriverEntry(
>> >
>> >       return STATUS_SUCCESS;
>> >
>> > -fail5:
>> > -    Error("fail5\n");
>> > -
>> > -    __DriverSetAddressesKey(NULL);
>> > -
>> > -    RegistryCloseKey(AddressesKey);
>> > -
>> > -fail4:
>> > -    Error("fail4\n");
>> > -
>> > -    __DriverSetParametersKey(NULL);
>> > -
>> > -    RegistryCloseKey(ParametersKey);
>> > -
>> > -fail3:
>> > -    Error("fail3\n");
>> > -
>> > -    RegistryCloseKey(ServiceKey);
>> > -
>> >   fail2:
>> >       Error("fail2\n");
>> >
>> > diff --git a/src/xenvif/driver.h b/src/xenvif/driver.h
>> > index b5b9a3d..a9b47d4 100644
>> > --- a/src/xenvif/driver.h
>> > +++ b/src/xenvif/driver.h
>> > @@ -48,16 +48,6 @@ DriverGetParametersKey(
>> >       VOID
>> >       );
>> >
>> > -extern HANDLE
>> > -DriverGetAddressesKey(
>> > -    VOID
>> > -    );
>> > -
>> > -extern HANDLE
>> > -DriverGetSettingsKey(
>> > -    VOID
>> > -    );
>> > -
>> >   extern VOID
>> >   DriverRequestReboot(
>> >       VOID
>> > diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
>> > index 8ec9814..51cbd97 100644
>> > --- a/src/xenvif/pdo.c
>> > +++ b/src/xenvif/pdo.c
>> > @@ -54,7 +54,6 @@
>> >   #include "registry.h"
>> >   #include "thread.h"
>> >   #include "link.h"
>> > -#include "settings.h"
>> >   #include "dbg_print.h"
>> >   #include "assert.h"
>> >   #include "util.h"
>> > @@ -727,30 +726,16 @@ __PdoSetPermanentAddress(
>> >       IN  PCHAR       Buffer
>> >       )
>> >   {
>> > -    ANSI_STRING     Ansi[2];
>> >       NTSTATUS        status;
>> >
>> >       status =3D __PdoParseAddress(Buffer, &Pdo->PermanentAddress);
>> >       if (!NT_SUCCESS(status))
>> >           goto fail1;
>> >
>> > -    RtlZeroMemory(Ansi, sizeof (ANSI_STRING) * 2);
>> > -    RtlInitAnsiString(&Ansi[0], Buffer);
>> > -
>> > -    status =3D RegistryUpdateSzValue(DriverGetAddressesKey(),
>> > -                                   __PdoGetName(Pdo),
>> > -                                   REG_SZ,
>> > -                                   Ansi);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail2;
>> > -
>> > -    Info("%s: %Z\n", __PdoGetName(Pdo), &Ansi[0]);
>> > +    Info("%s: %s\n", __PdoGetName(Pdo), Buffer);
>> >
>> >       return STATUS_SUCCESS;
>> >
>> > -fail2:
>> > -    Error("fail2\n");
>> > -
>> >   fail1:
>> >       Error("fail1 (%08x)\n", status);
>> >
>> > @@ -778,68 +763,9 @@ __PdoClearPermanentAddress(
>> >       IN  PXENVIF_PDO Pdo
>> >       )
>> >   {
>> > -    (VOID) RegistryDeleteValue(DriverGetAddressesKey(),
>> > -                               __PdoGetName(Pdo));
>> > -
>> >       RtlZeroMemory(&Pdo->PermanentAddress, sizeof (ETHERNET_ADDRESS))=
;
>> >   }
>> >
>> > -static NTSTATUS
>> > -PdoSetFriendlyName(
>> > -    IN  PXENVIF_PDO Pdo,
>> > -    IN  HANDLE      SoftwareKey,
>> > -    IN  HANDLE      HardwareKey
>> > -    )
>> > -{
>> > -    PANSI_STRING    DriverDesc;
>> > -    CHAR            Buffer[MAXNAMELEN];
>> > -    ANSI_STRING     Ansi[2];
>> > -    NTSTATUS        status;
>> > -
>> > -    status =3D RegistryQuerySzValue(SoftwareKey,
>> > -                                  "DriverDesc",
>> > -                                  NULL,
>> > -                                  &DriverDesc);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail1;
>> > -
>> > -    status =3D RtlStringCbPrintfA(Buffer,
>> > -                                MAXNAMELEN,
>> > -                                "%Z #%s",
>> > -                                &DriverDesc[0],
>> > -                                __PdoGetName(Pdo)
>> > -                                );
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail2;
>> > -
>> > -    RtlZeroMemory(Ansi, sizeof (ANSI_STRING) * 2);
>> > -    RtlInitAnsiString(&Ansi[0], Buffer);
>> > -
>> > -    status =3D RegistryUpdateSzValue(HardwareKey,
>> > -                                   "FriendlyName",
>> > -                                   REG_SZ,
>> > -                                   Ansi);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail3;
>> > -
>> > -    Info("%s: %Z\n", __PdoGetName(Pdo), &Ansi[0]);
>> > -
>> > -    RegistryFreeSzValue(DriverDesc);
>> > -
>> > -    return STATUS_SUCCESS;
>> > -
>> > -fail3:
>> > -    Error("fail3\n");
>> > -
>> > -fail2:
>> > -    Error("fail2\n");
>> > -
>> > -fail1:
>> > -    Error("fail1 (%08x)\n", status);
>> > -
>> > -    return status;
>> > -}
>> > -
>> >   static FORCEINLINE NTSTATUS
>> >   __PdoSetCurrentAddress(
>> >       IN  PXENVIF_PDO Pdo,
>> > @@ -1276,15 +1202,13 @@ PdoUnplugRequested(
>> >
>> >   static FORCEINLINE NTSTATUS
>> >   PdoParseMibTable(
>> > -    IN  PXENVIF_PDO     Pdo,
>> > -    IN  HANDLE          SoftwareKey
>> > +    IN  PXENVIF_PDO     Pdo
>> >       )
>> >   {
>> >       NTSTATUS            (*__GetIfTable2)(PMIB_IF_TABLE2 *);
>> >       VOID                (*__FreeMibTable)(PVOID);
>> >       PMIB_IF_TABLE2      Table;
>> >       ULONG               Index;
>> > -    GUID                Guid;
>> >       NTSTATUS            status;
>> >
>> >       status =3D LinkGetRoutineAddress("netio.sys",
>> > @@ -1330,56 +1254,10 @@ PdoParseMibTable(
>> >           if (Row->OperStatus !=3D IfOperStatusUp)
>> >               continue;
>> >
>> > -        (VOID) SettingsSave(__PdoGetName(Pdo),
>> > -                            Row->Alias,
>> > -                            Row->Description,
>> > -                            &Row->InterfaceGuid,
>> > -                            &Row->InterfaceLuid);
>> > -
>> >           status =3D STATUS_PNP_REBOOT_REQUIRED;
>> >           goto fail4;
>> >       }
>> >
>> > -    //
>> > -    // If there is a stack bound then restore any settings that
>> > -    // may have been saved from an aliasing device.
>> > -    //
>> > -    status =3D PdoGetInterfaceGuid(Pdo, SoftwareKey, &Guid);
>> > -    if (NT_SUCCESS(status)) {
>> > -        NET_LUID        Luid;
>> > -        PWCHAR          Alias;
>> > -        PWCHAR          Description;
>> > -
>> > -        RtlZeroMemory(&Luid, sizeof(NET_LUID));
>> > -        Alias =3D NULL;
>> > -        Description =3D NULL;
>> > -
>> > -        status =3D PdoGetInterfaceLuid(Pdo, SoftwareKey, &Luid);
>> > -        if (NT_SUCCESS(status)) {
>> > -            for (Index =3D 0; Index < Table->NumEntries; Index++) {
>> > -                PMIB_IF_ROW2    Row =3D &Table->Table[Index];
>> > -
>> > -                Trace("%s: CHECKING %ws (%ws)\n",
>> > -                    __PdoGetName(Pdo),
>> > -                    Row->Alias,
>> > -                    Row->Description);
>> > -
>> > -                if (Row->InterfaceLuid.Value !=3D Luid.Value)
>> > -                    continue;
>> > -
>> > -                Alias =3D Row->Alias;
>> > -                Description =3D Row->Description;
>> > -                break;
>> > -            }
>> > -        }
>> > -
>> > -        (VOID) SettingsRestore(__PdoGetName(Pdo),
>> > -                               Alias,
>> > -                               Description,
>> > -                               &Guid,
>> > -                               &Luid);
>> > -    }
>> > -
>> >       __FreeMibTable(Table);
>> >
>> >       return STATUS_SUCCESS;
>> > @@ -1408,7 +1286,6 @@ PdoStartDevice(
>> >       )
>> >   {
>> >       HANDLE              SoftwareKey;
>> > -    HANDLE              HardwareKey;
>> >       NTSTATUS            status;
>> >
>> >       status =3D STATUS_UNSUCCESSFUL;
>> > @@ -1421,21 +1298,11 @@ PdoStartDevice(
>> >       if (!NT_SUCCESS(status))
>> >           goto fail2;
>> >
>> > -    status =3D RegistryOpenHardwareKey(__PdoGetDeviceObject(Pdo),
>> > -                                     KEY_ALL_ACCESS,
>> > -                                     &HardwareKey);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail3;
>> > -
>> > -    (VOID) PdoSetFriendlyName(Pdo,
>> > -                              SoftwareKey,
>> > -                              HardwareKey);
>> > -
>> >       status =3D __PdoSetCurrentAddress(Pdo, SoftwareKey);
>> >       if (!NT_SUCCESS(status))
>> > -        goto fail4;
>> > +        goto fail3;
>> >
>> > -    status =3D PdoParseMibTable(Pdo, SoftwareKey);
>> > +    status =3D PdoParseMibTable(Pdo);
>> >       if (status =3D=3D STATUS_PNP_REBOOT_REQUIRED ||
>> !PdoUnplugRequested(Pdo)) {
>> >           PdoUnplugRequest(Pdo, TRUE); // fix unplug reference count
>> >           DriverRequestReboot();
>> > @@ -1445,7 +1312,7 @@ PdoStartDevice(
>> >
>> >       status =3D PdoD3ToD0(Pdo);
>> >       if (!NT_SUCCESS(status))
>> > -        goto fail5;
>> > +        goto fail4;
>> >
>> >       PdoUnplugRequest(Pdo, TRUE);
>> >
>> > @@ -1454,20 +1321,14 @@ PdoStartDevice(
>> >       Irp->IoStatus.Status =3D STATUS_SUCCESS;
>> >       IoCompleteRequest(Irp, IO_NO_INCREMENT);
>> >
>> > -    RegistryCloseKey(HardwareKey);
>> >       RegistryCloseKey(SoftwareKey);
>> >
>> >       return STATUS_SUCCESS;
>> >
>> > -fail5:
>> > -    Error("fail5\n");
>> > -
>> > -    RtlZeroMemory(&Pdo->CurrentAddress, sizeof (ETHERNET_ADDRESS));
>> > -
>> >   fail4:
>> >       Error("fail4\n");
>> >
>> > -    RegistryCloseKey(HardwareKey);
>> > +    RtlZeroMemory(&Pdo->CurrentAddress, sizeof (ETHERNET_ADDRESS));
>> >
>> >   fail3:
>> >       Error("fail3\n");
>> > diff --git a/src/xenvif/registry.c b/src/xenvif/registry.c
>> > index 8f84818..792ce03 100644
>> > --- a/src/xenvif/registry.c
>> > +++ b/src/xenvif/registry.c
>> > @@ -38,8 +38,13 @@
>> >
>> >   #define REGISTRY_TAG 'GERX'
>> >
>> > +static PDRIVER_OBJECT   RegistryDriverObject;
>> >   static UNICODE_STRING   RegistryPath;
>> >
>> > +typedef NTSTATUS(*IOOPENDRIVERREGISTRYKEY)(PDRIVER_OBJECT,
>> DRIVER_REGKEY_TYPE, ACCESS_MASK, ULONG, PHANDLE);
>> > +
>> > +static IOOPENDRIVERREGISTRYKEY __IoOpenDriverRegistryKey;
>> > +
>> >   static FORCEINLINE PVOID
>> >   __RegistryAllocate(
>> >       IN  ULONG   Length
>> > @@ -58,9 +63,12 @@ __RegistryFree(
>> >
>> >   NTSTATUS
>> >   RegistryInitialize(
>> > -    IN PUNICODE_STRING  Path
>> > +    IN  PDRIVER_OBJECT  DriverObject,
>> > +    IN  PUNICODE_STRING Path
>> >       )
>> >   {
>> > +    UNICODE_STRING      Unicode;
>> > +    PVOID               Func;
>> >       NTSTATUS            status;
>> >
>> >       ASSERT3P(RegistryPath.Buffer, =3D=3D, NULL);
>> > @@ -69,6 +77,16 @@ RegistryInitialize(
>> >       if (!NT_SUCCESS(status))
>> >           goto fail1;
>> >
>> > +    ASSERT3P(RegistryDriverObject, =3D=3D, NULL);
>> > +    RegistryDriverObject =3D DriverObject;
>> > +
>> > +    ASSERT3P(__IoOpenDriverRegistryKey, =3D=3D, NULL);
>> > +    RtlInitUnicodeString(&Unicode, L"IoOpenDriverRegistryKey");
>> > +
>> > +    Func =3D MmGetSystemRoutineAddress(&Unicode);
>> > +    if (Func !=3D NULL)
>> > +        __IoOpenDriverRegistryKey =3D (IOOPENDRIVERREGISTRYKEY)Func;
>> > +
>> >       return STATUS_SUCCESS;
>> >
>> >   fail1:
>> > @@ -82,6 +100,10 @@ RegistryTeardown(
>> >       VOID
>> >       )
>> >   {
>> > +    __IoOpenDriverRegistryKey =3D NULL;
>> > +
>> > +    RegistryDriverObject =3D NULL;
>> > +
>> >       RtlFreeUnicodeString(&RegistryPath);
>> >       RegistryPath.Buffer =3D NULL;
>> >       RegistryPath.MaximumLength =3D RegistryPath.Length =3D 0;
>> > @@ -266,6 +288,54 @@ RegistryCreateServiceKey(
>> >       return RegistryCreateKey(NULL, &RegistryPath,
>> REG_OPTION_NON_VOLATILE, Key);
>> >   }
>> >
>> > +NTSTATUS
>> > +RegistryOpenParametersKey(
>> > +    IN  ACCESS_MASK     DesiredAccess,
>> > +    OUT PHANDLE         Key
>> > +    )
>> > +{
>> > +    HANDLE              ServiceKey;
>> > +    NTSTATUS            status;
>> > +
>> > +    if (__IoOpenDriverRegistryKey !=3D NULL) {
>> > +        status =3D __IoOpenDriverRegistryKey(RegistryDriverObject,
>> > +                                           DriverRegKeyParameters,
>> > +                                           DesiredAccess,
>> > +                                           0,
>> > +                                           Key);
>> > +        if (!NT_SUCCESS(status))
>> > +            goto fail1;
>> > +
>> > +        goto done;
>> > +    }
>> > +
>> > +    status =3D RegistryOpenKey(NULL, &RegistryPath, DesiredAccess,
>> &ServiceKey);
>> > +    if (!NT_SUCCESS(status))
>> > +        goto fail2;
>> > +
>> > +    status =3D RegistryOpenSubKey(ServiceKey, "Parameters",
>> DesiredAccess, Key);
>> > +    if (!NT_SUCCESS(status))
>> > +        goto fail3;
>> > +
>> > +    RegistryCloseKey(ServiceKey);
>> > +
>> > +done:
>> > +    return STATUS_SUCCESS;
>> > +
>> > +fail3:
>> > +    Error("fail3\n");
>> > +
>> > +    RegistryCloseKey(ServiceKey);
>> > +
>> > +fail2:
>> > +    Error("fail2\n");
>> > +
>> > +fail1:
>> > +    Error("fail1 %08x\n", status);
>> > +
>> > +    return status;
>> > +}
>> > +
>> >   NTSTATUS
>> >   RegistryOpenSoftwareKey(
>> >       IN  PDEVICE_OBJECT  DeviceObject,
>> > diff --git a/src/xenvif/registry.h b/src/xenvif/registry.h
>> > index c656806..60c50e8 100644
>> > --- a/src/xenvif/registry.h
>> > +++ b/src/xenvif/registry.h
>> > @@ -37,7 +37,8 @@
>> >
>> >   extern NTSTATUS
>> >   RegistryInitialize(
>> > -    IN PUNICODE_STRING  Path
>> > +    IN  PDRIVER_OBJECT  DriverObject,
>> > +    IN  PUNICODE_STRING Path
>> >       );
>> >
>> >   extern VOID
>> > @@ -72,6 +73,12 @@ RegistryCreateServiceKey(
>> >       OUT PHANDLE     Key
>> >       );
>> >
>> > +extern NTSTATUS
>> > +RegistryOpenParametersKey(
>> > +    IN  ACCESS_MASK     DesiredAccess,
>> > +    OUT PHANDLE         Key
>> > +    );
>> > +
>> >   extern NTSTATUS
>> >   RegistryOpenSoftwareKey(
>> >       IN  PDEVICE_OBJECT  DeviceObject,
>> > diff --git a/src/xenvif/settings.c b/src/xenvif/settings.c
>> > deleted file mode 100644
>> > index 4dd4ec4..0000000
>> > --- a/src/xenvif/settings.c
>> > +++ /dev/null
>> > @@ -1,694 +0,0 @@
>> > -/* Copyright (c) Xen Project.
>> > - * Copyright (c) Cloud Software Group, Inc.
>> > - * All rights reserved.
>> > - *
>> > - * Redistribution and use in source and binary forms,
>> > - * with or without modification, are permitted provided
>> > - * that the following conditions are met:
>> > - *
>> > - * *   Redistributions of source code must retain the above
>> > - *     copyright notice, this list of conditions and the
>> > - *     following disclaimer.
>> > - * *   Redistributions in binary form must reproduce the above
>> > - *     copyright notice, this list of conditions and the
>> > - *     following disclaimer in the documentation and/or other
>> > - *     materials provided with the distribution.
>> > - *
>> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
>> > - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
>> > - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
>> > - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
>> > - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
>> > - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>> > - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
>> > - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
>> > - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
>> > - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
>> > - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
>> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
>> > - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>> > - * SUCH DAMAGE.
>> > - */
>> > -
>> > -#include <ntddk.h>
>> > -#include <ntstrsafe.h>
>> > -
>> > -#include "registry.h"
>> > -#include "driver.h"
>> > -#include "dbg_print.h"
>> > -#include "assert.h"
>> > -#include "util.h"
>> > -
>> > -#define SETTINGS_TAG 'TTES'
>> > -
>> > -#define INTERFACES_PATH(_Name)      \
>> > -    "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services\\" ##
>> #_Name ## "\\Parameters\\Interfaces\\"
>> > -
>> > -#define IPV6_PATH   \
>> > -
>> "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Nsi\\{eb004a01=
-9b1a-11d4-9123-0050047759bc}\\10"
>> > -
>> > -#define IPV4_PATH   \
>> > -
>> "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Nsi\\{eb004a00=
-9b1a-11d4-9123-0050047759bc}\\10"
>> > -
>> > -#define NETLUID_STRING_LENGTH 16
>> > -
>> > -typedef struct _SETTINGS_COPY_IP_ADDRESS_PARAMETERS {
>> > -    CHAR        SrcPrefix[NETLUID_STRING_LENGTH + 1];
>> > -    CHAR        DstPrefix[NETLUID_STRING_LENGTH + 1];
>> > -} SETTINGS_COPY_IP_ADDRESS_PARAMETERS,
>> *PSETTINGS_COPY_IP_ADDRESS_PARAMETERS;
>> > -
>> > -static FORCEINLINE PVOID
>> > -__SettingsAllocate(
>> > -    IN  ULONG   Length
>> > -    )
>> > -{
>> > -    return __AllocatePoolWithTag(NonPagedPool, Length, SETTINGS_TAG);
>> > -}
>> > -
>> > -static FORCEINLINE VOID
>> > -__SettingsFree(
>> > -    IN  PVOID   Buffer
>> > -    )
>> > -{
>> > -    __FreePoolWithTag(Buffer, SETTINGS_TAG);
>> > -}
>> > -
>> > -static FORCEINLINE NTSTATUS
>> > -__GuidToString(
>> > -    IN  LPGUID          Guid,
>> > -    OUT PANSI_STRING    Ansi
>> > -    )
>> > -{
>> > -    NTSTATUS            status;
>> > -    UNICODE_STRING      Unicode;
>> > -
>> > -    status =3D RtlStringFromGUID(Guid, &Unicode);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail1;
>> > -
>> > -    status =3D RtlUnicodeStringToAnsiString(Ansi, &Unicode, TRUE);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail2;
>> > -
>> > -    RtlFreeUnicodeString(&Unicode);
>> > -
>> > -    return STATUS_SUCCESS;
>> > -
>> > -fail2:
>> > -    Error("fail2\n");
>> > -
>> > -    RtlFreeUnicodeString(&Unicode);
>> > -
>> > -fail1:
>> > -    Error("fail1 (%08x)\n", status);
>> > -
>> > -    return status;
>> > -}
>> > -
>> > -static NTSTATUS
>> > -SettingsCopyIpAddressesValue(
>> > -    IN  PVOID                               Context,
>> > -    IN  HANDLE                              Key,
>> > -    IN  PANSI_STRING                        ValueName,
>> > -    IN  ULONG                               Type
>> > -    )
>> > -{
>> > -    PSETTINGS_COPY_IP_ADDRESS_PARAMETERS    Parameters =3D Context;
>> > -    PVOID                                   Value;
>> > -    ULONG                                   ValueLength;
>> > -    NTSTATUS                                status;
>> > -
>> > -    UNREFERENCED_PARAMETER(Type);
>> > -
>> > -    if (_strnicmp(ValueName->Buffer,
>> > -                  Parameters->SrcPrefix,
>> > -                  NETLUID_STRING_LENGTH) !=3D 0)
>> > -        goto done;
>> > -
>> > -    Trace("    -> %Z\n", ValueName);
>> > -
>> > -    status =3D RegistryQueryBinaryValue(Key,
>> > -                                      ValueName->Buffer,
>> > -                                      &Value,
>> > -                                      &ValueLength);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail1;
>> > -
>> > -    status =3D RegistryDeleteValue(Key,
>> > -                                 ValueName->Buffer);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail2;
>> > -
>> > -    ASSERT(NETLUID_STRING_LENGTH < ValueName->Length);
>> > -    memcpy(ValueName->Buffer, Parameters->DstPrefix,
>> NETLUID_STRING_LENGTH);
>> > -
>> > -    Trace("    <- %Z\n", ValueName);
>> > -
>> > -    status =3D RegistryUpdateBinaryValue(Key,
>> > -                                       ValueName->Buffer,
>> > -                                       Value,
>> > -                                       ValueLength);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail3;
>> > -
>> > -    if (ValueLength !=3D 0)
>> > -        RegistryFreeBinaryValue(Value);
>> > -
>> > -done:
>> > -    return STATUS_SUCCESS;
>> > -
>> > -fail3:
>> > -    Error("fail3\n");
>> > -
>> > -fail2:
>> > -    Error("fail2\n");
>> > -
>> > -    if (ValueLength !=3D 0)
>> > -        RegistryFreeBinaryValue(Value);
>> > -
>> > -fail1:
>> > -    Error("fail1 (%08x)\n", status);
>> > -
>> > -    return status;
>> > -}
>> > -
>> > -static NTSTATUS
>> > -SettingsCopyIpAddresses(
>> > -    IN  ULONG                           Version,
>> > -    IN  PNET_LUID                       OldLuid,
>> > -    IN  PNET_LUID                       NewLuid
>> > -    )
>> > -{
>> > -    SETTINGS_COPY_IP_ADDRESS_PARAMETERS Parameters;
>> > -    HANDLE                              Key;
>> > -    NTSTATUS                            status;
>> > -
>> > -    status =3D RtlStringCbPrintfA(Parameters.SrcPrefix,
>> > -                                sizeof(Parameters.SrcPrefix),
>> > -                                "%016llx",
>> > -                                _byteswap_uint64(OldLuid->Value));
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail1;
>> > -
>> > -    status =3D RtlStringCbPrintfA(Parameters.DstPrefix,
>> > -                                sizeof(Parameters.DstPrefix),
>> > -                                "%016llx",
>> > -                                _byteswap_uint64(NewLuid->Value));
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail2;
>> > -
>> > -    status =3D RegistryOpenSubKey(NULL,
>> > -                                (Version =3D=3D 4) ? IPV4_PATH : IPV6=
_PATH,
>> > -                                KEY_ALL_ACCESS,
>> > -                                &Key);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail3;
>> > -
>> > -    Info("IPv%u: %s -> %s\n",
>> > -         Version,
>> > -         Parameters.SrcPrefix,
>> > -         Parameters.DstPrefix);
>> > -
>> > -    status =3D RegistryEnumerateValues(Key,
>> > -                                     SettingsCopyIpAddressesValue,
>> > -                                     &Parameters);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail4;
>> > -
>> > -    RegistryCloseKey(Key);
>> > -
>> > -    return STATUS_SUCCESS;
>> > -
>> > -fail4:
>> > -    Error("fail4\n");
>> > -
>> > -    RegistryCloseKey(Key);
>> > -
>> > -fail3:
>> > -    Error("fail3\n");
>> > -
>> > -fail2:
>> > -    Error("fail2\n");
>> > -
>> > -fail1:
>> > -    Error("fail1 (%08x)\n", status);
>> > -
>> > -    return status;
>> > -}
>> > -
>> > -static NTSTATUS
>> > -SettingsCopyInterfaceValue(
>> > -    IN  PVOID            Context,
>> > -    IN  HANDLE           SourceKey,
>> > -    IN  PANSI_STRING     ValueName,
>> > -    IN  ULONG            Type
>> > -    )
>> > -{
>> > -    HANDLE               DestinationKey =3D Context;
>> > -    NTSTATUS             status;
>> > -
>> > -    Trace(" - %Z\n", ValueName);
>> > -
>> > -    switch (Type) {
>> > -    case REG_DWORD: {
>> > -        ULONG   Value;
>> > -
>> > -        status =3D RegistryQueryDwordValue(SourceKey,
>> > -                                         ValueName->Buffer,
>> > -                                         &Value);
>> > -        if (NT_SUCCESS(status))
>> > -            (VOID) RegistryUpdateDwordValue(DestinationKey,
>> > -                                            ValueName->Buffer,
>> > -                                            Value);
>> > -
>> > -        break;
>> > -    }
>> > -    case REG_SZ:
>> > -    case REG_MULTI_SZ: {
>> > -        PANSI_STRING    Value;
>> > -
>> > -        status =3D RegistryQuerySzValue(SourceKey,
>> > -                                      ValueName->Buffer,
>> > -                                      NULL,
>> > -                                      &Value);
>> > -        if (NT_SUCCESS(status)) {
>> > -            (VOID) RegistryUpdateSzValue(DestinationKey,
>> > -                                         ValueName->Buffer,
>> > -                                         Type,
>> > -                                         Value);
>> > -            RegistryFreeSzValue(Value);
>> > -        }
>> > -
>> > -        break;
>> > -    }
>> > -    case REG_BINARY: {
>> > -        PVOID   Value;
>> > -        ULONG   Length;
>> > -
>> > -        status =3D RegistryQueryBinaryValue(SourceKey,
>> > -                                          ValueName->Buffer,
>> > -                                          &Value,
>> > -                                          &Length);
>> > -        if (NT_SUCCESS(status)) {
>> > -            (VOID) RegistryUpdateBinaryValue(DestinationKey,
>> > -                                             ValueName->Buffer,
>> > -                                             Value,
>> > -                                             Length);
>> > -            if (Length !=3D 0)
>> > -                RegistryFreeBinaryValue(Value);
>> > -        }
>> > -
>> > -        break;
>> > -    }
>> > -    default:
>> > -        ASSERT(FALSE);
>> > -    }
>> > -
>> > -    return STATUS_SUCCESS;
>> > -}
>> > -
>> > -static NTSTATUS
>> > -SettingsCopyInterface(
>> > -    IN  PCHAR           InterfacePath,
>> > -    IN  PCHAR           InterfacePrefix,
>> > -    IN  PANSI_STRING    OldGuid,
>> > -    IN  PANSI_STRING    NewGuid
>> > -    )
>> > -{
>> > -    HANDLE              OldKey;
>> > -    HANDLE              NewKey;
>> > -    PCHAR               OldKeyName;
>> > -    PCHAR               NewKeyName;
>> > -    ULONG               OldKeyLength;
>> > -    ULONG               NewKeyLength;
>> > -    NTSTATUS            status;
>> > -
>> > -    OldKeyLength =3D (ULONG)(strlen(InterfacePath) +
>> > -                           strlen(InterfacePrefix) +
>> > -                           OldGuid->Length +
>> > -                           1) * sizeof(CHAR);
>> > -    NewKeyLength =3D (ULONG)(strlen(InterfacePath) +
>> > -                           strlen(InterfacePrefix) +
>> > -                           NewGuid->Length +
>> > -                           1) * sizeof(CHAR);
>> > -
>> > -    status =3D STATUS_NO_MEMORY;
>> > -    OldKeyName =3D __SettingsAllocate(OldKeyLength);
>> > -    if (OldKeyName =3D=3D NULL)
>> > -        goto fail1;
>> > -
>> > -    NewKeyName =3D __SettingsAllocate(NewKeyLength);
>> > -    if (NewKeyName =3D=3D NULL)
>> > -        goto fail2;
>> > -
>> > -    status =3D RtlStringCbPrintfA(OldKeyName,
>> > -                                OldKeyLength,
>> > -                                "%s%s%Z",
>> > -                                InterfacePath,
>> > -                                InterfacePrefix,
>> > -                                OldGuid);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail3;
>> > -
>> > -    status =3D RtlStringCbPrintfA(NewKeyName,
>> > -                                NewKeyLength,
>> > -                                "%s%s%Z",
>> > -                                InterfacePath,
>> > -                                InterfacePrefix,
>> > -                                NewGuid);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail4;
>> > -
>> > -    status =3D RegistryOpenSubKey(NULL,
>> > -                                OldKeyName,
>> > -                                KEY_READ,
>> > -                                &OldKey);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail5;
>> > -
>> > -    status =3D RegistryCreateSubKey(NULL,
>> > -                                  NewKeyName,
>> > -                                  REG_OPTION_NON_VOLATILE,
>> > -                                  &NewKey);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail6;
>> > -
>> > -    status =3D RegistryEnumerateValues(OldKey,
>> > -                                     SettingsCopyInterfaceValue,
>> > -                                     NewKey);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail7;
>> > -
>> > -    RegistryCloseKey(NewKey);
>> > -    RegistryCloseKey(OldKey);
>> > -    __SettingsFree(NewKeyName);
>> > -    __SettingsFree(OldKeyName);
>> > -
>> > -    return STATUS_SUCCESS;
>> > -
>> > -fail7:
>> > -    Error("fail7\n");
>> > -
>> > -    RegistryCloseKey(NewKey);
>> > -
>> > -fail6:
>> > -    Error("fail6\n");
>> > -
>> > -    RegistryCloseKey(OldKey);
>> > -
>> > -fail5:
>> > -    Error("fail5\n");
>> > -
>> > -fail4:
>> > -    Error("fail4\n");
>> > -
>> > -fail3:
>> > -    Error("fail3\n");
>> > -
>> > -    __SettingsFree(NewKeyName);
>> > -
>> > -fail2:
>> > -    Error("fail2\n");
>> > -
>> > -    __SettingsFree(OldKeyName);
>> > -
>> > -fail1:
>> > -    Error("fail1 (%08x)\n", status);
>> > -
>> > -    return status;
>> > -}
>> > -
>> > -static NTSTATUS
>> > -SettingsStoreCurrent(
>> > -    IN  HANDLE          SubKey,
>> > -    IN  PANSI_STRING    Guid,
>> > -    IN  PNET_LUID       Luid
>> > -    )
>> > -{
>> > -
>> > -    NTSTATUS            status;
>> > -
>> > -    status =3D RegistryUpdateSzValue(SubKey,
>> > -                                   "NetCfgInstanceId",
>> > -                                   REG_SZ,
>> > -                                   Guid);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail1;
>> > -
>> > -    status =3D RegistryUpdateBinaryValue(SubKey,
>> > -                                       "NetLuid",
>> > -                                       Luid,
>> > -                                       sizeof(NET_LUID));
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail2;
>> > -
>> > -    (VOID) RegistryDeleteValue(SubKey,
>> > -                               "HasSettings");
>> > -
>> > -    return STATUS_SUCCESS;
>> > -
>> > -fail2:
>> > -    Error("fail2\n");
>> > -
>> > -fail1:
>> > -    Error("fail1 (%08x)\n", status);
>> > -
>> > -    return status;
>> > -}
>> > -
>> > -static NTSTATUS
>> > -SettingsCopy(
>> > -    IN  PCHAR           SubKeyName,
>> > -    IN  PANSI_STRING    OldGuid,
>> > -    IN  PNET_LUID       OldLuid,
>> > -    IN  PANSI_STRING    NewGuid,
>> > -    IN  PNET_LUID       NewLuid
>> > -     )
>> > -{
>> > -    HANDLE              SettingsKey;
>> > -    HANDLE              SubKey;
>> > -    NTSTATUS            status;
>> > -
>> > -    Trace("=3D=3D=3D=3D>\n");
>> > -    Info("VIF/%s: FROM %Z\n", SubKeyName, OldGuid);
>> > -    Info("VIF/%s: TO   %Z\n", SubKeyName, NewGuid);
>> > -
>> > -    (VOID) SettingsCopyInterface(INTERFACES_PATH(NetBT),
>> > -                                 "Tcpip_",
>> > -                                 OldGuid,
>> > -                                 NewGuid);
>> > -
>> > -    (VOID) SettingsCopyInterface(INTERFACES_PATH(Tcpip),
>> > -                                 "",
>> > -                                 OldGuid,
>> > -                                 NewGuid);
>> > -
>> > -    (VOID) SettingsCopyInterface(INTERFACES_PATH(Tcpip6),
>> > -                                 "",
>> > -                                 OldGuid,
>> > -                                 NewGuid);
>> > -
>> > -    (VOID) SettingsCopyIpAddresses(4,
>> > -                                   OldLuid,
>> > -                                   NewLuid);
>> > -
>> > -    (VOID) SettingsCopyIpAddresses(6,
>> > -                                   OldLuid,
>> > -                                   NewLuid);
>> > -
>> > -    SettingsKey =3D DriverGetSettingsKey();
>> > -
>> > -    status =3D RegistryCreateSubKey(SettingsKey,
>> > -                                  SubKeyName,
>> > -                                  REG_OPTION_NON_VOLATILE,
>> > -                                  &SubKey);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail1;
>> > -
>> > -    status =3D SettingsStoreCurrent(SubKey,
>> > -                                  NewGuid,
>> > -                                  NewLuid);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail2;
>> > -
>> > -    RegistryCloseKey(SubKey);
>> > -
>> > -    Trace("<=3D=3D=3D=3D\n");
>> > -
>> > -    return STATUS_SUCCESS;
>> > -
>> > -fail2:
>> > -    Error("fail2\n");
>> > -
>> > -    RegistryCloseKey(SubKey);
>> > -
>> > -fail1:
>> > -    Error("fail1 (%08x)\n", status);
>> > -
>> > -    return status;
>> > -}
>> > -
>> > -NTSTATUS
>> > -SettingsSave(
>> > -    IN  PCHAR       SubKeyName,
>> > -    IN  PWCHAR      Alias,
>> > -    IN  PWCHAR      Description,
>> > -    IN  LPGUID      InterfaceGuid,
>> > -    IN  PNET_LUID   InterfaceLuid
>> > -    )
>> > -{
>> > -    HANDLE          SettingsKey;
>> > -    HANDLE          SubKey;
>> > -    ANSI_STRING     Ansi;
>> > -    ULONG           HasSettings;
>> > -    NTSTATUS        status;
>> > -
>> > -    Info("FROM %ws (%ws)\n", Alias, Description);
>> > -
>> > -    status =3D __GuidToString(InterfaceGuid, &Ansi);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail1;
>> > -
>> > -    SettingsKey =3D DriverGetSettingsKey();
>> > -
>> > -    status =3D RegistryCreateSubKey(SettingsKey,
>> > -                                  SubKeyName,
>> > -                                  REG_OPTION_NON_VOLATILE,
>> > -                                  &SubKey);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail2;
>> > -
>> > -    HasSettings =3D 0;
>> > -    status =3D RegistryQueryDwordValue(SubKey,
>> > -                                     "HasSettings",
>> > -                                     &HasSettings);
>> > -    if (!NT_SUCCESS(status))
>> > -        HasSettings =3D 0;
>> > -    if (HasSettings !=3D 0)
>> > -        goto done;
>> > -
>> > -    Info("FROM %Z\n", Ansi);
>> > -    Info("FROM %016llx\n", InterfaceLuid->Value);
>> > -
>> > -    status =3D SettingsStoreCurrent(SubKey,
>> > -                                  &Ansi,
>> > -                                  InterfaceLuid);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail3;
>> > -
>> > -    RtlFreeAnsiString(&Ansi);
>> > -
>> > -done:
>> > -    RegistryCloseKey(SubKey);
>> > -
>> > -    return STATUS_SUCCESS;
>> > -
>> > -fail3:
>> > -    Error("fail3\n");
>> > -
>> > -    RegistryCloseKey(SubKey);
>> > -
>> > -fail2:
>> > -    Error("fail2\n");
>> > -
>> > -    RtlFreeAnsiString(&Ansi);
>> > -
>> > -fail1:
>> > -    Error("fail1 (%08x)\n", status);
>> > -
>> > -    return status;
>> > -}
>> > -
>> > -NTSTATUS
>> > -SettingsRestore(
>> > -    IN  PCHAR       SubKeyName,
>> > -    IN  PWCHAR      Alias,
>> > -    IN  PWCHAR      Description,
>> > -    IN  LPGUID      InterfaceGuid,
>> > -    IN  PNET_LUID   InterfaceLuid
>> > -    )
>> > -{
>> > -    HANDLE          SettingsKey;
>> > -    HANDLE          SubKey;
>> > -    ANSI_STRING     Ansi;
>> > -    PANSI_STRING    NetCfgInstanceId;
>> > -    PNET_LUID       NetLuid;
>> > -    ULONG           NetLuidLength;
>> > -    NTSTATUS        status;
>> > -
>> > -    SettingsKey =3D DriverGetSettingsKey();
>> > -
>> > -    status =3D RegistryOpenSubKey(SettingsKey,
>> > -                                SubKeyName,
>> > -                                KEY_READ,
>> > -                                &SubKey);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail1;
>> > -
>> > -    status =3D RegistryQuerySzValue(SubKey,
>> > -                                  "NetCfgInstanceId",
>> > -                                  NULL,
>> > -                                  &NetCfgInstanceId);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail2;
>> > -
>> > -    NetLuidLength =3D 0;
>> > -    status =3D RegistryQueryBinaryValue(SubKey,
>> > -                                      "NetLuid",
>> > -                                      &NetLuid,
>> > -                                      &NetLuidLength);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail3;
>> > -
>> > -    status =3D __GuidToString(InterfaceGuid, &Ansi);
>> > -    if (!NT_SUCCESS(status))
>> > -        goto fail4;
>> > -
>> > -    if (RtlCompareString(NetCfgInstanceId, &Ansi, TRUE) !=3D 0) {
>> > -        Info("TO %ws (%ws)\n", Alias, Description);
>> > -        Info("TO %Z\n", Ansi);
>> > -        Info("TO %016llx\n", InterfaceLuid->Value);
>> > -
>> > -        SettingsCopy(SubKeyName,
>> > -                     NetCfgInstanceId,
>> > -                     NetLuid,
>> > -                     &Ansi,
>> > -                     InterfaceLuid);
>> > -    } else {
>> > -        Info("%s: SettingsCopy not required for %ws\n",
>> > -             SubKeyName,
>> > -             Description);
>> > -    }
>> > -
>> > -    RtlFreeAnsiString(&Ansi);
>> > -
>> > -    if (NetLuidLength !=3D 0)
>> > -        RegistryFreeBinaryValue(NetLuid);
>> > -
>> > -    RegistryFreeSzValue(NetCfgInstanceId);
>> > -
>> > -    RegistryCloseKey(SubKey);
>> > -
>> > -    return STATUS_SUCCESS;
>> > -
>> > -fail4:
>> > -    Error("fail4\n");
>> > -
>> > -    if (NetLuidLength !=3D 0)
>> > -        RegistryFreeBinaryValue(NetLuid);
>> > -
>> > -fail3:
>> > -    Error("fail3\n");
>> > -
>> > -    RegistryFreeSzValue(NetCfgInstanceId);
>> > -
>> > -fail2:
>> > -    Error("fail2\n");
>> > -
>> > -    RegistryCloseKey(SubKey);
>> > -
>> > -fail1:
>> > -    Error("fail1 (%08x)\n", status);
>> > -
>> > -    return status;
>> > -}
>> > diff --git a/src/xenvif/settings.h b/src/xenvif/settings.h
>> > deleted file mode 100644
>> > index 3f964bb..0000000
>> > --- a/src/xenvif/settings.h
>> > +++ /dev/null
>> > @@ -1,54 +0,0 @@
>> > -/* Copyright (c) Xen Project.
>> > - * Copyright (c) Cloud Software Group, Inc.
>> > - * All rights reserved.
>> > - *
>> > - * Redistribution and use in source and binary forms,
>> > - * with or without modification, are permitted provided
>> > - * that the following conditions are met:
>> > - *
>> > - * *   Redistributions of source code must retain the above
>> > - *     copyright notice, this list of conditions and the
>> > - *     following disclaimer.
>> > - * *   Redistributions in binary form must reproduce the above
>> > - *     copyright notice, this list of conditions and the
>> > - *     following disclaimer in the documentation and/or other
>> > - *     materials provided with the distribution.
>> > - *
>> > - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
>> > - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
>> > - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
>> > - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
>> > - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
>> > - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>> > - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
>> > - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
>> > - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
>> > - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
>> > - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
>> > - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
>> > - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>> > - * SUCH DAMAGE.
>> > - */
>> > -
>> > -#ifndef _XENVIF_SETTINGS_H
>> > -#define _XENVIF_SETTINGS_H
>> > -
>> > -extern NTSTATUS
>> > -SettingsSave(
>> > -    IN  PCHAR       SubKeyName,
>> > -    IN  PWCHAR      Alias,
>> > -    IN  PWCHAR      Description,
>> > -    IN  LPGUID      InterfaceGuid,
>> > -    IN  PNET_LUID   InterfaceLuid
>> > -    );
>> > -
>> > -extern NTSTATUS
>> > -SettingsRestore(
>> > -    IN  PCHAR       SubKeyName,
>> > -    IN  PWCHAR      Alias,
>> > -    IN  PWCHAR      Description,
>> > -    IN  LPGUID      InterfaceGuid,
>> > -    IN  PNET_LUID   InterfaceLuid
>> > -    );
>> > -
>> > -#endif  // _XENVIF_SETTINGS_H
>> > diff --git a/vs2019/xenvif/xenvif.vcxproj b/vs2019/xenvif/xenvif.vcxpr=
oj
>> > index 0412426..3e48cf7 100644
>> > --- a/vs2019/xenvif/xenvif.vcxproj
>> > +++ b/vs2019/xenvif/xenvif.vcxproj
>> > @@ -82,7 +82,6 @@
>> >       <ClCompile Include=3D"../../src/xenvif/pdo.c" />
>> >       <ClCompile Include=3D"../../src/xenvif/receiver.c" />
>> >       <ClCompile Include=3D"../../src/xenvif/registry.c" />
>> > -    <ClCompile Include=3D"../../src/xenvif/settings.c" />
>> >       <ClCompile Include=3D"../../src/xenvif/thread.c" />
>> >       <ClCompile Include=3D"../../src/xenvif/transmitter.c" />
>> >       <ClCompile Include=3D"../../src/xenvif/controller.c" />
>> > diff --git a/vs2022/xenvif/xenvif.vcxproj b/vs2022/xenvif/xenvif.vcxpr=
oj
>> > index be84232..af9fe96 100644
>> > --- a/vs2022/xenvif/xenvif.vcxproj
>> > +++ b/vs2022/xenvif/xenvif.vcxproj
>> > @@ -74,7 +74,6 @@
>> >       <ClCompile Include=3D"../../src/xenvif/pdo.c" />
>> >       <ClCompile Include=3D"../../src/xenvif/receiver.c" />
>> >       <ClCompile Include=3D"../../src/xenvif/registry.c" />
>> > -    <ClCompile Include=3D"../../src/xenvif/settings.c" />
>> >       <ClCompile Include=3D"../../src/xenvif/thread.c" />
>> >       <ClCompile Include=3D"../../src/xenvif/transmitter.c" />
>> >       <ClCompile Include=3D"../../src/xenvif/controller.c" />
>>
>>
>>

--000000000000b7156d061e77e164
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e">I will update to attempt to copy settings, but make the settings copy co=
de and friendly name setting code non-fatal if any registry operation fails=
, as when IoOpenDriverRegistryKey is used, it seems the Settings key can on=
ly be opened read only, and any access to the tcpip, tcpip6 and netbt is no=
t allowed (due to absolute paths).</div></div><br><div class=3D"gmail_quote=
"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Jul 30, 2024 at 9:02=E2=80=
=AFAM Owen Smith &lt;<a href=3D"mailto:owen.smith@citrix.com">owen.smith@ci=
trix.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:=
monospace">Since Driver Verifier&#39;s=C2=A0registry isolation detects open=
ing=C2=A0absolute paths to registry keys as a violation (and bugchecks), it=
&#39;s not possible to copy settings from emulated to PV.</div></div><br><d=
iv class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Jul =
24, 2024 at 9:13=E2=80=AFAM Paul Durrant &lt;<a href=3D"mailto:xadimgnik@gm=
ail.com" target=3D"_blank">xadimgnik@gmail.com</a>&gt; wrote:<br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left=
:1px solid rgb(204,204,204);padding-left:1ex">On 09/07/2024 11:44, Owen Smi=
th wrote:<br>
&gt; Use MmGetSystemRoutineAddress to dynamically get IoOpenDriverRegistryK=
ey,<br>
&gt; which is not present on Server 2016.<br>
&gt; Where possible, use IoOpenDriverRegistryKey to avoid opening absolute =
registry<br>
&gt; paths, which is a driver verifier violation on Server 2025 WHQL testin=
g.<br>
&gt; <br>
&gt; This does remove PdoSetFriendlyName and SettingsSave/SettingsRestore<b=
r>
&gt; - PdoSetFriendlyName gets an absolute path to the parent of a key open=
ed by an<br>
&gt;=C2=A0 =C2=A0 allowed API<br>
&gt; - SettingsSave/SettingsRestore directly manipulate several absolute pa=
ths, but<br>
&gt;=C2=A0 =C2=A0 due to the recent DeviceID changes, the settings copy cod=
e should not be<br>
&gt;=C2=A0 =C2=A0 neccessary, as the network connection will not be re-crea=
ted on driver update.<br>
&gt; <br>
<br>
What abou when moving from an emulated device to the PV device? That&#39;s =
<br>
why all the settings copy nastiness was originally implemented... it <br>
wasn&#39;t about PV driver update.<br>
<br>
&gt; Signed-off-by: Owen Smith &lt;<a href=3D"mailto:owen.smith@cloud.com" =
target=3D"_blank">owen.smith@cloud.com</a>&gt;<br>
&gt; ---<br>
&gt;=C2=A0 =C2=A0src/xenvif/driver.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 11=
3 +-----<br>
&gt;=C2=A0 =C2=A0src/xenvif/driver.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=
=A0 10 -<br>
&gt;=C2=A0 =C2=A0src/xenvif/pdo.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0| 151 +-------<br>
&gt;=C2=A0 =C2=A0src/xenvif/registry.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 7=
2 +++-<br>
&gt;=C2=A0 =C2=A0src/xenvif/registry.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =
=C2=A09 +-<br>
&gt;=C2=A0 =C2=A0src/xenvif/settings.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 694 ---=
--------------------------------<br>
&gt;=C2=A0 =C2=A0src/xenvif/settings.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 5=
4 ---<br>
&gt;=C2=A0 =C2=A0vs2019/xenvif/xenvif.vcxproj |=C2=A0 =C2=A01 -<br>
&gt;=C2=A0 =C2=A0vs2022/xenvif/xenvif.vcxproj |=C2=A0 =C2=A01 -<br>
&gt;=C2=A0 =C2=A09 files changed, 87 insertions(+), 1018 deletions(-)<br>
&gt;=C2=A0 =C2=A0delete mode 100644 src/xenvif/settings.c<br>
&gt;=C2=A0 =C2=A0delete mode 100644 src/xenvif/settings.h<br>
&gt; <br>
&gt; diff --git a/src/xenvif/driver.c b/src/xenvif/driver.c<br>
&gt; index 3345607..2ac793d 100644<br>
&gt; --- a/src/xenvif/driver.c<br>
&gt; +++ b/src/xenvif/driver.c<br>
&gt; @@ -120,54 +120,6 @@ DriverGetParametersKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return __DriverGetParametersKey();<br>
&gt;=C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -static FORCEINLINE VOID<br>
&gt; -__DriverSetAddressesKey(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 Key<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 Driver.AddressesKey =3D Key;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static FORCEINLINE HANDLE<br>
&gt; -__DriverGetAddressesKey(<br>
&gt; -=C2=A0 =C2=A0 VOID<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 return Driver.AddressesKey;<br>
&gt; -}<br>
&gt; -<br>
&gt; -HANDLE<br>
&gt; -DriverGetAddressesKey(<br>
&gt; -=C2=A0 =C2=A0 VOID<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 return __DriverGetAddressesKey();<br>
&gt; -}<br>
&gt; -<br>
&gt; -static FORCEINLINE VOID<br>
&gt; -__DriverSetSettingsKey(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 Key<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 Driver.SettingsKey =3D Key;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static FORCEINLINE HANDLE<br>
&gt; -__DriverGetSettingsKey(<br>
&gt; -=C2=A0 =C2=A0 VOID<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 return Driver.SettingsKey;<br>
&gt; -}<br>
&gt; -<br>
&gt; -HANDLE<br>
&gt; -DriverGetSettingsKey(<br>
&gt; -=C2=A0 =C2=A0 VOID<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 return __DriverGetSettingsKey();<br>
&gt; -}<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0#define MAXNAMELEN=C2=A0 256<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0static FORCEINLINE VOID<br>
&gt; @@ -265,8 +217,6 @@ DriverUnload(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PDRIVER_OBJECT=C2=A0 DriverObject<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
SettingsKey;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
AddressesKey;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 ParametersKey;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0ASSERT3P(DriverObject, =3D=3D, __DriverGetDr=
iverObject());<br>
&gt; @@ -275,16 +225,6 @@ DriverUnload(<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Driver.NeedReboot =3D FALSE;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 SettingsKey =3D __DriverGetSettingsKey();<br>
&gt; -=C2=A0 =C2=A0 __DriverSetSettingsKey(NULL);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SettingsKey);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 AddressesKey =3D __DriverGetAddressesKey();<br>
&gt; -=C2=A0 =C2=A0 __DriverSetAddressesKey(NULL);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(AddressesKey);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0ParametersKey =3D __DriverGetParametersKey()=
;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0__DriverSetParametersKey(NULL);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; @@ -401,10 +341,7 @@ DriverEntry(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PUNICODE_STRING RegistryPath<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
ServiceKey;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 ParametersKey;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
AddressesKey;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
SettingsKey;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0Index;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 status;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; @@ -428,43 +365,16 @@ DriverEntry(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MONTH,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 YEAR);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryInitialize(RegistryPath);<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryInitialize(DriverObject, RegistryPat=
h);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail1;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenServiceKey(KEY_ALL_ACCESS, &amp;=
ServiceKey);<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryOpenParametersKey(KEY_READ, &amp;Par=
ametersKey);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail2;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenSubKey(ServiceKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Parameters&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KEY_READ,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;ParametersKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0__DriverSetParametersKey(ParametersKey);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryCreateSubKey(ServiceKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Addresses&quot;,<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 REG_OPTION_VOLATILE,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;AddressesKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 __DriverSetAddressesKey(AddressesKey);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryCreateSubKey(ServiceKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Settings&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 REG_OPTION_NON_VOLATILE,<=
br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;SettingsKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail5;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 __DriverSetSettingsKey(SettingsKey);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0DriverObject-&gt;DriverExtension-&gt;AddDevi=
ce =3D AddDevice;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0for (Index =3D 0; Index &lt;=3D IRP_MJ_MAXIM=
UM_FUNCTION; Index++) {<br>
&gt; @@ -477,25 +387,6 @@ DriverEntry(<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -fail5:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail5\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 __DriverSetAddressesKey(NULL);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(AddressesKey);<br>
&gt; -<br>
&gt; -fail4:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail4\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 __DriverSetParametersKey(NULL);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(ParametersKey);<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0fail2:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Error(&quot;fail2\n&quot;);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; diff --git a/src/xenvif/driver.h b/src/xenvif/driver.h<br>
&gt; index b5b9a3d..a9b47d4 100644<br>
&gt; --- a/src/xenvif/driver.h<br>
&gt; +++ b/src/xenvif/driver.h<br>
&gt; @@ -48,16 +48,6 @@ DriverGetParametersKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0VOID<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -extern HANDLE<br>
&gt; -DriverGetAddressesKey(<br>
&gt; -=C2=A0 =C2=A0 VOID<br>
&gt; -=C2=A0 =C2=A0 );<br>
&gt; -<br>
&gt; -extern HANDLE<br>
&gt; -DriverGetSettingsKey(<br>
&gt; -=C2=A0 =C2=A0 VOID<br>
&gt; -=C2=A0 =C2=A0 );<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0extern VOID<br>
&gt;=C2=A0 =C2=A0DriverRequestReboot(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0VOID<br>
&gt; diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c<br>
&gt; index 8ec9814..51cbd97 100644<br>
&gt; --- a/src/xenvif/pdo.c<br>
&gt; +++ b/src/xenvif/pdo.c<br>
&gt; @@ -54,7 +54,6 @@<br>
&gt;=C2=A0 =C2=A0#include &quot;registry.h&quot;<br>
&gt;=C2=A0 =C2=A0#include &quot;thread.h&quot;<br>
&gt;=C2=A0 =C2=A0#include &quot;link.h&quot;<br>
&gt; -#include &quot;settings.h&quot;<br>
&gt;=C2=A0 =C2=A0#include &quot;dbg_print.h&quot;<br>
&gt;=C2=A0 =C2=A0#include &quot;assert.h&quot;<br>
&gt;=C2=A0 =C2=A0#include &quot;util.h&quot;<br>
&gt; @@ -727,30 +726,16 @@ __PdoSetPermanentAddress(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0Buf=
fer<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; -=C2=A0 =C2=A0 ANSI_STRING=C2=A0 =C2=A0 =C2=A0Ansi[2];<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<=
br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D __PdoParseAddress(Buffer, &amp;Pd=
o-&gt;PermanentAddress);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail1;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 RtlZeroMemory(Ansi, sizeof (ANSI_STRING) * 2);<br>
&gt; -=C2=A0 =C2=A0 RtlInitAnsiString(&amp;Ansi[0], Buffer);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryUpdateSzValue(DriverGetAddressesKey(=
),<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__PdoGetName(Pdo),<=
br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0REG_SZ,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Ansi);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;%s: %Z\n&quot;, __PdoGetName(Pdo), &amp;Ansi=
[0]);<br>
&gt; +=C2=A0 =C2=A0 Info(&quot;%s: %s\n&quot;, __PdoGetName(Pdo), Buffer);<=
br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0fail1:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Error(&quot;fail1 (%08x)\n&quot;, status);<b=
r>
&gt;=C2=A0 =C2=A0<br>
&gt; @@ -778,68 +763,9 @@ __PdoClearPermanentAddress(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PXENVIF_PDO Pdo<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; -=C2=A0 =C2=A0 (VOID) RegistryDeleteValue(DriverGetAddressesKey(),<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__PdoGetName(Pdo));<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Pdo-&gt;PermanentAddress,=
 sizeof (ETHERNET_ADDRESS));<br>
&gt;=C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -static NTSTATUS<br>
&gt; -PdoSetFriendlyName(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PXENVIF_PDO Pdo,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 SoftwareKey,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 HardwareKey<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 PANSI_STRING=C2=A0 =C2=A0 DriverDesc;<br>
&gt; -=C2=A0 =C2=A0 CHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Buffer[MA=
XNAMELEN];<br>
&gt; -=C2=A0 =C2=A0 ANSI_STRING=C2=A0 =C2=A0 =C2=A0Ansi[2];<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryQuerySzValue(SoftwareKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;DriverDesc&quot;,<b=
r>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;DriverDesc);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlStringCbPrintfA(Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MAXNAMELEN,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;%Z #%s&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;DriverDesc[0],<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __PdoGetName(Pdo)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 );<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlZeroMemory(Ansi, sizeof (ANSI_STRING) * 2);<br>
&gt; -=C2=A0 =C2=A0 RtlInitAnsiString(&amp;Ansi[0], Buffer);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryUpdateSzValue(HardwareKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;FriendlyName&=
quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0REG_SZ,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Ansi);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;%s: %Z\n&quot;, __PdoGetName(Pdo), &amp;Ansi=
[0]);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryFreeSzValue(DriverDesc);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0static FORCEINLINE NTSTATUS<br>
&gt;=C2=A0 =C2=A0__PdoSetCurrentAddress(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PXENVIF_PDO Pdo,<br>
&gt; @@ -1276,15 +1202,13 @@ PdoUnplugRequested(<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0static FORCEINLINE NTSTATUS<br>
&gt;=C2=A0 =C2=A0PdoParseMibTable(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PXENVIF_PDO=C2=A0 =C2=A0 =C2=A0Pdo,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Softw=
areKey<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PXENVIF_PDO=C2=A0 =C2=A0 =C2=A0Pdo<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 (*__GetIfTable2)(PMIB_IF_TABLE2 *);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0VOID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 (*__FreeMibTable)(PVOID);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0PMIB_IF_TABLE2=C2=A0 =C2=A0 =C2=A0 Table;<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0Index;<br>
&gt; -=C2=A0 =C2=A0 GUID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 Guid;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 status;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D LinkGetRoutineAddress(&quot;netio=
.sys&quot;,<br>
&gt; @@ -1330,56 +1254,10 @@ PdoParseMibTable(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (Row-&gt;OperStatus !=3D If=
OperStatusUp)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0continue;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID) SettingsSave(__PdoGetName(Pdo),<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Row-&gt;Alias,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Row-&gt;Description,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;Row-&gt;InterfaceGuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;Row-&gt;InterfaceLuid);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D STATUS_PNP_REBOOT_R=
EQUIRED;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail4;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 //<br>
&gt; -=C2=A0 =C2=A0 // If there is a stack bound then restore any settings =
that<br>
&gt; -=C2=A0 =C2=A0 // may have been saved from an aliasing device.<br>
&gt; -=C2=A0 =C2=A0 //<br>
&gt; -=C2=A0 =C2=A0 status =3D PdoGetInterfaceGuid(Pdo, SoftwareKey, &amp;G=
uid);<br>
&gt; -=C2=A0 =C2=A0 if (NT_SUCCESS(status)) {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 NET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0 Luid;=
<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
Alias;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
Description;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 RtlZeroMemory(&amp;Luid, sizeof(NET_LUID)=
);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 Alias =3D NULL;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 Description =3D NULL;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D PdoGetInterfaceLuid(Pdo, Softw=
areKey, &amp;Luid);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (NT_SUCCESS(status)) {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for (Index =3D 0; Index &lt=
; Table-&gt;NumEntries; Index++) {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMIB_IF_ROW2=
=C2=A0 =C2=A0 Row =3D &amp;Table-&gt;Table[Index];<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Trace(&quot;%=
s: CHECKING %ws (%ws)\n&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 __PdoGetName(Pdo),<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 Row-&gt;Alias,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 Row-&gt;Description);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (Row-&gt;I=
nterfaceLuid.Value !=3D Luid.Value)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 continue;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Alias =3D Row=
-&gt;Alias;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Description =
=3D Row-&gt;Description;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID) SettingsRestore(__PdoGetName(Pdo),=
<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Alias,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Description,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;Guid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;Luid);<br>
&gt; -=C2=A0 =C2=A0 }<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0__FreeMibTable(Table);<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
&gt; @@ -1408,7 +1286,6 @@ PdoStartDevice(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 SoftwareKey;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
HardwareKey;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 status;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D STATUS_UNSUCCESSFUL;<br>
&gt; @@ -1421,21 +1298,11 @@ PdoStartDevice(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail2;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenHardwareKey(__PdoGetDeviceObject=
(Pdo),<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0KEY_ALL_ACCE=
SS,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;Hardwar=
eKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) PdoSetFriendlyName(Pdo,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SoftwareKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 HardwareKey);<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D __PdoSetCurrentAddress(Pdo, Softw=
areKey);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 status =3D PdoParseMibTable(Pdo, SoftwareKey);<br>
&gt; +=C2=A0 =C2=A0 status =3D PdoParseMibTable(Pdo);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (status =3D=3D STATUS_PNP_REBOOT_REQUIRED=
 || !PdoUnplugRequested(Pdo)) {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PdoUnplugRequest(Pdo, TRUE); /=
/ fix unplug reference count<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DriverRequestReboot();<br>
&gt; @@ -1445,7 +1312,7 @@ PdoStartDevice(<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D PdoD3ToD0(Pdo);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail5;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0PdoUnplugRequest(Pdo, TRUE);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; @@ -1454,20 +1321,14 @@ PdoStartDevice(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Irp-&gt;IoStatus.Status =3D STATUS_SUCCESS;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IoCompleteRequest(Irp, IO_NO_INCREMENT);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(HardwareKey);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0RegistryCloseKey(SoftwareKey);<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -fail5:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail5\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlZeroMemory(&amp;Pdo-&gt;CurrentAddress, sizeof (ETHE=
RNET_ADDRESS));<br>
&gt; -<br>
&gt;=C2=A0 =C2=A0fail4:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Error(&quot;fail4\n&quot;);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(HardwareKey);<br>
&gt; +=C2=A0 =C2=A0 RtlZeroMemory(&amp;Pdo-&gt;CurrentAddress, sizeof (ETHE=
RNET_ADDRESS));<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0fail3:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Error(&quot;fail3\n&quot;);<br>
&gt; diff --git a/src/xenvif/registry.c b/src/xenvif/registry.c<br>
&gt; index 8f84818..792ce03 100644<br>
&gt; --- a/src/xenvif/registry.c<br>
&gt; +++ b/src/xenvif/registry.c<br>
&gt; @@ -38,8 +38,13 @@<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0#define REGISTRY_TAG &#39;GERX&#39;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +static PDRIVER_OBJECT=C2=A0 =C2=A0RegistryDriverObject;<br>
&gt;=C2=A0 =C2=A0static UNICODE_STRING=C2=A0 =C2=A0RegistryPath;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +typedef NTSTATUS(*IOOPENDRIVERREGISTRYKEY)(PDRIVER_OBJECT, DRIVER_REG=
KEY_TYPE, ACCESS_MASK, ULONG, PHANDLE);<br>
&gt; +<br>
&gt; +static IOOPENDRIVERREGISTRYKEY __IoOpenDriverRegistryKey;<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0static FORCEINLINE PVOID<br>
&gt;=C2=A0 =C2=A0__RegistryAllocate(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 ULONG=C2=A0 =C2=A0Length<br>
&gt; @@ -58,9 +63,12 @@ __RegistryFree(<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0NTSTATUS<br>
&gt;=C2=A0 =C2=A0RegistryInitialize(<br>
&gt; -=C2=A0 =C2=A0 IN PUNICODE_STRING=C2=A0 Path<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PDRIVER_OBJECT=C2=A0 DriverObject,<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PUNICODE_STRING Path<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; +=C2=A0 =C2=A0 UNICODE_STRING=C2=A0 =C2=A0 =C2=A0 Unicode;<br>
&gt; +=C2=A0 =C2=A0 PVOID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0Func;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 status;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0ASSERT3P(RegistryPath.Buffer, =3D=3D, NULL);=
<br>
&gt; @@ -69,6 +77,16 @@ RegistryInitialize(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail1;<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +=C2=A0 =C2=A0 ASSERT3P(RegistryDriverObject, =3D=3D, NULL);<br>
&gt; +=C2=A0 =C2=A0 RegistryDriverObject =3D DriverObject;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 ASSERT3P(__IoOpenDriverRegistryKey, =3D=3D, NULL);<br>
&gt; +=C2=A0 =C2=A0 RtlInitUnicodeString(&amp;Unicode, L&quot;IoOpenDriverR=
egistryKey&quot;);<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 Func =3D MmGetSystemRoutineAddress(&amp;Unicode);<br>
&gt; +=C2=A0 =C2=A0 if (Func !=3D NULL)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 __IoOpenDriverRegistryKey =3D (IOOPENDRIV=
ERREGISTRYKEY)Func;<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0fail1:<br>
&gt; @@ -82,6 +100,10 @@ RegistryTeardown(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0VOID<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0)<br>
&gt;=C2=A0 =C2=A0{<br>
&gt; +=C2=A0 =C2=A0 __IoOpenDriverRegistryKey =3D NULL;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 RegistryDriverObject =3D NULL;<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0RtlFreeUnicodeString(&amp;RegistryPath);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0RegistryPath.Buffer =3D NULL;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0RegistryPath.MaximumLength =3D RegistryPath.=
Length =3D 0;<br>
&gt; @@ -266,6 +288,54 @@ RegistryCreateServiceKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return RegistryCreateKey(NULL, &amp;Registry=
Path, REG_OPTION_NON_VOLATILE, Key);<br>
&gt;=C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +NTSTATUS<br>
&gt; +RegistryOpenParametersKey(<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 ACCESS_MASK=C2=A0 =C2=A0 =C2=A0DesiredAccess,<=
br>
&gt; +=C2=A0 =C2=A0 OUT PHANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Key<br>
&gt; +=C2=A0 =C2=A0 )<br>
&gt; +{<br>
&gt; +=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
ServiceKey;<br>
&gt; +=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 statu=
s;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 if (__IoOpenDriverRegistryKey !=3D NULL) {<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D __IoOpenDriverRegistryKey(Regi=
stryDriverObject,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0DriverRegKeyParameters,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0DesiredAccess,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A00,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0Key);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
&gt; +=C2=A0 =C2=A0 }<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryOpenKey(NULL, &amp;RegistryPath, Des=
iredAccess, &amp;ServiceKey);<br>
&gt; +=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 status =3D RegistryOpenSubKey(ServiceKey, &quot;Paramet=
ers&quot;, DesiredAccess, Key);<br>
&gt; +=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; +<br>
&gt; +done:<br>
&gt; +=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; +<br>
&gt; +fail3:<br>
&gt; +=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 RegistryCloseKey(ServiceKey);<br>
&gt; +<br>
&gt; +fail2:<br>
&gt; +=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; +<br>
&gt; +fail1:<br>
&gt; +=C2=A0 =C2=A0 Error(&quot;fail1 %08x\n&quot;, status);<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 return status;<br>
&gt; +}<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0NTSTATUS<br>
&gt;=C2=A0 =C2=A0RegistryOpenSoftwareKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PDEVICE_OBJECT=C2=A0 DeviceObject,<=
br>
&gt; diff --git a/src/xenvif/registry.h b/src/xenvif/registry.h<br>
&gt; index c656806..60c50e8 100644<br>
&gt; --- a/src/xenvif/registry.h<br>
&gt; +++ b/src/xenvif/registry.h<br>
&gt; @@ -37,7 +37,8 @@<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0extern NTSTATUS<br>
&gt;=C2=A0 =C2=A0RegistryInitialize(<br>
&gt; -=C2=A0 =C2=A0 IN PUNICODE_STRING=C2=A0 Path<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PDRIVER_OBJECT=C2=A0 DriverObject,<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 PUNICODE_STRING Path<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0);<br>
&gt;=C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0extern VOID<br>
&gt; @@ -72,6 +73,12 @@ RegistryCreateServiceKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0OUT PHANDLE=C2=A0 =C2=A0 =C2=A0Key<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0);<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +extern NTSTATUS<br>
&gt; +RegistryOpenParametersKey(<br>
&gt; +=C2=A0 =C2=A0 IN=C2=A0 ACCESS_MASK=C2=A0 =C2=A0 =C2=A0DesiredAccess,<=
br>
&gt; +=C2=A0 =C2=A0 OUT PHANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Key<br>
&gt; +=C2=A0 =C2=A0 );<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0extern NTSTATUS<br>
&gt;=C2=A0 =C2=A0RegistryOpenSoftwareKey(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0IN=C2=A0 PDEVICE_OBJECT=C2=A0 DeviceObject,<=
br>
&gt; diff --git a/src/xenvif/settings.c b/src/xenvif/settings.c<br>
&gt; deleted file mode 100644<br>
&gt; index 4dd4ec4..0000000<br>
&gt; --- a/src/xenvif/settings.c<br>
&gt; +++ /dev/null<br>
&gt; @@ -1,694 +0,0 @@<br>
&gt; -/* Copyright (c) Xen Project.<br>
&gt; - * Copyright (c) Cloud Software Group, Inc.<br>
&gt; - * All rights reserved.<br>
&gt; - *<br>
&gt; - * Redistribution and use in source and binary forms,<br>
&gt; - * with or without modification, are permitted provided<br>
&gt; - * that the following conditions are met:<br>
&gt; - *<br>
&gt; - * *=C2=A0 =C2=A0Redistributions of source code must retain the above=
<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0copyright notice, this list of conditions and t=
he<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0following disclaimer.<br>
&gt; - * *=C2=A0 =C2=A0Redistributions in binary form must reproduce the ab=
ove<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0copyright notice, this list of conditions and t=
he<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0following disclaimer in the documentation and/o=
r other<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0materials provided with the distribution.<br>
&gt; - *<br>
&gt; - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND<br>
&gt; - * CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTI=
ES,<br>
&gt; - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF<br>
&gt; - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE<br>
&gt; - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR<br>
&gt; - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,<br>
&gt; - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,<br>
&gt; - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR<br>
&gt; - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
&gt; - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,<br>
&gt; - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING<br>
&gt; - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE<br>
&gt; - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF<br>
&gt; - * SUCH DAMAGE.<br>
&gt; - */<br>
&gt; -<br>
&gt; -#include &lt;ntddk.h&gt;<br>
&gt; -#include &lt;ntstrsafe.h&gt;<br>
&gt; -<br>
&gt; -#include &quot;registry.h&quot;<br>
&gt; -#include &quot;driver.h&quot;<br>
&gt; -#include &quot;dbg_print.h&quot;<br>
&gt; -#include &quot;assert.h&quot;<br>
&gt; -#include &quot;util.h&quot;<br>
&gt; -<br>
&gt; -#define SETTINGS_TAG &#39;TTES&#39;<br>
&gt; -<br>
&gt; -#define INTERFACES_PATH(_Name)=C2=A0 =C2=A0 =C2=A0 \<br>
&gt; -=C2=A0 =C2=A0 &quot;\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\S=
ervices\\&quot; ## #_Name ## &quot;\\Parameters\\Interfaces\\&quot;<br>
&gt; -<br>
&gt; -#define IPV6_PATH=C2=A0 =C2=A0\<br>
&gt; -=C2=A0 =C2=A0 &quot;\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\C=
ontrol\\Nsi\\{eb004a01-9b1a-11d4-9123-0050047759bc}\\10&quot;<br>
&gt; -<br>
&gt; -#define IPV4_PATH=C2=A0 =C2=A0\<br>
&gt; -=C2=A0 =C2=A0 &quot;\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\C=
ontrol\\Nsi\\{eb004a00-9b1a-11d4-9123-0050047759bc}\\10&quot;<br>
&gt; -<br>
&gt; -#define NETLUID_STRING_LENGTH 16<br>
&gt; -<br>
&gt; -typedef struct _SETTINGS_COPY_IP_ADDRESS_PARAMETERS {<br>
&gt; -=C2=A0 =C2=A0 CHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 SrcPrefix[NETLUID_STRIN=
G_LENGTH + 1];<br>
&gt; -=C2=A0 =C2=A0 CHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 DstPrefix[NETLUID_STRIN=
G_LENGTH + 1];<br>
&gt; -} SETTINGS_COPY_IP_ADDRESS_PARAMETERS, *PSETTINGS_COPY_IP_ADDRESS_PAR=
AMETERS;<br>
&gt; -<br>
&gt; -static FORCEINLINE PVOID<br>
&gt; -__SettingsAllocate(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 ULONG=C2=A0 =C2=A0Length<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 return __AllocatePoolWithTag(NonPagedPool, Length, SETT=
INGS_TAG);<br>
&gt; -}<br>
&gt; -<br>
&gt; -static FORCEINLINE VOID<br>
&gt; -__SettingsFree(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PVOID=C2=A0 =C2=A0Buffer<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 __FreePoolWithTag(Buffer, SETTINGS_TAG);<br>
&gt; -}<br>
&gt; -<br>
&gt; -static FORCEINLINE NTSTATUS<br>
&gt; -__GuidToString(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 LPGUID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Guid,=
<br>
&gt; -=C2=A0 =C2=A0 OUT PANSI_STRING=C2=A0 =C2=A0 Ansi<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 statu=
s;<br>
&gt; -=C2=A0 =C2=A0 UNICODE_STRING=C2=A0 =C2=A0 =C2=A0 Unicode;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlStringFromGUID(Guid, &amp;Unicode);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlUnicodeStringToAnsiString(Ansi, &amp;Unic=
ode, TRUE);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlFreeUnicodeString(&amp;Unicode);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlFreeUnicodeString(&amp;Unicode);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static NTSTATUS<br>
&gt; -SettingsCopyIpAddressesValue(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PVOID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Conte=
xt,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Key,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ValueName,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Type<=
br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 PSETTINGS_COPY_IP_ADDRESS_PARAMETERS=C2=A0 =C2=A0 Param=
eters =3D Context;<br>
&gt; -=C2=A0 =C2=A0 PVOID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0Value;<br>
&gt; -=C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0ValueLength;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<=
br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 UNREFERENCED_PARAMETER(Type);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 if (_strnicmp(ValueName-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Parame=
ters-&gt;SrcPrefix,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NETLUI=
D_STRING_LENGTH) !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Trace(&quot;=C2=A0 =C2=A0 -&gt; %Z\n&quot;, ValueName);=
<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryQueryBinaryValue(Key,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ValueName-&=
gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;Value,=
<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;ValueL=
ength);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryDeleteValue(Key,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ValueName-&gt;Buffer);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 ASSERT(NETLUID_STRING_LENGTH &lt; ValueName-&gt;Length)=
;<br>
&gt; -=C2=A0 =C2=A0 memcpy(ValueName-&gt;Buffer, Parameters-&gt;DstPrefix, =
NETLUID_STRING_LENGTH);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Trace(&quot;=C2=A0 =C2=A0 &lt;- %Z\n&quot;, ValueName);=
<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryUpdateBinaryValue(Key,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Value=
Name-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Value=
,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Value=
Length);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 if (ValueLength !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 RegistryFreeBinaryValue(Value);<br>
&gt; -<br>
&gt; -done:<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 if (ValueLength !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 RegistryFreeBinaryValue(Value);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static NTSTATUS<br>
&gt; -SettingsCopyIpAddresses(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Version,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldLuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewLuid<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 SETTINGS_COPY_IP_ADDRESS_PARAMETERS Parameters;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Key;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlStringCbPrintfA(Parameters.SrcPrefix,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeof(Parameters.SrcPrefix),<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;%016llx&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 _byteswap_uint64(OldLuid-&gt;Val=
ue));<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlStringCbPrintfA(Parameters.DstPrefix,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeof(Parameters.DstPrefix),<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;%016llx&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 _byteswap_uint64(NewLuid-&gt;Val=
ue));<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenSubKey(NULL,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (Version =3D=3D 4) ? IPV4_PATH :=
 IPV6_PATH,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KEY_ALL_ACCESS,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;Key);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;IPv%u: %s -&gt; %s\n&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Version,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Parameters.SrcPrefix,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Parameters.DstPrefix);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryEnumerateValues(Key,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0SettingsCopy=
IpAddressesValue,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;Paramet=
ers);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(Key);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail4:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail4\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(Key);<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static NTSTATUS<br>
&gt; -SettingsCopyInterfaceValue(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PVOID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 Context,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0SourceKey,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 =C2=A0ValueName,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 Type<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0DestinationKey =3D Context;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0status;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Trace(&quot; - %Z\n&quot;, ValueName);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 switch (Type) {<br>
&gt; -=C2=A0 =C2=A0 case REG_DWORD: {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0Value;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D RegistryQueryDwordValue(Source=
Key,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0ValueName-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0&amp;Value);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID) RegistryUpdateDwordV=
alue(DestinationKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 ValueName-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 Value);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
&gt; -=C2=A0 =C2=A0 }<br>
&gt; -=C2=A0 =C2=A0 case REG_SZ:<br>
&gt; -=C2=A0 =C2=A0 case REG_MULTI_SZ: {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 PANSI_STRING=C2=A0 =C2=A0 Value;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D RegistryQuerySzValue(SourceKey=
,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ValueName-&=
gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;Value)=
;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (NT_SUCCESS(status)) {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID) RegistryUpdateSzValu=
e(DestinationKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0ValueName-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0Type,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0Value);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RegistryFreeSzValue(Value);=
<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
&gt; -=C2=A0 =C2=A0 }<br>
&gt; -=C2=A0 =C2=A0 case REG_BINARY: {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 PVOID=C2=A0 =C2=A0Value;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0Length;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D RegistryQueryBinaryValue(Sourc=
eKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 ValueName-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 &amp;Value,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 &amp;Length);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (NT_SUCCESS(status)) {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID) RegistryUpdateBinary=
Value(DestinationKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0ValueName-&gt;Buffer,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0Value,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0Length);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (Length !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RegistryFreeB=
inaryValue(Value);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
&gt; -=C2=A0 =C2=A0 }<br>
&gt; -=C2=A0 =C2=A0 default:<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 ASSERT(FALSE);<br>
&gt; -=C2=A0 =C2=A0 }<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static NTSTATUS<br>
&gt; -SettingsCopyInterface(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
InterfacePath,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
InterfacePrefix,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 OldGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 NewGuid<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
OldKey;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
NewKey;<br>
&gt; -=C2=A0 =C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0OldKeyName;<br>
&gt; -=C2=A0 =C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0NewKeyName;<br>
&gt; -=C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0OldKeyLength;<br>
&gt; -=C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0NewKeyLength;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 statu=
s;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 OldKeyLength =3D (ULONG)(strlen(InterfacePath) +<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0strlen(InterfacePrefix) +<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldGuid-&gt;Length +<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A01) * sizeof(CHAR);<br>
&gt; -=C2=A0 =C2=A0 NewKeyLength =3D (ULONG)(strlen(InterfacePath) +<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0strlen(InterfacePrefix) +<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewGuid-&gt;Length +<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A01) * sizeof(CHAR);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D STATUS_NO_MEMORY;<br>
&gt; -=C2=A0 =C2=A0 OldKeyName =3D __SettingsAllocate(OldKeyLength);<br>
&gt; -=C2=A0 =C2=A0 if (OldKeyName =3D=3D NULL)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 NewKeyName =3D __SettingsAllocate(NewKeyLength);<br>
&gt; -=C2=A0 =C2=A0 if (NewKeyName =3D=3D NULL)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlStringCbPrintfA(OldKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 OldKeyLength,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;%s%s%Z&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 InterfacePath,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 InterfacePrefix,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 OldGuid);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RtlStringCbPrintfA(NewKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NewKeyLength,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;%s%s%Z&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 InterfacePath,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 InterfacePrefix,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NewGuid);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenSubKey(NULL,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 OldKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KEY_READ,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;OldKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail5;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryCreateSubKey(NULL,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NewKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 REG_OPTION_NON_VOLATILE,<=
br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;NewKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail6;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryEnumerateValues(OldKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0SettingsCopy=
InterfaceValue,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail7;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(NewKey);<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(OldKey);<br>
&gt; -=C2=A0 =C2=A0 __SettingsFree(NewKeyName);<br>
&gt; -=C2=A0 =C2=A0 __SettingsFree(OldKeyName);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail7:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail7\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(NewKey);<br>
&gt; -<br>
&gt; -fail6:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail6\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(OldKey);<br>
&gt; -<br>
&gt; -fail5:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail5\n&quot;);<br>
&gt; -<br>
&gt; -fail4:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail4\n&quot;);<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 __SettingsFree(NewKeyName);<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 __SettingsFree(OldKeyName);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static NTSTATUS<br>
&gt; -SettingsStoreCurrent(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SubKe=
y,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 Guid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0Luid<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 statu=
s;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryUpdateSzValue(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;NetCfgInstanc=
eId&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0REG_SZ,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Guid);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryUpdateBinaryValue(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot=
;NetLuid&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Luid,=
<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeo=
f(NET_LUID));<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) RegistryDeleteValue(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;HasSettings&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -static NTSTATUS<br>
&gt; -SettingsCopy(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
SubKeyName,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 OldGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0OldLuid,<b=
r>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PANSI_STRING=C2=A0 =C2=A0 NewGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0NewLuid<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0)<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
SettingsKey;<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
SubKey;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 statu=
s;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Trace(&quot;=3D=3D=3D=3D&gt;\n&quot;);<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;VIF/%s: FROM %Z\n&quot;, SubKeyName, OldGuid=
);<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;VIF/%s: TO=C2=A0 =C2=A0%Z\n&quot;, SubKeyNam=
e, NewGuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) SettingsCopyInterface(INTERFACES_PATH(NetBT),<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;Tcpip_&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldGuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewGuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) SettingsCopyInterface(INTERFACES_PATH(Tcpip),<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldGuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewGuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) SettingsCopyInterface(INTERFACES_PATH(Tcpip6),<b=
r>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldGuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewGuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) SettingsCopyIpAddresses(4,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldLuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewLuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 (VOID) SettingsCopyIpAddresses(6,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OldLuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NewLuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 SettingsKey =3D DriverGetSettingsKey();<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryCreateSubKey(SettingsKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SubKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 REG_OPTION_NON_VOLATILE,<=
br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;SubKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D SettingsStoreCurrent(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NewGuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NewLuid);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SubKey);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Trace(&quot;&lt;=3D=3D=3D=3D\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SubKey);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -NTSTATUS<br>
&gt; -SettingsSave(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0SubKeyName,<br=
>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Alias,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Description,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 LPGUID=C2=A0 =C2=A0 =C2=A0 InterfaceGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0InterfaceLuid<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SettingsKey;<b=
r>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SubKey;<br>
&gt; -=C2=A0 =C2=A0 ANSI_STRING=C2=A0 =C2=A0 =C2=A0Ansi;<br>
&gt; -=C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0HasSettin=
gs;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;FROM %ws (%ws)\n&quot;, Alias, Description);=
<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D __GuidToString(InterfaceGuid, &amp;Ansi);<br=
>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 SettingsKey =3D DriverGetSettingsKey();<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryCreateSubKey(SettingsKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SubKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 REG_OPTION_NON_VOLATILE,<=
br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;SubKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 HasSettings =3D 0;<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryQueryDwordValue(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;HasSet=
tings&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;HasSett=
ings);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 HasSettings =3D 0;<br>
&gt; -=C2=A0 =C2=A0 if (HasSettings !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;FROM %Z\n&quot;, Ansi);<br>
&gt; -=C2=A0 =C2=A0 Info(&quot;FROM %016llx\n&quot;, InterfaceLuid-&gt;Valu=
e);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D SettingsStoreCurrent(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;Ansi,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 InterfaceLuid);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlFreeAnsiString(&amp;Ansi);<br>
&gt; -<br>
&gt; -done:<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SubKey);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SubKey);<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlFreeAnsiString(&amp;Ansi);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; -<br>
&gt; -NTSTATUS<br>
&gt; -SettingsRestore(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0SubKeyName,<br=
>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Alias,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Description,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 LPGUID=C2=A0 =C2=A0 =C2=A0 InterfaceGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0InterfaceLuid<br>
&gt; -=C2=A0 =C2=A0 )<br>
&gt; -{<br>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SettingsKey;<b=
r>
&gt; -=C2=A0 =C2=A0 HANDLE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SubKey;<br>
&gt; -=C2=A0 =C2=A0 ANSI_STRING=C2=A0 =C2=A0 =C2=A0Ansi;<br>
&gt; -=C2=A0 =C2=A0 PANSI_STRING=C2=A0 =C2=A0 NetCfgInstanceId;<br>
&gt; -=C2=A0 =C2=A0 PNET_LUID=C2=A0 =C2=A0 =C2=A0 =C2=A0NetLuid;<br>
&gt; -=C2=A0 =C2=A0 ULONG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NetLuidLe=
ngth;<br>
&gt; -=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 SettingsKey =3D DriverGetSettingsKey();<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryOpenSubKey(SettingsKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SubKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KEY_READ,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;SubKey);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryQuerySzValue(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;NetCfgInstanceId&qu=
ot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;NetCfgInstanceId);<b=
r>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 NetLuidLength =3D 0;<br>
&gt; -=C2=A0 =C2=A0 status =3D RegistryQueryBinaryValue(SubKey,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;NetLu=
id&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;NetLui=
d,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;NetLui=
dLength);<br>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 status =3D __GuidToString(InterfaceGuid, &amp;Ansi);<br=
>
&gt; -=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 if (RtlCompareString(NetCfgInstanceId, &amp;Ansi, TRUE)=
 !=3D 0) {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 Info(&quot;TO %ws (%ws)\n&quot;, Alias, D=
escription);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 Info(&quot;TO %Z\n&quot;, Ansi);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 Info(&quot;TO %016llx\n&quot;, InterfaceL=
uid-&gt;Value);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 SettingsCopy(SubKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0NetCfgInstanceId,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0NetLuid,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0&amp;Ansi,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0InterfaceLuid);<br>
&gt; -=C2=A0 =C2=A0 } else {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 Info(&quot;%s: SettingsCopy not required =
for %ws\n&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0SubKeyName,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Description);<br>
&gt; -=C2=A0 =C2=A0 }<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RtlFreeAnsiString(&amp;Ansi);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 if (NetLuidLength !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 RegistryFreeBinaryValue(NetLuid);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryFreeSzValue(NetCfgInstanceId);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SubKey);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
&gt; -<br>
&gt; -fail4:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail4\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 if (NetLuidLength !=3D 0)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 RegistryFreeBinaryValue(NetLuid);<br>
&gt; -<br>
&gt; -fail3:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryFreeSzValue(NetCfgInstanceId);<br>
&gt; -<br>
&gt; -fail2:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 RegistryCloseKey(SubKey);<br>
&gt; -<br>
&gt; -fail1:<br>
&gt; -=C2=A0 =C2=A0 Error(&quot;fail1 (%08x)\n&quot;, status);<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 return status;<br>
&gt; -}<br>
&gt; diff --git a/src/xenvif/settings.h b/src/xenvif/settings.h<br>
&gt; deleted file mode 100644<br>
&gt; index 3f964bb..0000000<br>
&gt; --- a/src/xenvif/settings.h<br>
&gt; +++ /dev/null<br>
&gt; @@ -1,54 +0,0 @@<br>
&gt; -/* Copyright (c) Xen Project.<br>
&gt; - * Copyright (c) Cloud Software Group, Inc.<br>
&gt; - * All rights reserved.<br>
&gt; - *<br>
&gt; - * Redistribution and use in source and binary forms,<br>
&gt; - * with or without modification, are permitted provided<br>
&gt; - * that the following conditions are met:<br>
&gt; - *<br>
&gt; - * *=C2=A0 =C2=A0Redistributions of source code must retain the above=
<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0copyright notice, this list of conditions and t=
he<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0following disclaimer.<br>
&gt; - * *=C2=A0 =C2=A0Redistributions in binary form must reproduce the ab=
ove<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0copyright notice, this list of conditions and t=
he<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0following disclaimer in the documentation and/o=
r other<br>
&gt; - *=C2=A0 =C2=A0 =C2=A0materials provided with the distribution.<br>
&gt; - *<br>
&gt; - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND<br>
&gt; - * CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTI=
ES,<br>
&gt; - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF<br>
&gt; - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE<br>
&gt; - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR<br>
&gt; - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,<br>
&gt; - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,<br>
&gt; - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR<br>
&gt; - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
&gt; - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,<br>
&gt; - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING<br>
&gt; - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE<br>
&gt; - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF<br>
&gt; - * SUCH DAMAGE.<br>
&gt; - */<br>
&gt; -<br>
&gt; -#ifndef _XENVIF_SETTINGS_H<br>
&gt; -#define _XENVIF_SETTINGS_H<br>
&gt; -<br>
&gt; -extern NTSTATUS<br>
&gt; -SettingsSave(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0SubKeyName,<br=
>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Alias,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Description,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 LPGUID=C2=A0 =C2=A0 =C2=A0 InterfaceGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0InterfaceLuid<br>
&gt; -=C2=A0 =C2=A0 );<br>
&gt; -<br>
&gt; -extern NTSTATUS<br>
&gt; -SettingsRestore(<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0SubKeyName,<br=
>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Alias,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PWCHAR=C2=A0 =C2=A0 =C2=A0 Description,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 LPGUID=C2=A0 =C2=A0 =C2=A0 InterfaceGuid,<br>
&gt; -=C2=A0 =C2=A0 IN=C2=A0 PNET_LUID=C2=A0 =C2=A0InterfaceLuid<br>
&gt; -=C2=A0 =C2=A0 );<br>
&gt; -<br>
&gt; -#endif=C2=A0 // _XENVIF_SETTINGS_H<br>
&gt; diff --git a/vs2019/xenvif/xenvif.vcxproj b/vs2019/xenvif/xenvif.vcxpr=
oj<br>
&gt; index 0412426..3e48cf7 100644<br>
&gt; --- a/vs2019/xenvif/xenvif.vcxproj<br>
&gt; +++ b/vs2019/xenvif/xenvif.vcxproj<br>
&gt; @@ -82,7 +82,6 @@<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/pdo.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/receiver.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/registry.c&quot; /&gt;<br>
&gt; -=C2=A0 =C2=A0 &lt;ClCompile Include=3D&quot;../../src/xenvif/settings=
.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/thread.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/transmitter.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/controller.c&quot; /&gt;<br>
&gt; diff --git a/vs2022/xenvif/xenvif.vcxproj b/vs2022/xenvif/xenvif.vcxpr=
oj<br>
&gt; index be84232..af9fe96 100644<br>
&gt; --- a/vs2022/xenvif/xenvif.vcxproj<br>
&gt; +++ b/vs2022/xenvif/xenvif.vcxproj<br>
&gt; @@ -74,7 +74,6 @@<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/pdo.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/receiver.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/registry.c&quot; /&gt;<br>
&gt; -=C2=A0 =C2=A0 &lt;ClCompile Include=3D&quot;../../src/xenvif/settings=
.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/thread.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/transmitter.c&quot; /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenv=
if/controller.c&quot; /&gt;<br>
<br>
<br>
</blockquote></div>
</blockquote></div>

--000000000000b7156d061e77e164--


From win-pv-devel-bounces@lists.xenproject.org Wed Jul 31 08:20:19 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 31 Jul 2024 08:20:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.768316.1179085 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sZ4ZE-00067v-LQ; Wed, 31 Jul 2024 08:20:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 768316.1179085; Wed, 31 Jul 2024 08:20:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1sZ4ZE-00067o-Ix; Wed, 31 Jul 2024 08:20:16 +0000
Received: by outflank-mailman (input) for mailman id 768316;
 Wed, 31 Jul 2024 08:20:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=wUPg=O7=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1sZ4ZD-00067i-TN
 for win-pv-devel@lists.xenproject.org; Wed, 31 Jul 2024 08:20:15 +0000
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com
 [2a00:1450:4864:20::232])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b65e0d96-4f15-11ef-bc01-fd08da9f4363;
 Wed, 31 Jul 2024 10:20:15 +0200 (CEST)
Received: by mail-lj1-x232.google.com with SMTP id
 38308e7fff4ca-2eeb1ba0481so86756031fa.2
 for <win-pv-devel@lists.xenproject.org>; Wed, 31 Jul 2024 01:20:14 -0700 (PDT)
Received: from [10.24.66.25] ([15.248.2.233]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4282bb232besm12031195e9.48.2024.07.31.01.20.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 31 Jul 2024 01:20:13 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b65e0d96-4f15-11ef-bc01-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722414014; x=1723018814; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:organization:content-language
         :references:cc:to:subject:reply-to:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=y+q366Sio+w1Z7K7O1wJwabVdyHXQgEVWTy1ukXLGuM=;
        b=NFvSl6IOlU9B63nf3O6fcAyT0zKpnXfLC8TnAcXUB2TQ/VaJUgqY8BZv5K+jhUNdg1
         Y1R1fssI3YrMkrFl1B7KWo5H/1MH7Muzw1330aDwcwwE5IcWtnWz4qMMCLGj4YWfTsdT
         XgW2ZByaZFQEhaONyDJLmcE4iF9YwJ0wruFDnzlhhpN+XhXApFVAr5qyBfu5Noug2MHx
         VOIeGb/qfCR6ksi0dqVwYArbh74e6+qC9Ui6NdxIli5HNdj8LfPbdkrDsQnoodOLa4ym
         e+SvI2l5SRFxtcq7pjHe0b1Gy7j8QMTPMf27zz2vjxXinD4yzFJhz+po6rLAcBrX4SQZ
         XMeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722414014; x=1723018814;
        h=content-transfer-encoding:in-reply-to:organization:content-language
         :references:cc:to:subject:reply-to:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=y+q366Sio+w1Z7K7O1wJwabVdyHXQgEVWTy1ukXLGuM=;
        b=Th/z3Y/IMGykN/5UcBolXp/2FzcccxPOxIoHdoZdVkplhzw7FbWt6HiBUxYKCg3HUi
         grAuF/8jq6YqV3UDfwQjLAjyGlw6GXn8vsr9UkYJxCiqjyFc5qLIyhI0wYYvyLTUO8DB
         8B651fKFRgzfKdwydE2DHRnQdiI7emx3d21EXcLqRyAPiTpm2QPCguOW+jeyIawOwEGo
         fMxQE+01aiItMUPhD06yn/Z07v+je8n239vJ55LjzPflclJwfcIC9++9zv7i1tZNobeY
         /OsNR25bEPEiPsFZqLYeUKpF23LBzrrddWltoJk3kBvyERhJ3QtPEalDm/nwfTbBidrn
         ARHA==
X-Gm-Message-State: AOJu0Yy/g6eJ7JVtkfbHs8DCANqDpctLl7qOXgO9ejov8K3JwIqyptJW
	3CacG6wCupITSEAF+XTHvJwSvqvCC+Ix7GiQHqV90Sa4Oi8vjZwj
X-Google-Smtp-Source: AGHT+IHjWpgugnQgdpfc05skGVS4j3aUxV13nIdwFhggJdQJtmS7v4rC+33XSn7tD41cBwVWZYr2Fg==
X-Received: by 2002:a2e:8911:0:b0:2ec:6639:120a with SMTP id 38308e7fff4ca-2f12ebcb021mr85482231fa.10.1722414013406;
        Wed, 31 Jul 2024 01:20:13 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <02d87272-ff6d-445d-b145-645d72b99813@xen.org>
Date: Wed, 31 Jul 2024 09:20:12 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Reply-To: paul@xen.org
Subject: Re: [XENVIF PATCH 2/3] Fix Registry Isolation issues with Server 2025
To: Owen Smith <owen.smith@citrix.com>
Cc: win-pv-devel@lists.xenproject.org
References: <20240709104500.1392-1-owen.smith@cloud.com>
 <20240709104500.1392-2-owen.smith@cloud.com>
 <c838bfdc-4abe-4f95-b114-0e6dfcb95a79@xen.org>
 <CAC_UY8-Nv65O_PdfL3THcZUJnmy1pNzG7mGZjcvwVjrS-Eccmw@mail.gmail.com>
 <CAC_UY8_z4C9rRD0gAByJvMz7zm+vhszKyYnft7qP2jparV_k9Q@mail.gmail.com>
Content-Language: en-US
Organization: Xen Project
In-Reply-To: <CAC_UY8_z4C9rRD0gAByJvMz7zm+vhszKyYnft7qP2jparV_k9Q@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 30/07/2024 15:34, Owen Smith wrote:
> I will update to attempt to copy settings, but make the settings copy 
> code and friendly name setting code non-fatal if any registry operation 
> fails, as when IoOpenDriverRegistryKey is used, it seems the Settings 
> key can only be opened read only, and any access to the tcpip, tcpip6 
> and netbt is not allowed (due to absolute paths).
> 

I wonder whether, since we can no longer have a co-installer, we could 
install a user-space agent to copy the settings when prodded by the driver?

   Paul



