From win-pv-devel-bounces@lists.xenproject.org Thu Aug 03 17:15:24 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 03 Aug 2023 17:15:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.576525.902762 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qRbuz-0002Ww-Sr; Thu, 03 Aug 2023 17:15:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 576525.902762; Thu, 03 Aug 2023 17:15:21 +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 1qRbuz-0002Wo-Pv; Thu, 03 Aug 2023 17:15:21 +0000
Received: by outflank-mailman (input) for mailman id 576525;
 Thu, 03 Aug 2023 17:15:20 +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=aUGS=DU=hldns.com=steffan@srs-se1.protection.inumbo.net>)
 id 1qRbuy-0002Wi-M8
 for win-pv-devel@lists.xenproject.org; Thu, 03 Aug 2023 17:15:20 +0000
Received: from mail.hldns.com (mail.hldns.com [199.249.188.77])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4f7c6e4a-3221-11ee-8613-37d641c3527e;
 Thu, 03 Aug 2023 19:15:16 +0200 (CEST)
Received: from [192.168.0.61] (71-209-235-40.phnx.qwest.net [71.209.235.40])
 by mail.hldns.com (Postfix) with ESMTPSA id 57ED9743A7;
 Thu,  3 Aug 2023 10:15:13 -0700 (MST)
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: 4f7c6e4a-3221-11ee-8613-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.hldns.com 57ED9743A7
User-Agent: Microsoft-MacOutlook/16.76.23070301
Date: Thu, 03 Aug 2023 10:15:11 -0700
Subject: Re: [win-pv-devel] v9.0.0 released
From: Steffan Cline <steffan@hldns.com>
To: "win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
CC: "Durrant, Paul" <pdurrant@amazon.co.uk>
Message-ID: <E6BE3E86-3521-4DAC-8852-B15B424EEA8C@hldns.com>
Thread-Topic: [win-pv-devel] v9.0.0 released
References: <127D8E68-6DE1-4A07-86FA-DACBAA848D64@hldns.com>
 <8538447a-b865-d439-04d1-70e8d9e127bc@alstadheim.priv.no>
 <994FF307-1541-4643-8607-657EDFEE297A@hldns.com>
 <6585eecaeb534b5eaabda44d5a841605@EX13D32EUC003.ant.amazon.com>
 <8D8CA5D8-6BBE-4F57-8533-1529963047E4@hldns.com>
 <7b627e49565d4135bf07adef10cee596@EX13D32EUC003.ant.amazon.com>
 <A8AEB35D-D92D-4A57-BD31-7FEA885EE89F@hldns.com>
In-Reply-To: <A8AEB35D-D92D-4A57-BD31-7FEA885EE89F@hldns.com>
Mime-version: 1.0
Content-type: text/plain;
	charset="UTF-8"
Content-transfer-encoding: quoted-printable

Well, as you can see it's been a few years since I replied to this email bu=
t I'm curious.=20

Below is a sample configuration I based on what Paul recommended years ago =
and still works today with Xen 4.17 and qemu 7.2.0+h1-2

What I am curious of is, what options am I not using below that would bette=
r work with the most recent Xen drivers for Windows Server 2019+?

memory =3D 32768
maxmem =3D 32768
vcpus =3D 8
name =3D 'ec-win2016server'
vif =3D ['ip=3Dx.x.x.x,mac=3D00:16:3e:D5:07:xx,type=3Dioemu,model=3De1000,bridge=3Dxenb=
r0','ip=3Dx.x.x.x,mac=3D00:16:3e:77:E9:xx,type=3Dioemu,model=3De1000,bridge=3Dxenbr1']
address =3D x.x.x.x'
netmask =3D '255.255.255.0'
disk =3D ['phy:/dev/myvg/win2016server_img,hda,w','phy:/dev/myvg/win2016serve=
r_2_img,hdb,w']
boot =3D 'dc'
on_reboot =3D 'restart'
on_crash =3D 'restart'
builder =3D "hvm"
viridian =3D [ 'base', 'freq', 'time_ref_count', 'reference_tsc', 'hcall_remo=
te_tlb_flush', 'apic_assist' ]=20
mmio_hole =3D 2048
vga=3D"stdvga"
#stdvga=3D1 #test for higher resolution
#extra=3D"vga=3D791"  #test for higher resolution
videoram=3D16
pae=3D1
nx=3D1
xen_platform_pci=3D1
usb=3D1
usbdevice=3D['tablet']
device_model_args=3D[ "-trace", "events=3D/root/events" ]
acpi=3D1
acpi_s3=3D0
acpi_s4=3D0
acpi_laptop_slate=3D1
vnc =3D 1
vnclisten =3D "0.0.0.0"
vncunused =3D 1
vncpasswd =3D "xxxxxx"


Thank you,=20
Steffan Cline=20
steffan@hldns.com <mailto:steffan@hldns.com>=20
602-793-0014=20




=EF=BB=BFOn 3/2/20, 8:12 AM, "win-pv-devel on behalf of Steffan Cline" <win-pv-de=
vel-bounces@lists.xenproject.org <mailto:win-pv-devel-bounces@lists.xenproje=
ct.org> on behalf of steffan@hldns.com <mailto:steffan@hldns.com>> wrote:


Paul,


These are the packages that were installed by my current admin app, Cloudmi=
n.


# rpm -qa | grep xen
xen-libs-4.8.5.86.g8db85532cb-1.el7.x86_64
centos-release-xen-common-8-7.el7.centos.x86_64
centos-release-xen-8-7.el7.centos.x86_64
xen-licenses-4.8.5.86.g8db85532cb-1.el7.x86_64
xen-hypervisor-4.8.5.86.g8db85532cb-1.el7.x86_64
xen-4.8.5.86.g8db85532cb-1.el7.x86_64
xen-ovmf-20160905-1.gitbc54e50e0.el7.x86_64
xen-runtime-4.8.5.86.g8db85532cb-1.el7.x86_64






Thank you,
Steffan Cline
steffan@hldns.com <mailto:steffan@hldns.com>
602-793-0014=20




=EF=BB=BFOn 3/2/20, 1:40 AM, "Durrant, Paul" <pdurrant@amazon.co.uk <mailto:pdurr=
ant@amazon.co.uk>> wrote:


> -----Original Message-----
> From: Steffan Cline <steffan@hldns.com <mailto:steffan@hldns.com>>
> Sent: 02 March 2020 07:50
> To: Durrant, Paul <pdurrant@amazon.co.uk <mailto:pdurrant@amazon.co.uk>>;=
 win-pv-
> devel@lists.xenproject.org <mailto:devel@lists.xenproject.org>
> Subject: Re: [win-pv-devel] v9.0.0 released
>=20
> It's been a while since I replied on this since I've had lots of testing
> going on.
>=20
> I just ran these tests on a new install of Win Server 2019 fully updated
> with all of the 9.0.0 drivers.
>=20
> My config is this:
> memory =3D 16384
> maxmem =3D 16384
> vcpus =3D 4
> name =3D 'ec-win2019-1'
> vif =3D [
> 'ip=3Dx.x.x.x,mac=3D00:16:3e:CD:0B:01,type=3Dioemu,model=3De1000,bridge=3Dxenbr0' ]
> address =3D 'x.x.x.x'
> netmask =3D '255.255.255.0'
> disk =3D ['phy:/dev/vg_san/ec-win2019-
> 1_img,hda,w','file:/root/en_windows_server_2019_x64_dvd_4cb967d8.iso,hdc:=
c
> drom,r']
> boot =3D 'dc'
> on_reboot =3D 'restart'
> on_crash =3D 'restart'
> vnc =3D 1
> vnclisten =3D "0.0.0.0"
> vncunused =3D 1
> vncpasswd =3D "kldwslex"
> builder =3D "hvm"
> viridian =3D [ 'base', 'freq', 'time_ref_count', 'reference_tsc',
> 'hcall_remote_tlb_flush', 'apic_assist' ]
> mmio_hole =3D 2048
> vga=3D"stdvga"
> videoram=3D16
> pae=3D1
> nx=3D1
> xen_platform_pci=3D1
> usb=3D1
> usbdevice=3D['tablet']
> device_model_args=3D[ "-trace", "events=3D/root/events" ]
> acpi=3D1
> acpi_s3=3D0
> acpi_s4=3D0
> acpi_laptop_slate=3D1
>=20
>=20
> The VM is running on a Dell R620 2x10core 3ghz w/384gb. The drive is
> actually over an 8gb FC to a R720 with SCST running as a SAN w/ Raid-6 an=
d
> 12x3tb drives.
>=20
> Since this works so well, I'm guessing the previous issues reported may
> have been due to the config I had since merging your sample config with
> what I had seems to work fine. That same VM I originally tested with now
> has the 8.2.2 drivers back on it but with the latest Xen kernel I have, i=
t
> just power cycles over and over. I had to move it to another server
> running an older kernel. I'll have to figure that out.
>=20
> I did some disk i/o tests and am curious if the attached results look
> appropriate for the environment or if there's some tuning I'm missing.
>=20
> Any suggestions are appreciated.
>=20


I don't think there's anything particular that you're missing but that 4k r=
ead number looks abnormally low compared to the other numbers, which I guess=
 is due to the 8.3ms acc time. What version of Xen are you running on BTW?


Paul








_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org <mailto:win-pv-devel@lists.xenproject.org=
>
https://lists.xenproject.org/mailman/listinfo/win-pv-devel <https://lists.x=
enproject.org/mailman/listinfo/win-pv-devel>




From win-pv-devel-bounces@lists.xenproject.org Tue Aug 08 20:41:05 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 08 Aug 2023 20:41:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.580425.908624 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qTTVm-0006is-JW; Tue, 08 Aug 2023 20:41:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 580425.908624; Tue, 08 Aug 2023 20:41: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 1qTTVm-0006ik-GJ; Tue, 08 Aug 2023 20:41:02 +0000
Received: by outflank-mailman (input) for mailman id 580425;
 Tue, 08 Aug 2023 20:41:01 +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=DfQR=DZ=aim.com=brchuckz@srs-se1.protection.inumbo.net>)
 id 1qTTVk-0006iL-Sb
 for win-pv-devel@lists.xenproject.org; Tue, 08 Aug 2023 20:41:01 +0000
Received: from sonic315-55.consmr.mail.gq1.yahoo.com
 (sonic315-55.consmr.mail.gq1.yahoo.com [98.137.65.31])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id de021536-362b-11ee-8613-37d641c3527e;
 Tue, 08 Aug 2023 22:40:56 +0200 (CEST)
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic315.consmr.mail.gq1.yahoo.com with HTTP; Tue, 8 Aug 2023 20:40:52 +0000
Received: by hermes--production-bf1-865889d799-g7m4g (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID 2e98d5c09d78ed4603062860c2e780cc; 
 Tue, 08 Aug 2023 20:40:46 +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: de021536-362b-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netscape.net; s=a2048; t=1691527252; bh=mfUjKzD+9O+6c8+H/MB4LYcEd1yCm+Zd52ZEITpitJ0=; h=Date:To:From:Subject:References:From:Subject:Reply-To; b=GMzQ+Hww+HL43bkGxNtAdX2kXaDdiTe6Y58XHa8e8Xz+KSoSoREGhn7D9ioD1vsZEESh9ykZGQfL36o73+b+vZR3/6rBrrHivnjXSxDhtOhIgxmMVJJv5Tgybx3igK9vdtTPYB99cnFHCXSToJo1Ebe9oIXtxcnnI2tkW/qV9nNn0LjcwX7soWxWntluR8eUBIP1Q4AjEqdEhHvRxAqwbfSCzbYzBMaqLhytH8I5Jj2j1O2wImvzPOjUoDRXKRztdabOZ3r85pu6ExWQqScD22N0WHsHWzoEu8NDWZsd7/BnowJcLRr7N6W+RuBd3iBSmtL13hz2MVo0/4xI3PprtA==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1691527252; bh=p5QUm7fhZfpe4VCHCCKSpxoDcwM98B7o+2AJn281xSi=; h=X-Sonic-MF:Date:To:From:Subject:From:Subject; b=BML5P0V46Qxjifu/jI6R53O6L6IafLgRNDQuCOXc/12YNV/Reb4QzgkncmyV1ZJ9nMQME19B3Ta+ffEXy8NDpqT7tbw6AK2Vz46ndAM/RpTn+NMrBQNcUx/nMKc/Qku9prveW/wyhlCQnygkwpdnudDfX5KFiz5zI112Pmpo/L96qRyC4XG8JA1qHtzb2/3zwOK6OQixoFqvs4ivuCGibSFLegTePqdzGJmq36ldO1W0GMUj3g/9WHO559jXhCuSks+KF/UADNym9lcXuglKgoW7ccVlCXn16yq20ZG7ihZImj0MHZ77/qv5x2N830LyYtKYON5WnlwFa4EKUQHooA==
X-YMail-OSG: xpiXCGsVM1lDvUyOFo4XZi7zHi6JXGdKpI.hpA62mm8FPyLLTrR7MTAswWQ42Ca
 ZRISLYysSqlzF2e2VUSDrLboKsEljI.2rmPq6uv9eksL..4Xck3q4uDQTWn_brqYOX_zJ1j9dVlM
 Q7bQ_7W5zO2paPsQ0T5ja7JSa6K16P.FiZWiM_AmS1ZQhJWlK7SyyRv8LmVTXWCRHq1yMMYpdNj1
 Hjt1rHryRGqcOJ7FXsAaLVdxEsrTvT05IlO52SRfmm9Y56pwPnpYHeoX9EAU6zrklI2.KvGJAnf5
 Xj6yAve0BnRNCORWfVEDV64_HIlgxyKqFsZmr.gTNj1JED3jrgDFFMp8AfR1uvtaCPdfaPM3vta8
 EDTbvG98tX25WdjB7LMF2wKlnEVgXRPIoN8ZxbuauNYCDoSgGmTBdzuFe5iaT8Aq99FhdJ5e0uit
 KxlxozZIpqiYM3o.rUfXVs0UF0szzP0AUYDpJyx9Ph7.N25VvkBEovIgTI3_rWNMPZONl3qaOcyU
 OdPfPuRfvHVrU3I9_WdHukTDotvEahEy7thnKFJKs_1G2WcWMebR_U43NqZjjm88WsZ_VSf5btf3
 nbpbYrs_gugU5zbifdf2or2rTRZnioYOl70pbXbKOmGbBLf1NG2QQRPNIPrn5gpAbSy6hkHOB03I
 e9T85CIRNJ47CkvbXYzGaO.7hiJVwg2vBgexsq5JccOik8RqW6IKlgEsTDnRrsmPidqApBHSp0t8
 MqAJSnxXU77kKNSzoMdxjAl7r3o52YzjDFx660H80H3hXEAA4CIMRbA7K6AYlSJk8rFf5Vppy460
 YKAL3sspxmLvIbmppYTfgywxi5Hrkj7oJj_awCyDQ07zX87kQ9y17RpCv6nteay.Jc3oHDrCteaK
 UUukwEe.EftEkVDvGfBD9augAgN9YKCdDqdQIIRrO7566Jr7nB4Q_30e0u1E7sH9jZxXLizhV1Vc
 wM4rMiJv6K6907vOX2LyNoZLNtclNP3iq3NMx4Lw8vsiaoebll.W6yZ7d592yU4FlQSJgvHippdQ
 JNB9ErFIcGDpggnxkekmTfGCWzf0FcsLjRum44ysfpfoBO90p7i5LLBYd6Oq.At_HOIE3ygh43wG
 8R_vDh4eHQdl79dYPeldNp9xDWkRujEDBnUEPqxHohFdRASHs0Sp5tzs5vhlfJo79UEpjpvsg_Dr
 GboZCmcjs9w8Qx.USXQcfXIXGNil1c1BNDI31pAmhv5iIuVMPY.Qv21sv7jrlvO1YJFZc9rj8zUx
 okggLWEHN2trEUcmuYvx5MMBdDmZ78X0jyOfqJAY3vRgnY99MYNmm_q0elzGPZ.fbdrMtyIoqWTt
 IojSAKikZ_1y66C7JM116zc2nwRS532gSgE_2gvwQfEw4A1rrbbCLuPotOydVfkoy_gD5nZ6Nxqj
 nQ47EGL5Yl278ilt.FAipyVTJGDqPOZtb8Ue5B_XKvY1YICTr5rnAy6aQGfPRJHy8fe6dJEnNos7
 W4PBnLhCGa0YnuWxGa0xz8cRV9bZIiuoI5NdIMvDEcpEC7umRLA5RMx4OXhxffgYQYY79AiKEZxm
 tkhYIip09_5P03CwBtTh1rW.zwR1khyRw3On30SVF9QQv0Wajq1IOwAs_Z1nPxd0Zu.1wAY9on3E
 56Xv_SWJ9ydUyX2Blm_ell41Pj4CV79DhTH109d_hYOD06R93Sx1Ep0YjApjT4RDKwOtiYwu6WxO
 vzOSss1nqEnk0jih4SYf0rI957Wendx735WjbQTxso3MpJEYN__islfFtz4x1XxnUxlpOcH.uQbF
 LXU77nBu_43LffzUNhZxnW_OeLKQmMFoSXHKsKdhpWKIpY7xXlKmnDYT_8mHR2qtHjRgAZICOj2O
 gt6AMdFVeS5CiALsmmeib63ig2yVUz4TZp7PR8tH1qOkRhCCor_On.Lo2urdU96Tka9QFc1FzGcT
 pyfLgBI_f4zwnmyMiX29x6xzRH.3k7rc.f7UMlWolQS3nZkLH7VmckBn8dLavSemFyagPZhRO0dD
 5p8qRNNmuS2eAJsTbWUWayMQHJKii4PwUFymWPDa6woWNOy0vAx17DKir_Mui.wIDbcr.kyEpYHM
 GqJHe_aYG3wqJk2GLKDw7FpRn_u4rJNTvH4FMmF5b5SrU4gX2JFkth08P4rnYSEdMEjZWgbXB90r
 7Uha0WWly8j4ravO9S_0qqAGkAMjV_EGPb0mk15eUEN_qZXGgjuhJIlTDin89NRQSxM6PHcP85oP
 Cbw--
X-Sonic-MF: <brchuckz@aim.com>
X-Sonic-ID: 4aea3617-a708-4b1d-a33a-8bf3ee6c197e
Message-ID: <654b220f-5898-2a87-2387-8dcd2a89b63c@netscape.net>
Date: Tue, 8 Aug 2023 16:40:46 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.14.0
Content-Language: en-US
To: win-pv-devel@lists.xenproject.org
From: Chuck Zmudzinski <brchuckz@netscape.net>
Subject: Re: Win11 22H2 and CoInstallers
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
References: <654b220f-5898-2a87-2387-8dcd2a89b63c.ref@netscape.net>
X-Mailer: WebService/1.1.21695 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol
Content-Length: 1685

On 28/06/2023 15:33, Owen Smith wrote:
> Looks like the HLK tests for Win11 22H2 fail if you specify a coinstaller.
> I've not dug through the full implications of this yet, but looks like the
> coinstallers will need removing going forwards.

Hello,

I am glad to see there is an effort to get these drivers compatible
with Windows 11!

Here is a message in a long thread seven years old that explains what
happened to coinstallers:

https://community.osr.com/discussion/comment/276218/#Comment_276218

Quoting from that message:

> 1.11 was the last version that used a coinstaller and went down level. Every
> version afterward is only available on the os that released that version.

Since there are still coinstallers in use in the PV drivers, the PV drivers
must be using a version <= 1.11. After reading the thread linked to above,
it appears the implications are that if the Windows PV drivers can be
written for KMDF 1.11 (Windows 8) then the implication is that going forward,
the earliest version that can be supported going forward is Windows 8 without
a coinstaller. If the PV drivers are compatible with an even earlier version,
then the earliest version that can be supported would be whatever that
earlier version is. This means that it is likely it will be more difficult
to support older and no longer supported versions of Windows and Windows 11
with the same version of the drivers.

Of course, unless I am mistaken, in addition to removing coinstallers, it will
also be necessary to write a xentpm driver so Windows 11 can access the PV TPM
device, and upgrade the TPM device to version 2.0 if that is not done yet.

Thanks for your work on these drivers,

Chuck


From win-pv-devel-bounces@lists.xenproject.org Mon Aug 14 12:41:06 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 14 Aug 2023 12:41:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.583606.913856 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qVWsZ-0002N8-JG; Mon, 14 Aug 2023 12:41:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 583606.913856; Mon, 14 Aug 2023 12:41:03 +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 1qVWsZ-0002N1-Gc; Mon, 14 Aug 2023 12:41:03 +0000
Received: by outflank-mailman (input) for mailman id 583606;
 Mon, 14 Aug 2023 12:41:02 +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=6JnP=D7=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1qVWsY-0002Mu-0y
 for win-pv-devel@lists.xenproject.org; Mon, 14 Aug 2023 12:41:02 +0000
Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com
 [2a00:1450:4864:20::334])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d21c0466-3a9f-11ee-b289-6b7b168915f2;
 Mon, 14 Aug 2023 14:41:01 +0200 (CEST)
Received: by mail-wm1-x334.google.com with SMTP id
 5b1f17b1804b1-3fe2048c910so39177365e9.1
 for <win-pv-devel@lists.xenproject.org>; Mon, 14 Aug 2023 05:40:59 -0700 (PDT)
Received: from [192.168.17.102] (54-240-197-234.amazon.com. [54.240.197.234])
 by smtp.gmail.com with ESMTPSA id
 14-20020a05600c22ce00b003fba2734f1esm17284026wmg.1.2023.08.14.05.40.58
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 14 Aug 2023 05:40: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: d21c0466-3a9f-11ee-b289-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1692016859; x=1692621659;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :references:to:content-language:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=gX24RlttizX0c5X80bX8jGZzyYDmAOGe9rV8exI8zb8=;
        b=MbT0z6fjxTghZwdmrw26rgZwYHQV/HidQ860LbpZEiBk/asj8xd1nkc/EJkHGKqS90
         HYjoYeKNqRC9PzLCumlCGYM58vfJ7O9aOyQgZii+Aepn82Ztoo85MxBGEIfCDIqO/VER
         rVuzmDjeHi2msgeiQHC3W8JYOSfcdppMu+ILLI26R8cFTdLUkB8eutV+XqRs9BZH8X8y
         /fy6f6PIf8s8t/WRhj4OAuBm85e8GGzr/3FgHVSc/rxDQ3ImlzXXkV5DTY0FB2iRotCT
         d87aXJqGA6ZoMZ7OArP9xmJwirmq7PK92KMNvP7a9lD4IiW9atY/2bXSiOtqFk3Sl7Hp
         QTsA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1692016859; x=1692621659;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :references:to:content-language:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=gX24RlttizX0c5X80bX8jGZzyYDmAOGe9rV8exI8zb8=;
        b=hpT9F5XCd7PiLyN+BNBhbzUw8dZqFQqaAB327ZsIULPno/VGQmDd2dtsSzTL5G8kNz
         PI2uj/pPOFlnTY9C3PLHiHBIH6DjkjvtRQx4qxlX4sROv0At/QfikAcP8npvstbgvSrp
         1k9AmXPGr2bJ+NzBwgglheLoRDHCuwZqy9l5QMcUsbccHDsDgsHxW0Jtkqr5ydfOB2G9
         lscvsXkpqiRONgHUx+TLlvdfRU5RAI8CxvEpRszpuuC3iGNyKH/VSwLRRybpVWmvAVFQ
         5i+44DerBEtHSiYbYTpPWYPRvm55y2G7uC+YyZwDowN4naIGsOI81f6N4oMvEYAuo15j
         bvWQ==
X-Gm-Message-State: AOJu0Yw6lmJ1p4140tgzLOj0WeZPeHyDbVGhKb+Sqg8ExM9t+izOPpB7
	WbiHsZMwQnu3icdESPV4z3QlDjwaF1lL7Dpw
X-Google-Smtp-Source: AGHT+IFORoSdNqxaJrHxrbuAKljfQiY02p5Uad4ter+SsX9vbBu5OyvAbayjUxzY4P8VV4rDo8Jvfw==
X-Received: by 2002:a7b:c3cd:0:b0:3fb:d68d:4c6f with SMTP id t13-20020a7bc3cd000000b003fbd68d4c6fmr7131052wmj.14.1692016858865;
        Mon, 14 Aug 2023 05:40:58 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <a2c20869-c5f6-9aa5-2115-9e5d3c4ffd82@xen.org>
Date: Mon, 14 Aug 2023 13:40:57 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [win-pv-devel] v9.0.0 released
Content-Language: en-US
To: win-pv-devel@lists.xenproject.org
References: <127D8E68-6DE1-4A07-86FA-DACBAA848D64@hldns.com>
 <8538447a-b865-d439-04d1-70e8d9e127bc@alstadheim.priv.no>
 <994FF307-1541-4643-8607-657EDFEE297A@hldns.com>
 <6585eecaeb534b5eaabda44d5a841605@EX13D32EUC003.ant.amazon.com>
 <8D8CA5D8-6BBE-4F57-8533-1529963047E4@hldns.com>
 <7b627e49565d4135bf07adef10cee596@EX13D32EUC003.ant.amazon.com>
 <A8AEB35D-D92D-4A57-BD31-7FEA885EE89F@hldns.com>
 <E6BE3E86-3521-4DAC-8852-B15B424EEA8C@hldns.com>
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <E6BE3E86-3521-4DAC-8852-B15B424EEA8C@hldns.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 03/08/2023 18:15, Steffan Cline wrote:
> Well, as you can see it's been a few years since I replied to this email but I'm curious.
> 
> Below is a sample configuration I based on what Paul recommended years ago and still works today with Xen 4.17 and qemu 7.2.0+h1-2
> 
> What I am curious of is, what options am I not using below that would better work with the most recent Xen drivers for Windows Server 2019+?
> 
> memory = 32768
> maxmem = 32768
> vcpus = 8
> name = 'ec-win2016server'
> vif = ['ip=x.x.x.x,mac=00:16:3e:D5:07:xx,type=ioemu,model=e1000,bridge=xenbr0','ip=x.x.x.x,mac=00:16:3e:77:E9:xx,type=ioemu,model=e1000,bridge=xenbr1']
> address = x.x.x.x'
> netmask = '255.255.255.0'
> disk = ['phy:/dev/myvg/win2016server_img,hda,w','phy:/dev/myvg/win2016server_2_img,hdb,w']
> boot = 'dc'
> on_reboot = 'restart'
> on_crash = 'restart'
> builder = "hvm"
> viridian = [ 'base', 'freq', 'time_ref_count', 'reference_tsc', 'hcall_remote_tlb_flush', 'apic_assist' ]

If you want to keep up to date with Hyper-V enlightenments in Xen (like 
SYNIC, STIMER, etc.) then you can set...

viridian = [ 'all' ]

Nothing in your xl.cfg should have much bearing on newer PV drivers though.

   Paul

> mmio_hole = 2048
> vga="stdvga"
> #stdvga=1 #test for higher resolution
> #extra="vga=791"  #test for higher resolution
> videoram=16
> pae=1
> nx=1
> xen_platform_pci=1
> usb=1
> usbdevice=['tablet']
> device_model_args=[ "-trace", "events=/root/events" ]
> acpi=1
> acpi_s3=0
> acpi_s4=0
> acpi_laptop_slate=1
> vnc = 1
> vnclisten = "0.0.0.0"
> vncunused = 1
> vncpasswd = "xxxxxx"
> 
> 



From win-pv-devel-bounces@lists.xenproject.org Mon Aug 14 12:44:36 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 14 Aug 2023 12:44:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.583619.913870 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qVWw0-000314-3U; Mon, 14 Aug 2023 12:44:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 583619.913870; Mon, 14 Aug 2023 12:44:36 +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 1qVWw0-00030x-0v; Mon, 14 Aug 2023 12:44:36 +0000
Received: by outflank-mailman (input) for mailman id 583619;
 Mon, 14 Aug 2023 12:44:35 +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=6JnP=D7=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1qVWvz-00030p-Fd
 for win-pv-devel@lists.xenproject.org; Mon, 14 Aug 2023 12:44:35 +0000
Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com
 [2a00:1450:4864:20::32e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 52415fcb-3aa0-11ee-b289-6b7b168915f2;
 Mon, 14 Aug 2023 14:44:34 +0200 (CEST)
Received: by mail-wm1-x32e.google.com with SMTP id
 5b1f17b1804b1-3fe1e1142caso42320655e9.0
 for <win-pv-devel@lists.xenproject.org>; Mon, 14 Aug 2023 05:44:34 -0700 (PDT)
Received: from [192.168.17.102] (54-240-197-234.amazon.com. [54.240.197.234])
 by smtp.gmail.com with ESMTPSA id
 i11-20020a05600c290b00b003fba6709c68sm14076824wmd.47.2023.08.14.05.44.33
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 14 Aug 2023 05:44: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: 52415fcb-3aa0-11ee-b289-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1692017074; x=1692621874;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :references:to:content-language:subject:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=zG+3joR95ViACzVUKdyZOajBJnpLZU0tj6T2vQRMkjM=;
        b=Y9u+y0FhlNbTXocbsso91VMzZN+nMknHHEoTftiL6AjS9rIACnohXgI/wy7YrGbu+A
         8n+//FiMwmeKbS4kmau5LBHHAWRJnFRs3PE8M5rcy7R1yYYlZjT61cMGqTwPuqTt5jQz
         ukLxDOvRJldWvIB4kGsD5QoyzuUYOCzMnebbzGtIOFbDnHg+Nuf99hdFPt6Kk6WINl7P
         ce6sXGCAIRtEgwdauL5AbcQ3lGsHiBNwWwsxTn55EQ/DanxfDfXoPWz9acl62PO3KfXw
         Xy0z0cQnH1djmS6Y36BbQfshQkffzxEbif4sHP6wLuDosp0d0QyFvkvCzpjmdB4/6c2W
         i6cQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1692017074; x=1692621874;
        h=content-transfer-encoding:in-reply-to:organization:reply-to
         :references:to:content-language:subject:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=zG+3joR95ViACzVUKdyZOajBJnpLZU0tj6T2vQRMkjM=;
        b=bz/m9IyfTwhnyBWXxHf8nfiFoMboeIHcnPpecQzpkPuHpWhYTY9KSzO29QCHxyj0dJ
         7wjKpuxHOETBZ4KoyC1+0Abz/6RgXeDmg4vdBNco1PxfC+6o68Vp7u9MKXIOMwUUkyFw
         yB4tcbeIApm736MVZSFhLHEYfDufB/GuKEy0nALBgJrhRmmNMYns1nIEoN6Fb1GGbri2
         ntJl8Z9ohBxsl17I9D9Lck4O48Vj50bEUt2PKBuMUwGX18WP3jKsO7emnx9Pubxzpveq
         qWC6GzTGZ6Z49ly8JTaUrYUSsgQ9eXuDsCkvssJRi6+UpjB07RLvtmNqSO/ksgui9EJb
         EHHw==
X-Gm-Message-State: AOJu0YyQtOj9p8/sHmqKmp+D0lUmM1I7Ua1IO1KMC3HTwnBqL/CG9okw
	gr7egUBH50rLrupzc0d39E2s7R6RUgry2A8z
X-Google-Smtp-Source: AGHT+IEaSipXRY3Hl+W3HgexWf2voOhpa0q6uEm3nMJGL3ofrXB4f/DFWRYzRWucxP0slEjkabrIvA==
X-Received: by 2002:a05:600c:2295:b0:3fe:16c0:6b44 with SMTP id 21-20020a05600c229500b003fe16c06b44mr7242708wmf.12.1692017073924;
        Mon, 14 Aug 2023 05:44:33 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <3ea7bb07-b8d8-1daf-48ea-7618c37a3fa2@xen.org>
Date: Mon, 14 Aug 2023 13:44:32 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: Win11 22H2 and CoInstallers
Content-Language: en-US
To: win-pv-devel@lists.xenproject.org
References: <654b220f-5898-2a87-2387-8dcd2a89b63c.ref@netscape.net>
 <654b220f-5898-2a87-2387-8dcd2a89b63c@netscape.net>
Reply-To: paul@xen.org
Organization: Xen Project
In-Reply-To: <654b220f-5898-2a87-2387-8dcd2a89b63c@netscape.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 08/08/2023 21:40, Chuck Zmudzinski wrote:
> On 28/06/2023 15:33, Owen Smith wrote:
>> Looks like the HLK tests for Win11 22H2 fail if you specify a coinstaller.
>> I've not dug through the full implications of this yet, but looks like the
>> coinstallers will need removing going forwards.
> 
> Hello,
> 
> I am glad to see there is an effort to get these drivers compatible
> with Windows 11!
> 
> Here is a message in a long thread seven years old that explains what
> happened to coinstallers:
> 
> https://community.osr.com/discussion/comment/276218/#Comment_276218
> 
> Quoting from that message:
> 
>> 1.11 was the last version that used a coinstaller and went down level. Every
>> version afterward is only available on the os that released that version.
> 
> Since there are still coinstallers in use in the PV drivers, the PV drivers
> must be using a version <= 1.11. After reading the thread linked to above,
> it appears the implications are that if the Windows PV drivers can be
> written for KMDF 1.11 (Windows 8) then the implication is that going forward,
> the earliest version that can be supported going forward is Windows 8 without
> a coinstaller.

The PV drivers are WDM. They make no use of KMDF.

> If the PV drivers are compatible with an even earlier version,
> then the earliest version that can be supported would be whatever that
> earlier version is. This means that it is likely it will be more difficult
> to support older and no longer supported versions of Windows and Windows 11
> with the same version of the drivers.
> 
> Of course, unless I am mistaken, in addition to removing coinstallers, it will
> also be necessary to write a xentpm driver so Windows 11 can access the PV TPM
> device, and upgrade the TPM device to version 2.0 if that is not done yet.

If the TPM is emulated there should be no need to write a PV driver :-)

   Paul




From win-pv-devel-bounces@lists.xenproject.org Tue Aug 22 11:29:10 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 22 Aug 2023 11:29:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.588416.919933 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qYPZM-0003nr-0m; Tue, 22 Aug 2023 11:29:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 588416.919933; Tue, 22 Aug 2023 11:29:07 +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 1qYPZL-0003nk-UJ; Tue, 22 Aug 2023 11:29:07 +0000
Received: by outflank-mailman (input) for mailman id 588416;
 Tue, 22 Aug 2023 11:29:06 +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=c1aY=EH=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qYPZK-0003nZ-Tc
 for win-pv-devel@lists.xenproject.org; Tue, 22 Aug 2023 11:29:06 +0000
Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com
 [2a00:1450:4864:20::329])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 18d4e400-40df-11ee-8782-cb3800f73035;
 Tue, 22 Aug 2023 13:29:05 +0200 (CEST)
Received: by mail-wm1-x329.google.com with SMTP id
 5b1f17b1804b1-3fee843b44cso25740595e9.1
 for <win-pv-devel@lists.xenproject.org>; Tue, 22 Aug 2023 04:29:03 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 m7-20020a5d6247000000b003195504c754sm15577877wrv.31.2023.08.22.04.29.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 22 Aug 2023 04:29: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: 18d4e400-40df-11ee-8782-cb3800f73035
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1692703742; x=1693308542;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=YfgaWAb9fQhChZqodnLDp2G85GhySe00x1DEXXCsejc=;
        b=JSUbfgdW1fnwCgmYpkSommopT6n0RawLlU3f6JJ8OfYUoWjlt+NdJUQOdNY7MpYajv
         P5XS5FyirOG46i9MU30Dcc0I0wtloA9Ndy1C8kjGi2+NR4m5dUOSAwcY59vprvZq6avE
         8+AVhylY/SArzEh56P+NmOiUI+r9TFNcTEeQw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1692703742; x=1693308542;
        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=YfgaWAb9fQhChZqodnLDp2G85GhySe00x1DEXXCsejc=;
        b=BH4zNIsfd+G0kH0EBVIBDU2BvwP7JVfq9MTT5Y6/mITASEhImcjRaygDtQ1A2e18Ns
         Cjhb554TeSAncrWhotRPElVnIjIeUPupARsOnfV6ovkNWWEV+OyR/2aeuGcz0behKWHY
         6CUQf3TYBMlNR3AHN/CIDL2y9A4oBNvJLw8UkZsd1hkTNWJVa90dNIdoxN2483YF0Eza
         orZs1HRkAaJuhWmphl/tCTcACLIOIvW+mBmO/+Kdqww3qe6PJGfRaaxEjrJdyhQb6wCQ
         Hgdjy78biv9uIlQrH1K7mkiG9pOQp6vWWQwjk9ULtGaa3zoTVexTxVhUE36NSQ0Z1JHB
         ixNg==
X-Gm-Message-State: AOJu0YxNDdvr1bBQD1UVQ1ybvjOs2VghbA372JxtiW8cg1t32H76iUSe
	0F1obWXhMxdhcQXah8egF23d7RJpb+dOP6TCWiCX
X-Google-Smtp-Source: AGHT+IESv42bMioANPCUwTTG1bWyzoEkE3clB6sqgt+tSCmKkQmWhaao065A+U6H4X6+0iUHLY2yQA==
X-Received: by 2002:adf:ec44:0:b0:314:3e77:f210 with SMTP id w4-20020adfec44000000b003143e77f210mr7541307wrn.59.1692703742521;
        Tue, 22 Aug 2023 04:29:02 -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] Avoid dereferencing NULL cache objects.
Date: Tue, 22 Aug 2023 12:28:45 +0100
Message-ID: <20230822112845.1682-1-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

XENBUS_CACHE(Get, ...) can fail in low memory conditions. Avoid dereferencing
NULL pointers in ASSERTs
Fix up error path to avoid returning a NULL pointer to the cache.

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

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 4807582..0ce5b67 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -266,6 +266,8 @@ __ReceiverRingGetPacket(
                           &Receiver->CacheInterface,
                           Ring->PacketCache,
                           Locked);
+    if (Packet == NULL)
+        return NULL;
 
     ASSERT(IsZeroMemory(&Packet->Info, sizeof (XENVIF_PACKET_INFO)));
     ASSERT3P(Packet->Ring, ==, Ring);
@@ -1788,11 +1790,11 @@ __ReceiverRingPreparePacket(
 fail2:
     Error("fail2\n");
 
+    __ReceiverRingPutFragment(Ring, Fragment);
+
 fail1:
     Error("fail1 (%08x)\n", status);
 
-    __ReceiverRingPutFragment(Ring, Fragment);
-    
     return NULL;
 }
 
-- 
2.41.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Aug 22 11:30:23 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 22 Aug 2023 11:30:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.588421.919937 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qYPaZ-0004oF-55; Tue, 22 Aug 2023 11:30:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 588421.919937; Tue, 22 Aug 2023 11:30: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 1qYPaZ-0004o7-2G; Tue, 22 Aug 2023 11:30:23 +0000
Received: by outflank-mailman (input) for mailman id 588421;
 Tue, 22 Aug 2023 11:30:21 +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=c1aY=EH=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qYPaX-0004nx-Bu
 for win-pv-devel@lists.xenproject.org; Tue, 22 Aug 2023 11:30:21 +0000
Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com
 [2a00:1450:4864:20::32b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 44a893aa-40df-11ee-9b0c-b553b5be7939;
 Tue, 22 Aug 2023 13:30:17 +0200 (CEST)
Received: by mail-wm1-x32b.google.com with SMTP id
 5b1f17b1804b1-3fee769fd53so26736215e9.1
 for <win-pv-devel@lists.xenproject.org>; Tue, 22 Aug 2023 04:30:17 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 q15-20020a7bce8f000000b003feef82bbefsm7658406wmj.29.2023.08.22.04.30.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 22 Aug 2023 04:30:16 -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: 44a893aa-40df-11ee-9b0c-b553b5be7939
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1692703817; x=1693308617;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=DcAg5wFWq2am/MYESvmKEcLd3Icza8z+y0wSfEDwWbY=;
        b=W7PKiIcS2jGczpm0NbAr8w0AuKkHsEEoyK39/mLtgjPc7rCERqJpA18ndDNGgiSB7A
         JP7/6VeoweW9shuFUvB1o5a9szWGVZIuyF4MZyVF4qg9sAIGMGE5LratgUzgRve4rpLs
         qz5QlwXeFsaY8qvIxGewHIww6kMjY20zGxd04=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1692703817; x=1693308617;
        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=DcAg5wFWq2am/MYESvmKEcLd3Icza8z+y0wSfEDwWbY=;
        b=NLLtyukFnfk4IG3KjXRk3vnD1NHj2u8KvDHZsorkbVGCNw5h5D/VxzQBcMOE2rMFNr
         STRJIIvfDbpYoA6A+FqhCrcih2zTmZNEzYisQO7umyczIbR4PVzCWHZTnEMVc+9poQUT
         I29Ts+rdtjaLxGA2TQw18dMo8wWmlUvQ5y4M2Gzb3VdrKbiNdymHSrbH4JKtspjbGXLZ
         vqtRxnaOjCXfAroam1ysPsVVHgIZXkEAaE/U2CJRSBHae12dpEgqFt1Pt/Rv1HucXksT
         jHxBJZdhXua2RktwACHOa7cTTf25nE5x2bkh0zMvC7WKxy0TRloFVJbryWomyjM8TMb4
         EUkg==
X-Gm-Message-State: AOJu0YzTpeGc5jY9dB7dS0Bj4OtrEva2pW8Sn5qbMuFdpBNcVGj0kuTf
	eaoPvlJEZ+/KbXeB9NqFhlK6hVd1a3QsJj4MAdTb
X-Google-Smtp-Source: AGHT+IEhMHjuIUAGpFFRogOleGERsUQYsvQtTiSwemOFu+77Uoe3/k6OPqB/u+X4b2IgqBovda2Iag==
X-Received: by 2002:a05:600c:d8:b0:3fe:e812:4709 with SMTP id u24-20020a05600c00d800b003fee8124709mr6008236wmm.12.1692703816808;
        Tue, 22 Aug 2023 04:30:16 -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] ASSERT Cache method parameters
Date: Tue, 22 Aug 2023 12:30:04 +0100
Message-ID: <20230822113004.1698-1-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

ASSERT the Cache public interface methods are passed valid parameters.

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

diff --git a/src/xenbus/cache.c b/src/xenbus/cache.c
index 00e16f6..6229aed 100644
--- a/src/xenbus/cache.c
+++ b/src/xenbus/cache.c
@@ -602,6 +602,8 @@ CacheGet(
 
     UNREFERENCED_PARAMETER(Interface);
 
+    ASSERT(Cache != NULL);
+
     KeRaiseIrql(DISPATCH_LEVEL, &Irql);
     Index = KeGetCurrentProcessorNumberEx(NULL);
 
@@ -678,6 +680,9 @@ CachePut(
 
     UNREFERENCED_PARAMETER(Interface);
 
+    ASSERT(Cache != NULL);
+    ASSERT(Object != NULL);
+
     KeRaiseIrql(DISPATCH_LEVEL, &Irql);
     Index = KeGetCurrentProcessorNumberEx(NULL);
 
@@ -837,6 +842,14 @@ CacheCreate(
     KIRQL                   Irql;
     NTSTATUS                status;
 
+    ASSERT(Name != NULL);
+    ASSERT(Size != 0);
+    ASSERT(Ctor != NULL);
+    ASSERT(Dtor != NULL);
+    ASSERT(AcquireLock != NULL);
+    ASSERT(ReleaseLock != NULL);
+    ASSERT(Cache != NULL);
+
     Trace("====> (%s)\n", Name);
 
     *Cache = __CacheAllocate(sizeof (XENBUS_CACHE));
@@ -968,6 +981,8 @@ CacheDestroy(
     PXENBUS_CACHE_CONTEXT   Context = Interface->Context;
     KIRQL                   Irql;
 
+    ASSERT(Cache != NULL);
+
     Trace("====> (%s)\n", Cache->Name);
 
     KeAcquireSpinLock(&Context->Lock, &Irql);
-- 
2.41.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Wed Aug 23 09:03:12 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 23 Aug 2023 09:03:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.589059.920801 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qYjlf-0007KH-6l; Wed, 23 Aug 2023 09:03:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 589059.920801; Wed, 23 Aug 2023 09:03: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 1qYjlf-0007KA-3x; Wed, 23 Aug 2023 09:03:11 +0000
Received: by outflank-mailman (input) for mailman id 589059;
 Wed, 23 Aug 2023 08:41: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=ou+W=EI=sonn.at=pflegerl@srs-se1.protection.inumbo.net>)
 id 1qYjQJ-0003oY-Qy
 for win-pv-devel@lists.xenproject.org; Wed, 23 Aug 2023 08:41:08 +0000
Received: from mail.sonn.at (mail.sonn.at [62.218.167.68])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c957dcfe-4190-11ee-9b0c-b553b5be7939;
 Wed, 23 Aug 2023 10:41:00 +0200 (CEST)
Received: from localhost (localhost.localhost [127.0.0.1])
 by mail.sonn.at (Postfix) with ESMTP id C07DD10005D
 for <win-pv-devel@lists.xenproject.org>; Wed, 23 Aug 2023 10:40:59 +0200 (CEST)
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: c957dcfe-4190-11ee-9b0c-b553b5be7939
Authentication-Results: efw3-master.sonn.intern (amavisd-new);
	dkim=pass (1024-bit key) reason="pass (just generated, assumed good)"
	header.d=sonn.at
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sonn.at; h=
	subject:subject:from:from:content-language:mime-version:date
	:date:message-id:content-type:content-type; s=default; t=
	1692780059; x=1693384860; bh=W0uF+QqA9xYKjyAcTVdI6LDpGi/4ThKZnsw
	v8JiEQwc=; b=G+kJrd9lF0g8/Xn02JMP332OxyMAhhhMH/H2KBh0RE+WIU0jGCx
	i1DxR60P01bTxMS+/rJ3JXb4GvPAUYe7FGXK919EnSLmie6QwMGmpl+Q+T1lebSO
	Q/dwVaQJWVHivjICvaoD0qKreNNkHD+qdpPzQ9nbgnGHqF7XcAKSqOMM=
X-Spam-CTCH-RefID:
Content-Type: multipart/alternative;
 boundary="------------uJHY053BVttivA057C24aRk2"
Message-ID: <8f9a5f18-303d-4a32-a6a6-82191828e384@sonn.at>
Date: Wed, 23 Aug 2023 10:40:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: win-pv-devel@lists.xenproject.org
Content-Language: de-AT
From: Dominik Pflegerl <pflegerl@sonn.at>
Subject: missing downloads for 9.0.0 release

This is a multi-part message in MIME format.
--------------uJHY053BVttivA057C24aRk2
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hello!

When trying to download the 9.0.0 release from the website 
(https://xenproject.org/downloads/windows-pv-drivers/windows-pv-drivers-9-series/windows-pv-drivers-9-0-0/) 
no downloads are possible, the files do not exist on the download 
server. In fact the whole folder under 
https://xenbits.xenproject.org/pvdrivers/win/9.0.0/ does not exist.

Could you please reupload them, so I can update my drivers from 8.x to 
9.0.0?

Thanks!

Dominik


--------------uJHY053BVttivA057C24aRk2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <style>
          body,p,li,td,th,pre,h1,h2,h3,h4,h5,h6,address,sub,sup,cite,abbr,acronym,code,samp,var,tt,.sonn-css {
               font-family: Calibri, Carlito, Arial, Sans-Serif;
               font-size: 14px;
          }
    </style>
  </head>
  <body class="sonn-css">
    <p>Hello!</p>
    <p>When trying to download the 9.0.0 release from the website
(<a class="moz-txt-link-freetext" href="https://xenproject.org/downloads/windows-pv-drivers/windows-pv-drivers-9-series/windows-pv-drivers-9-0-0/">https://xenproject.org/downloads/windows-pv-drivers/windows-pv-drivers-9-series/windows-pv-drivers-9-0-0/</a>)
      no downloads are possible, the files do not exist on the download
      server. In fact the whole folder under
      <a class="moz-txt-link-freetext" href="https://xenbits.xenproject.org/pvdrivers/win/9.0.0/">https://xenbits.xenproject.org/pvdrivers/win/9.0.0/</a> does not
      exist.</p>
    <p>Could you please reupload them, so I can update my drivers from
      8.x to 9.0.0?</p>
    <p>Thanks!</p>
    <p>Dominik<br>
    </p>
    <p><br>
    </p>
  </body>
</html>

--------------uJHY053BVttivA057C24aRk2--


From win-pv-devel-bounces@lists.xenproject.org Thu Aug 24 14:29:57 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 24 Aug 2023 14:29:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.590000.922227 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qZBLP-0004fg-AT; Thu, 24 Aug 2023 14:29:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 590000.922227; Thu, 24 Aug 2023 14:29:55 +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 1qZBLP-0004fZ-7u; Thu, 24 Aug 2023 14:29:55 +0000
Received: by outflank-mailman (input) for mailman id 590000;
 Thu, 24 Aug 2023 11:32:31 +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=pKXr=EJ=cloud.com=matthew.sykes@srs-se1.protection.inumbo.net>)
 id 1qZ8Zj-0004TP-8W
 for win-pv-devel@lists.xenproject.org; Thu, 24 Aug 2023 11:32:31 +0000
Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com
 [2a00:1450:4864:20::431])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e78354f9-4271-11ee-9b0c-b553b5be7939;
 Thu, 24 Aug 2023 13:32:28 +0200 (CEST)
Received: by mail-wr1-x431.google.com with SMTP id
 ffacd0b85a97d-31aeee69de0so4388456f8f.2
 for <win-pv-devel@lists.xenproject.org>; Thu, 24 Aug 2023 04:32:28 -0700 (PDT)
Received: from EMEAl6wk3akOgRn.citrite.net (177.217.189.80.dyn.plus.net.
 [80.189.217.177]) by smtp.gmail.com with ESMTPSA id
 d15-20020a5d644f000000b0031aef72a021sm16481837wrw.86.2023.08.24.04.32.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 24 Aug 2023 04:32: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: e78354f9-4271-11ee-9b0c-b553b5be7939
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1692876748; x=1693481548;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=dDVQojLS+uOAUf+ZdjfPC01X56tWMUiFbGa1vys+e5k=;
        b=cpTUpqCGZRHymIYedICmfyFzUf177i1hYtfU7k/2tJ7W7si5Jrea6QUd2ycl+cws4Z
         mXLM6sp2Fs73PMCIpGzZaBzCLUVl0Zck5rzBXeoaeUddWcrcS/g/a2K1l7FBK6s+1UaJ
         0Mu+czYq2i/Pb396X/HbqsGW2mJIrSaxkHEx4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1692876748; x=1693481548;
        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=dDVQojLS+uOAUf+ZdjfPC01X56tWMUiFbGa1vys+e5k=;
        b=XiMaxbt13HdKoP67RB75w2+zLQbOO8Bc2rrslre4TrAaxbdCW6aggrSLXKnglchBTt
         el1CB1m1rzS9GZM44Z2lxUOteUAuAnsLElBw8OeoArPolpkLT8Ka5lEHDqApSC1wH6Bs
         VbPTLEjYd18T3hevZPBXQf/qXulT5N7TeUMiGlqnYsrVR0OZaKrUFKel3mOoHy7iJMPI
         iDb8e4VTbL3JcN/B809zJcMYGQo6KWw9qfSVmppLO2us0KOwcBgr53rz9RQHcVQvx5nZ
         s0wJIxxD/QIPTCHzl+lkZCADvzDb2v4ZMtmD4VQaDPdkGGp/ZMUB1wmlvTOTrd6K+Bav
         OVnQ==
X-Gm-Message-State: AOJu0Yyjfm2lJaFo2oEnl342dmsPAA/j7SFF3O29u/6YWvk5xPkse1N9
	jR4PBJSHHHm2QKiVzEFcZ5Y5QkaCTde+Ojbmcaw=
X-Google-Smtp-Source: AGHT+IHPcat+1PqUks9gaitZi/941t4Nx9d8nr6xN6oxO2JCo+kCu33tOajut2iWssbmQWMURHJD3w==
X-Received: by 2002:adf:f985:0:b0:313:f5f8:a331 with SMTP id f5-20020adff985000000b00313f5f8a331mr12023639wrr.34.1692876747935;
        Thu, 24 Aug 2023 04:32:27 -0700 (PDT)
From: Matthew Sykes <matthew.sykes@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Matthew Sykes <msykes@tibco.com>
Subject: [PATCH] Fully initialise device power map
Date: Thu, 24 Aug 2023 12:31:47 +0100
Message-Id: <20230824113147.1678-1-matthew.sykes@cloud.com>
X-Mailer: git-send-email 2.38.0.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Matthew Sykes <msykes@tibco.com>

Signed-off-by: Matthew Sykes <msykes@tibco.com>
---
 src/xenbus/pdo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/xenbus/pdo.c b/src/xenbus/pdo.c
index 5e6fff3..08f5dfe 100644
--- a/src/xenbus/pdo.c
+++ b/src/xenbus/pdo.c
@@ -1139,6 +1139,7 @@ PdoQueryCapabilities(
         case PowerSystemUnspecified:
         case PowerSystemSleeping1:
         case PowerSystemSleeping2:
+		    Capabilities->DeviceState[SystemPowerState] = PowerDeviceD0; 
             break;
 
         case PowerSystemWorking:
-- 
2.38.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 24 14:29:57 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 24 Aug 2023 14:29:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.590010.922233 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qZBLP-0004g3-EQ; Thu, 24 Aug 2023 14:29:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 590010.922233; Thu, 24 Aug 2023 14:29:55 +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 1qZBLP-0004fk-9Z; Thu, 24 Aug 2023 14:29:55 +0000
Received: by outflank-mailman (input) for mailman id 590010;
 Thu, 24 Aug 2023 11:35:36 +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=pKXr=EJ=cloud.com=matthew.sykes@srs-se1.protection.inumbo.net>)
 id 1qZ8ci-00053L-1s
 for win-pv-devel@lists.xenproject.org; Thu, 24 Aug 2023 11:35:36 +0000
Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com
 [2a00:1450:4864:20::32c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 563cd919-4272-11ee-9b0c-b553b5be7939;
 Thu, 24 Aug 2023 13:35:33 +0200 (CEST)
Received: by mail-wm1-x32c.google.com with SMTP id
 5b1f17b1804b1-3ff006454fdso15750075e9.1
 for <win-pv-devel@lists.xenproject.org>; Thu, 24 Aug 2023 04:35:34 -0700 (PDT)
Received: from EMEAl6wk3akOgRn.citrite.net (177.217.189.80.dyn.plus.net.
 [80.189.217.177]) by smtp.gmail.com with ESMTPSA id
 z16-20020a1c4c10000000b003fa96fe2bd9sm2395468wmf.22.2023.08.24.04.35.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 24 Aug 2023 04:35: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: 563cd919-4272-11ee-9b0c-b553b5be7939
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1692876933; x=1693481733;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=lfFOXj7yjXEWIby1EjQhrMPGi7DiRIZ8LaV+UPCXUgQ=;
        b=BdAXYX8xb4wvJd3120QooxlHAoFuUNJetpLIBOwzb9htIQx42UGwepliuN+YMvegbX
         29fieo7t7pF9c+XGS1Ku2p98NfqjUaBFhC6oM2Yp7lwdzruUUYqNu+SUtyJgT0pgEFoD
         xs6KW4aj08KaoiY0P5yT09c6HwKg1M+uzlwhM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1692876933; x=1693481733;
        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=lfFOXj7yjXEWIby1EjQhrMPGi7DiRIZ8LaV+UPCXUgQ=;
        b=lfJUVOYWXuZmQu3VwRTse8u27tG0bi3qjl9kQpgjE0L6+WUvu/NUWjnCkTnbZMo+5t
         wAIiBfWoH5H9qBGGbhMmXkm1QW+WCsWE8/lOPdq1kGVZYLkpkeQcTdyiubzMO0PAwx45
         vSQPcmOFxABpL29Ar4SEuTczcFNne9XEH7h3FS4UaRg6LYqO36UWMRtRU313Mr74UZvc
         TlcWpSk2EOvkdZOdciyQ8Q5bsrfCFPSePiq8FyIPeSSEwrNFwrjoMK5Ar0D+0MSyMbUx
         wRteLCMZhx2f/cNQsqhRCMiV6mxNL1i+7ZeSf3++j0yMp3mXMU8MrgiDEs2I4Lg0RUwG
         1Vfg==
X-Gm-Message-State: AOJu0Yw898gLBicaGabheCYub7n46EU/H4ky2wxjqv5F3p96U9R0vo3R
	L3Nb7YtbX9wKSLsBTb4HPHRuSq8tS3SlaCcv+Us=
X-Google-Smtp-Source: AGHT+IFWNnFjRXjQTf06TTnl+ElsB2xtKjEW+HvQZyPJcHdTZIgUfIQY0w7H66715t/zM8ItTox52A==
X-Received: by 2002:a05:600c:ce:b0:3fe:f726:4a94 with SMTP id u14-20020a05600c00ce00b003fef7264a94mr6579400wmm.14.1692876933576;
        Thu, 24 Aug 2023 04:35:33 -0700 (PDT)
From: Matthew Sykes <matthew.sykes@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Matthew Sykes <matthew.sykes@citrix.com>
Subject: [PATCH] Fully initialise device power map
Date: Thu, 24 Aug 2023 12:33:27 +0100
Message-Id: <20230824113328.1029-1-matthew.sykes@cloud.com>
X-Mailer: git-send-email 2.38.0.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Matthew Sykes <matthew.sykes@citrix.com>

Signed-off-by: Matthew Sykes <matthew.sykes@citrix.com>
---
 src/xenvif/pdo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
index 1d163c9..26d3ddb 100644
--- a/src/xenvif/pdo.c
+++ b/src/xenvif/pdo.c
@@ -1840,6 +1840,7 @@ PdoQueryCapabilities(
         case PowerSystemUnspecified:
         case PowerSystemSleeping1:
         case PowerSystemSleeping2:
+		    Capabilities->DeviceState[SystemPowerState] = PowerDeviceD0; 
             break;
 
         case PowerSystemWorking:
-- 
2.38.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:29:46 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:29:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593401.926416 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbc7d-0000ia-CM; Thu, 31 Aug 2023 07:29:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593401.926416; Thu, 31 Aug 2023 07:29: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 1qbc7d-0000iV-8u; Thu, 31 Aug 2023 07:29:45 +0000
Received: by outflank-mailman (input) for mailman id 593401;
 Thu, 31 Aug 2023 07:29: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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbc7c-0000gZ-6d
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:29:44 +0000
Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com
 [2a00:1450:4864:20::334])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 27680f96-47d0-11ee-8783-cb3800f73035;
 Thu, 31 Aug 2023 09:29:43 +0200 (CEST)
Received: by mail-wm1-x334.google.com with SMTP id
 5b1f17b1804b1-401b393ddd2so4896075e9.0
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:29:43 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 p15-20020a5d68cf000000b0031416362e23sm1224278wrw.3.2023.08.31.00.29.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Aug 2023 00:29: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: 27680f96-47d0-11ee-8783-cb3800f73035
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693466983; x=1694071783; 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=+evXqCjjX/VEKE8/HnFJ1XdhEVsRaQ1tUuKfiY21QUA=;
        b=DMJd/hbdpUisPi4iHnNyIpAz8teAuxI3n2McD9dfgFmVMtiKIaHHgl94Hu7XQZ70qv
         pcUpH3VVDF9L7RbD4O00rkCmeZu9/XFRJWKgRrBHDgO5Rj9GOM4xWfFI8no1dQeTtq8o
         aMh836J0x7IYIn5Wwm8vhIDsXrk0oF7/fEems=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693466983; x=1694071783;
        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=+evXqCjjX/VEKE8/HnFJ1XdhEVsRaQ1tUuKfiY21QUA=;
        b=is4V8bHR/TWeqh4ZuzvWb48m9DApdoCkXyp0j8F9ap6B9Wl1DPE3lNTHrkHRz9XC6x
         OzTGkAPmylJw5jAQ1hIFtgxQsXiI/DCVSKsVAK7WLPLr6cd36RP4uuWzZB9kD5pZ4cJZ
         DHdRkAL8DIkp86IEE7/VWXaHCqJOFlSNTmaNGg8OnwxQVX/LHf6PM2c0kLMGX/gc9/62
         f0kEBS/R33kUcilm6jLvbDOwfxPmz3UupTG0psBLUhvwEGZk1jqhXSYGaGpmSD1vkexM
         ixEM6gPbJLzST5D7ekXnrATNkCX1G/AYXvfSgvY5zRZHrCMN5845GMKBE9T5RvdK/p0n
         /7Rg==
X-Gm-Message-State: AOJu0YzfqH1Tg+Qju2jfL43+/GibrY6qwjZnOhoivXwEV7T9DXWQk+Bx
	N+TmSEXOXNqoWbIseBbEdTlpj5G9hk57IifyKQQk
X-Google-Smtp-Source: AGHT+IH2DGzvZzjXMjKqED4Tpfu7c3wx+SR2KlNXmc7m12+FYvkZh9eNRMsZTSVzYOAZyopebLD9fg==
X-Received: by 2002:a5d:4ace:0:b0:314:1f6:2c24 with SMTP id y14-20020a5d4ace000000b0031401f62c24mr3272788wrs.36.1693466982944;
        Thu, 31 Aug 2023 00:29:42 -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 4/6] Fix Length calculation in PdoQueryId
Date: Thu, 31 Aug 2023 08:29:19 +0100
Message-ID: <20230831072921.1258-5-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.3
In-Reply-To: <20230831072921.1258-1-owen.smith@cloud.com>
References: <20230831072921.1258-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Decrease Length by the string length of the current ID before moving
the Buffer value to the end of the current ID. Without this, Length
is not decreased, leading to potential issues with the next call to
RtlStringCbPrintfW.

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

diff --git a/src/xenbus/pdo.c b/src/xenbus/pdo.c
index 5e6fff3..663dd3b 100644
--- a/src/xenbus/pdo.c
+++ b/src/xenbus/pdo.c
@@ -1456,11 +1456,11 @@ PdoQueryId(
                                         Revision->Number);
             ASSERT(NT_SUCCESS(status));
 
-            Buffer += wcslen(Buffer);
             Length -= (ULONG)(wcslen(Buffer) * sizeof (WCHAR));
+            Buffer += wcslen(Buffer);
 
-            Buffer++;
             Length -= sizeof (WCHAR);
+            Buffer++;
 
             --Index;
         }
-- 
2.41.0.windows.3



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:29:46 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:29:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593400.926411 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbc7b-0000gm-A5; Thu, 31 Aug 2023 07:29:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593400.926411; Thu, 31 Aug 2023 07:29:43 +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 1qbc7b-0000gf-7Q; Thu, 31 Aug 2023 07:29:43 +0000
Received: by outflank-mailman (input) for mailman id 593400;
 Thu, 31 Aug 2023 07:29:41 +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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbc7Z-0000gZ-OB
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:29:41 +0000
Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com
 [2a00:1450:4864:20::434])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 252eb0d7-47d0-11ee-8783-cb3800f73035;
 Thu, 31 Aug 2023 09:29:40 +0200 (CEST)
Received: by mail-wr1-x434.google.com with SMTP id
 ffacd0b85a97d-31c8a710545so352254f8f.3
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:29:39 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 p15-20020a5d68cf000000b0031416362e23sm1224278wrw.3.2023.08.31.00.29.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Aug 2023 00:29: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: 252eb0d7-47d0-11ee-8783-cb3800f73035
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693466979; x=1694071779; 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=Jsj/sH00hDgHppoAjFNsLH30getcPUyVOOMul4Na1SI=;
        b=WgfFCGULJlfnWrGv7tyEntvhBJWj3hnPDsDEDYh8IXPtQ0qIFCttumcs1FTzSDoRGe
         eWZjOSxQhDmoHRM7k0sxcu1tVmMPaJh2S2Zzid1PDL8oiBVC9ew0pjiRI+xNfjk5xZ6d
         Gz6cHQSPF0Bfs40oiQNipA20lKwqoRQ4W3F9g=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693466979; x=1694071779;
        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=Jsj/sH00hDgHppoAjFNsLH30getcPUyVOOMul4Na1SI=;
        b=f8qtVh5o3tkiS2v+FZnWyUA0Wyv4qDwur/YpAY4Rt2aGyttrKXSl8yBI9bDreumKPF
         4zNi7s75cY9W/uZb1ORdJPvSpB6Tm9oDXOBlCCHfnUsoYehB9T7RDqUa6JxBbpWij+gG
         K5r6mhTFaEWb7YdgpGOwGrUVN9LizrR+eBZlyXNieIiOtX6PznPtqY45FQiimxzgJu45
         zPhjlq7Gyo+SPmrH4rdLXrKeCux/9O9Koo/2XRIZg/WWZmpyJCkOVmaxAm8zqVWqHnrD
         369vR0r/F/mTY1KPvLqepGh5dm6WD0mqDA+oHWdZbr+E6ul4qvuS2NYLJOnMSv4Drfig
         ScAw==
X-Gm-Message-State: AOJu0Yy1AfV2W8eA8eQThT2otQj3H/+vjDqLDUZbBQ0KSiE3PKtO/Q4l
	AE5zYNsSe1gpxrRT4PFTHM4gnkXWv0PT+HLqYOMr
X-Google-Smtp-Source: AGHT+IHidowYAt0x/WS6/I5A/jukxkRdrLAEoZv3WofFsD/fG5gMC1tpEATvzpIeU8XLH2wcukVh5A==
X-Received: by 2002:a5d:4288:0:b0:31c:6591:d415 with SMTP id k8-20020a5d4288000000b0031c6591d415mr3201270wrq.39.1693466979004;
        Thu, 31 Aug 2023 00:29:39 -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 0/6] Remove CoInstallers
Date: Thu, 31 Aug 2023 08:29:15 +0100
Message-ID: <20230831072921.1258-1-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Windows 11 22H2 WHQL testing has highlighted the need to remove CoInstallers.
The current CoInstaller handle several edge cases that will need replacement
implementations. This patch series for most drivers offers a potential solution
to the removal of CoInstallers and the required changes to avoid upgrade issues.

CoInstallers have several uses currently:
- Adds an upgrade block function with the "AllowUpgrade" value blocking driver
  upgrades when set.
- Adds a check to prevent XenBus upgrades from a different vendor / brand.
  This checks the current device name (if it exists) matches the new device name.
- Checks all currently installed child devices have a supported set of interfaces
  common with the new parent device.
- Clears the Unplug keys only when required.
- Correctly cleans up user mode services on uninstall.

The AllowUpgrade function has not been replaced - I have not seen this used in
the current implementations of the drivers.

The vendor naming check is specific to XenBus, and I dont think there is a
reliable replacement, and was intended to prevent different vendor drivers from
attempting to coexist, or upgrade cases from particularly old versions which had
a different naming scheme.

The interface compatability checks can be replaced with the matching if RevisionIDs
in the INF files, so that child devices will only install on parent devices that
expose a matching HardwareID or CompatibleID. This does leave the case where the
new parent driver could drop support for an interface version that is currently in
use. This will mandate a further driver upgrade, and should remove the Unplug keys
and mandate a reboot where the emulated devices are present, to ensure continued
operation. After this reboot using emulated devices, updates to the child devices
should be detected and installed, requiring another reboot to revert to PV devices.

Unplug keys getting cleared on all upgrades should allow the next boot to use emulated
devices, unless a subsequent install updates dependent drivers to use a working set
of new interfaces. The requirement here is that updating any driver should always
allow a reboot with emulated devices, should any further issues be detected.

I believe that, going forward, changing the DeviceID to remove the RevisionID will
avoid the need to set network IDs and copy settings from the previous network
connection to the new network connection. This change will mean the driver selection
during installation/upgrade will use the HardwareIDs (with RevisionIDs) to match the
ID in the DDInstall INF section (with RevisionID), and use the DeviceID to generate
the Matching Device ID and Instance ID. This means that once drivers have been
upgraded, the InstanceIDs should not change, and Windows should not generate a new
network connection (with default settings) for the upgraded driver set - meaning the
correct network settings are persisted.

I dont have a good replacement for cleaning up user mode services (xenbus_monitor
xenagent and xencons_monitor) on device uninstall. This *should* be handled correctly
by the PnP manager, but failing to stop either service should not be detremental to
the operation of the VM. Selecting the "Delete Drivers" option during uninstall will
stop and disable these services, not selecting this option will leave these services
running.

Owen Smith (6):
  Remove CoInstaller from INF
  Reset StorNvme's StartOverride
  Delete CoInstaller code
  Fix Length calculation in PdoQueryId
  Remove REV from DeviceID
  Add Unplug v2 interface (REV_0900000A)

 include/revision.h                            |    3 +-
 include/unplug_interface.h                    |   30 +-
 include/xen.h                                 |    7 +
 src/coinst/coinst.c                           | 2136 -----------------
 src/coinst/xenbus_coinst.def                  |   38 -
 src/coinst/xenbus_coinst.rc                   |   57 -
 src/monitor/monitor.c                         |   63 +
 src/xen/unplug.c                              |   15 +
 src/xenbus.inf                                |   20 +-
 src/xenbus/pdo.c                              |   14 +-
 src/xenbus/unplug.c                           |   61 +
 vs2015/package/package.vcxproj                |    3 -
 vs2015/xenbus.sln                             |   22 -
 vs2015/xenbus_coinst/xenbus_coinst.vcxproj    |   64 -
 .../xenbus_coinst/xenbus_coinst.vcxproj.user  |    8 -
 vs2017/package/package.vcxproj                |    3 -
 vs2017/xenbus.sln                             |   22 -
 vs2017/xenbus_coinst/xenbus_coinst.vcxproj    |   64 -
 .../xenbus_coinst/xenbus_coinst.vcxproj.user  |    8 -
 vs2019/package/package.vcxproj                |    3 -
 vs2019/xenbus.sln                             |   22 -
 vs2019/xenbus_coinst/xenbus_coinst.vcxproj    |   70 -
 .../xenbus_coinst/xenbus_coinst.vcxproj.user  |    8 -
 vs2022/package/package.vcxproj                |    3 -
 vs2022/xenbus.sln                             |   22 -
 vs2022/xenbus_coinst/xenbus_coinst.vcxproj    |   70 -
 .../xenbus_coinst/xenbus_coinst.vcxproj.user  |    8 -
 27 files changed, 187 insertions(+), 2657 deletions(-)
 delete mode 100644 src/coinst/coinst.c
 delete mode 100644 src/coinst/xenbus_coinst.def
 delete mode 100644 src/coinst/xenbus_coinst.rc
 delete mode 100644 vs2015/xenbus_coinst/xenbus_coinst.vcxproj
 delete mode 100644 vs2015/xenbus_coinst/xenbus_coinst.vcxproj.user
 delete mode 100644 vs2017/xenbus_coinst/xenbus_coinst.vcxproj
 delete mode 100644 vs2017/xenbus_coinst/xenbus_coinst.vcxproj.user
 delete mode 100644 vs2019/xenbus_coinst/xenbus_coinst.vcxproj
 delete mode 100644 vs2019/xenbus_coinst/xenbus_coinst.vcxproj.user
 delete mode 100644 vs2022/xenbus_coinst/xenbus_coinst.vcxproj
 delete mode 100644 vs2022/xenbus_coinst/xenbus_coinst.vcxproj.user

-- 
2.41.0.windows.3



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:29:46 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:29:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593402.926419 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbc7e-0000kQ-EE; Thu, 31 Aug 2023 07:29:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593402.926419; Thu, 31 Aug 2023 07:29:46 +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 1qbc7e-0000kJ-AD; Thu, 31 Aug 2023 07:29:46 +0000
Received: by outflank-mailman (input) for mailman id 593402;
 Thu, 31 Aug 2023 07:29:45 +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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbc7d-0000gZ-7l
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:29:45 +0000
Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com
 [2a00:1450:4864:20::42d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 27f9ad51-47d0-11ee-8783-cb3800f73035;
 Thu, 31 Aug 2023 09:29:44 +0200 (CEST)
Received: by mail-wr1-x42d.google.com with SMTP id
 ffacd0b85a97d-31c7912416bso359255f8f.1
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:29:44 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 p15-20020a5d68cf000000b0031416362e23sm1224278wrw.3.2023.08.31.00.29.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Aug 2023 00:29:43 -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: 27f9ad51-47d0-11ee-8783-cb3800f73035
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693466984; x=1694071784; 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=Ds79LmNbX9SRI0MiPC/MARfue2+Ijs1jI4KSLnBQZXc=;
        b=AUWOgsSrDprICtNQCFWuYjDxjcyPaNKKr42NlouWaI6WODhREVJDXj8KPSyBByHUAJ
         N/efItk0AYqx9HKnjxCU8FJd/MC0N+gKe3g4WwokWEzOr9F5RD8VhuSy6iajPNOPCf7U
         DoTi8BPhPgT6rVMqqGD/K7xv7g9uNsSATfnFE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693466984; x=1694071784;
        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=Ds79LmNbX9SRI0MiPC/MARfue2+Ijs1jI4KSLnBQZXc=;
        b=ewk7/itjF/Ai+bs8HMf5Ko8kWzyX6qUKH/rgHq6/GhE0F+i8XidYwyXIx4qBcV5MRH
         FYjkuWPvxnSGl2BHNbaBCtOIBgAxvPd+fqANLkcNwML3pCQX4y9kxyV6bcfq5edzQHP/
         v5EXu5D7w1WmbtGvWOS8rtfuXz2twa1CmWUzF7McHwhRCnHoKsmvpaXmFK0IlCARpz1C
         z4qVM2TLzLh+Z7ariWkOL8hSoOK2NQdF9JP+wFaTp1pT0VWYk7jq2erZKcr4lSNElLAl
         tf+zZ/nnFe/hrmA+anptSZjqbtN+HAVAepVhvLb/YXogKx/4GShlSqeVRxDZUqryWQTs
         IW2Q==
X-Gm-Message-State: AOJu0Yw0IQCGFchGuf4lKpgOaYE5V8+XdvxtroOVifWx9gWQ9kvlvPzv
	guQXulJ7zvengRyh6/UgjehnA/mCSEXnOa1sqKom
X-Google-Smtp-Source: AGHT+IEAQNkQ5R86DoCC0TG7ZB+EOZfpc0+kE/tx5XtFflNV8aKyXzQeQtZjWHw4ExzIK2zUBQn+9A==
X-Received: by 2002:a5d:6448:0:b0:319:7b66:7800 with SMTP id d8-20020a5d6448000000b003197b667800mr3064349wrw.55.1693466983975;
        Thu, 31 Aug 2023 00:29:43 -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 5/6] Remove REV from DeviceID
Date: Thu, 31 Aug 2023 08:29:20 +0100
Message-ID: <20230831072921.1258-6-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.3
In-Reply-To: <20230831072921.1258-1-owen.smith@cloud.com>
References: <20230831072921.1258-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Driver upgrades use HardwareIDs (or CompatibleIDs) to match the child INF DDInstall
section (stored as matching device id), but use the DeviceID to generate the device
instance path. By keeping the device instance path the same over upgrades, the network
stack should identify this as an upgrade, rather than 'replacement hardware', and
not generate a new network connection, which would require network settings to be
copied from the existing network connection to the new network connection.

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

diff --git a/src/xenbus/pdo.c b/src/xenbus/pdo.c
index 663dd3b..3f1e4c5 100644
--- a/src/xenbus/pdo.c
+++ b/src/xenbus/pdo.c
@@ -1416,19 +1416,13 @@ PdoQueryId(
         break;
 
     case BusQueryDeviceID: {
-        ULONG                   Index;
-        PXENBUS_PDO_REVISION    Revision;
-
         Type = REG_SZ;
-        Index = ARRAYSIZE(PdoRevision) - 1;
-        Revision = &PdoRevision[Index];
 
         status = RtlStringCbPrintfW(Buffer,
                                     Id.MaximumLength,
-                                    L"XENBUS\\VEN_%hs&DEV_%hs&REV_%08X",
+                                    L"XENBUS\\VEN_%hs&DEV_%hs",
                                     __PdoGetVendorName(Pdo),
-                                    __PdoGetName(Pdo),
-                                    Revision->Number);
+                                    __PdoGetName(Pdo));
         ASSERT(NT_SUCCESS(status));
 
         Buffer += wcslen(Buffer);
-- 
2.41.0.windows.3



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:29:46 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:29:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593403.926421 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbc7e-0000kj-HA; Thu, 31 Aug 2023 07:29:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593403.926421; Thu, 31 Aug 2023 07:29:46 +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 1qbc7e-0000kU-BX; Thu, 31 Aug 2023 07:29:46 +0000
Received: by outflank-mailman (input) for mailman id 593403;
 Thu, 31 Aug 2023 07:29:45 +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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbc7d-0000iR-Im
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:29:45 +0000
Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com
 [2a00:1450:4864:20::42b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 263552ae-47d0-11ee-9b0d-b553b5be7939;
 Thu, 31 Aug 2023 09:29:42 +0200 (CEST)
Received: by mail-wr1-x42b.google.com with SMTP id
 ffacd0b85a97d-31aec0a1a8bso256472f8f.0
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:29:41 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 p15-20020a5d68cf000000b0031416362e23sm1224278wrw.3.2023.08.31.00.29.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Aug 2023 00:29:40 -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: 263552ae-47d0-11ee-9b0d-b553b5be7939
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693466981; x=1694071781; 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=lZJhDs6TLp02X0mEgYUbmO580/FW8SRaERbmYDiWIQo=;
        b=Wvmra6I7a+uC6p02whro9nOCNs0xhU+YCrk3V9AyZkp+rAxlpEU297ovlAsRxiboyW
         4YtSvorcZP9AAnGcznVtzkI1jhbSOBA8v4TFfr84t1MZTzVM+m6ydEGxyC2C/PffE2Ha
         v7ySR/u7UUTtcPItdkVtYeNkZSWWkM4/gT1P0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693466981; x=1694071781;
        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=lZJhDs6TLp02X0mEgYUbmO580/FW8SRaERbmYDiWIQo=;
        b=Nu46U/g4CYULaqNkfrByhKM26RdfEqX2d6ZXKWUmv0UFXHyFDmOWToSh2GUMrmR6sI
         7m7DzvDYPki9Qr0UwOpZuFMPIKgkuswM/SWdefuqPSvcXUiRT0AKV6FoTVseZSIZlK4K
         Im3CCfTtkrYP2ND1EGgBsnvz19AnR8UP3UsPbvpPwNIFMAF6YW4HG5rgjuA+H2Ltbtdj
         9UavD0luusOfL2zdNTsVIb50IBXdEBKWqkXiYLtGAndmNoO6uEj6BVhTyCtpnOw8U7/9
         jtjqJL8/Fg5247b3nxGFpMgI1drlXXUlju9ZIXZ/cxbl3KgjumAuUGr0cC74BHZBu2xq
         JjIw==
X-Gm-Message-State: AOJu0YxrU+kiR/6c96AQz5dbaZulh4fyyEXhNCerS7BMtnjj9++1jTNe
	WXVf9McWIbBWpOpMBWDX26gZvcLgE0YrFrbihzP4
X-Google-Smtp-Source: AGHT+IHDKVZ4gv7dvc7/cpXpT1CVz2c9YpsWBYcF2MhhZLWzSJbV3yJKpSiGkqQmKhIyWTaelHOcMA==
X-Received: by 2002:a5d:544c:0:b0:319:70c8:6e90 with SMTP id w12-20020a5d544c000000b0031970c86e90mr1198023wrv.24.1693466980889;
        Thu, 31 Aug 2023 00:29:40 -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/6] Reset StorNvme's StartOverride
Date: Thu, 31 Aug 2023 08:29:17 +0100
Message-ID: <20230831072921.1258-3-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.3
In-Reply-To: <20230831072921.1258-1-owen.smith@cloud.com>
References: <20230831072921.1258-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

When StorNvme does not enumerate any devices during boot start, it sets
the StartOverride value, which means that StorNvme does not start during
the next boot.
This can be an issue when attempting to revert to emulated boot, such as
during a driver upgrade, as StorNvme will not be loaded and not take control
of the boot disk, leading to a 0x7B bugcheck.

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

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index bb872ce..185838f 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -1173,6 +1173,66 @@ fail1:
     return FALSE;
 }
 
+static BOOL
+RemoveStartOverride(
+    IN PTCHAR           DriverName
+    )
+{
+    TCHAR               KeyName[MAX_PATH];
+    HKEY                Key;
+    DWORD               Value;
+    HRESULT             Error;
+
+    Error = StringCbPrintf(KeyName,
+                           MAX_PATH,
+                           SERVICES_KEY "\\%s\\StartOverride",
+                           DriverName);
+    assert(SUCCEEDED(Error));
+
+    Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+                         KeyName,
+                         0,
+                         KEY_READ | KEY_WRITE,
+                         &Key);
+    if (Error != ERROR_SUCCESS) {
+        SetLastError(Error);
+        goto fail1;
+    }
+
+    Value = 0;
+    Error = RegSetValueEx(Key,
+                          "0",
+                          0,
+                          REG_DWORD,
+                          (const BYTE*)&Value,
+                          (DWORD) sizeof(Value));
+    if (Error != ERROR_SUCCESS) {
+        SetLastError(Error);
+        goto fail2;
+    }
+
+    RegCloseKey(Key);
+
+    return TRUE;
+
+fail2:
+    Log("fail2");
+
+    RegCloseKey(Key);
+
+fail1:
+    Error = GetLastError();
+
+    {
+        PTCHAR  Message;
+        Message = GetErrorMessage(Error);
+        Log("fail1 (%s)", Message);
+        LocalFree(Message);
+    }
+
+    return FALSE;
+}
+
 VOID WINAPI
 MonitorMain(
     _In_    DWORD       argc,
@@ -1189,6 +1249,8 @@ MonitorMain(
 
     Log("====>");
 
+    (VOID) RemoveStartOverride("stornvme");
+
     Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
                          PARAMETERS_KEY(__MODULE__),
                          0,
@@ -1301,6 +1363,7 @@ done:
     (VOID) DeregisterEventSource(Context->EventLog);
 
     CloseHandle(Context->ParametersKey);
+    (VOID) RemoveStartOverride("stornvme");
 
     Log("<====");
 
-- 
2.41.0.windows.3



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:29:47 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:29:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593404.926426 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbc7f-0000oZ-GP; Thu, 31 Aug 2023 07:29:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593404.926426; Thu, 31 Aug 2023 07:29:47 +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 1qbc7f-0000oV-DO; Thu, 31 Aug 2023 07:29:47 +0000
Received: by outflank-mailman (input) for mailman id 593404;
 Thu, 31 Aug 2023 07:29: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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbc7e-0000iR-8B
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:29:46 +0000
Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com
 [2a00:1450:4864:20::436])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 25d26c48-47d0-11ee-9b0d-b553b5be7939;
 Thu, 31 Aug 2023 09:29:42 +0200 (CEST)
Received: by mail-wr1-x436.google.com with SMTP id
 ffacd0b85a97d-31adc5c899fso354011f8f.2
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:29:41 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 p15-20020a5d68cf000000b0031416362e23sm1224278wrw.3.2023.08.31.00.29.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Aug 2023 00:29:39 -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: 25d26c48-47d0-11ee-9b0d-b553b5be7939
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693466980; x=1694071780; 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=B4s6xSDiwQyj4zIYgnvLbVjYmcJ9FcOyOdWz5EOymQ8=;
        b=LnMOsSaIfloon/q36cU4K1/OFdKm9j4msZrULEDJfODQdBmQyE9YDONRuLU1tvlwqH
         swE5d4XyfWKDXcq4J14pRNpqt0m/DUnjb+ZKhbqPbAp0wFUeyQj1o+4UPBKeFx1CZpvV
         tG2XjBzVGuMumDlaKJfpbpz1gFjG0L0XLWJLs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693466980; x=1694071780;
        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=B4s6xSDiwQyj4zIYgnvLbVjYmcJ9FcOyOdWz5EOymQ8=;
        b=diwF/ttLBhSN5Li+pgx1cVbKGKJMjc4D/mAke8BkJltCGl8i0L8+S1NOZb7qo6OCNa
         aPHobcEq5swccLghqbT8yNnTa3L/7CjuYscqZP46cKtifN+rptNqXK0LQEzaWFcnfwuZ
         T6qIUSiO5FEGPGsD5n2Bw+ZZ1jvb+C75WD5OSZsniwI2VZgoLsZEd5rNn2g4bBFPCktr
         zWXyHgSrvcXkzuKlUjfmVwF+NkmTOfPVIAXk9nlDypjloFAzfz7R4PSuOyBIK8v6ZTma
         JMXxbsFIcmwEWbCetV+MBJoHlilog76WVD88YjEyMHqebbgwbJ4F1U0oM2vL56N/W7AR
         LMvg==
X-Gm-Message-State: AOJu0YyN8qCLyzLArPGHAfpIYnxL8sHRsuPv9MHKqQYSeF/ni2SqZ/+O
	dyAjPii39ASBvJw9NCEUA756QGKYhaxMnj33xPAw
X-Google-Smtp-Source: AGHT+IFZn3geZvlL2Hb302bxfaRNHSEmuGbtaJ6kXwaYMbNjrDo1iRSEZ4/d12txo6sT4B6X+BoTVw==
X-Received: by 2002:adf:ab04:0:b0:319:7c7d:8d1 with SMTP id q4-20020adfab04000000b003197c7d08d1mr3133715wrc.44.1693466980055;
        Thu, 31 Aug 2023 00:29:40 -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/6] Remove CoInstaller from INF
Date: Thu, 31 Aug 2023 08:29:16 +0100
Message-ID: <20230831072921.1258-2-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.3
In-Reply-To: <20230831072921.1258-1-owen.smith@cloud.com>
References: <20230831072921.1258-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Windows 11 22H2 WHQL requires INF files pass "InfVerif /k", which highlights
several issues
- PnpLockdown=1 needs to be specified
- CoInstallers are no longer allowed

The CoInstaller has several functions that will need alternative solutions:
- The AllowUpdate mechanism is no longer possible
- The ability to block upgrades from installing on a different vendor's drivers
- The safety checks that ensure interface versionings remain compatible
- The cleanup of xenbus_monitor on uninstall.

Interface safety checks need to be handled by changes to child device bindings,
and assuming upgrade via emulated devices is safe. The unplug keys are cleared
in the INF to revert to emulated on the next boot, incase the current child
drivers rely on an interface that is no longer present (note: in this case,
child drivers will need updating).

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

diff --git a/src/xenbus.inf b/src/xenbus.inf
index 59eab7b..73a2b11 100644
--- a/src/xenbus.inf
+++ b/src/xenbus.inf
@@ -37,10 +37,10 @@ Provider=%Vendor%
 CatalogFile=xenbus.cat
 DriverVer=@INF_DATE@,@MAJOR_VERSION@.@MINOR_VERSION@.@MICRO_VERSION@.@BUILD_NUMBER@
 DriverPackageDisplayName=%DiskDesc%
+PnpLockdown=1
 
 [DestinationDirs] 
 DefaultDestDir=12 
-CoInst_CopyFiles=11
 Monitor_CopyFiles=11
 
 [SourceDisksNames]
@@ -50,7 +50,6 @@ Monitor_CopyFiles=11
 xen.sys=0,,
 xenbus.sys=0,,
 xenfilt.sys=0,,
-xenbus_coinst.dll=0,,
 xenbus_monitor.exe=0,,
 xenbus_monitor.dll=0,,
 
@@ -59,9 +58,6 @@ xen.sys
 xenbus.sys
 xenfilt.sys
 
-[CoInst_CopyFiles]
-xenbus_coinst_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll,xenbus_coinst.dll
-
 [Monitor_CopyFiles]
 xenbus_monitor_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.exe,xenbus_monitor.exe
 xenbus_monitor_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll,xenbus_monitor.dll
@@ -93,7 +89,7 @@ StartType=%SERVICE_BOOT_START%
 ErrorControl=%SERVICE_ERROR_NORMAL% 
 ServiceBinary=%12%\xenbus.sys 
 LoadOrderGroup="Boot Bus Extender"
-AddReg = XenBus_Parameters, XenBus_Interrupts
+AddReg = XenBus_Parameters, XenBus_Interrupts, XenBus_Unplug
 
 [XenBus_Parameters]
 HKR,"Parameters",,0x00000010
@@ -107,6 +103,10 @@ HKR,"Interrupt Management\MessageSignaledInterruptProperties",,0x00000010
 HKR,"Interrupt Management\MessageSignaledInterruptProperties","MSISupported",0x00010001,1
 HKR,"Interrupt Management\GroupPolicy",,0x00010001,1
 
+[XenBus_Unplug]
+HKLM,%UnplugKey%,"NICS",0x00010001,0
+HKLM,%UnplugKey%,"DISKS",0x00010001,0
+
 [XenFilt_Service] 
 DisplayName=%XenFiltName%
 ServiceType=%SERVICE_KERNEL_DRIVER% 
@@ -144,13 +144,6 @@ AddReg=Monitor_EventLog_AddReg
 HKR,,EventMessageFile,0x00020000,"%%SystemRoot%%\System32\xenbus_monitor_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll"
 HKR,,TypesSupported,0x00010001,7
 
-[XenBus_Inst.CoInstallers]
-CopyFiles=CoInst_CopyFiles
-AddReg=CoInst_AddReg
-
-[CoInst_AddReg]
-HKR,,CoInstallers32,0x00010000,"xenbus_coinst_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll,Entry"
-
 [Strings] 
 
 Vendor="@VENDOR_NAME@" 
@@ -160,6 +153,7 @@ XenFiltName="@PRODUCT_NAME@ Generic Bus Filter"
 MonitorName="@PRODUCT_NAME@ PV Driver Monitor"
 MonitorDesc="Provides support for @PRODUCT_NAME@ PV drivers"
 RequestKey="SYSTEM\CurrentControlSet\Services\xenbus_monitor\Request"
+UnplugKey="SYSTEM\CurrentControlSet\Services\XEN\Unplug"
 DialogTitle="@PRODUCT_NAME@"
 DialogText="needs to restart the system to complete installation."
 DialogQuestion="Press 'Yes' to restart the system now or 'No' if you plan to restart the system later."
-- 
2.41.0.windows.3



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:29:47 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:29:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593405.926432 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbc7f-0000ov-MT; Thu, 31 Aug 2023 07:29:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593405.926432; Thu, 31 Aug 2023 07:29:47 +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 1qbc7f-0000oh-F8; Thu, 31 Aug 2023 07:29:47 +0000
Received: by outflank-mailman (input) for mailman id 593405;
 Thu, 31 Aug 2023 07:29:46 +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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbc7e-0000gZ-2l
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:29:46 +0000
Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com
 [2a00:1450:4864:20::42c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2789cdfd-47d0-11ee-8783-cb3800f73035;
 Thu, 31 Aug 2023 09:29:43 +0200 (CEST)
Received: by mail-wr1-x42c.google.com with SMTP id
 ffacd0b85a97d-31768ce2e81so355054f8f.1
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:29:43 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 p15-20020a5d68cf000000b0031416362e23sm1224278wrw.3.2023.08.31.00.29.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Aug 2023 00:29: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: 2789cdfd-47d0-11ee-8783-cb3800f73035
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693466983; x=1694071783; 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=JMd3gczAs7JD06u/z8Wh/a1j8wusp/GsfyomL3izWPI=;
        b=hwwt/hMRbrOWfECsRlm1UwY7uPbouk6Xeh82Aq3CykB89HxM3mXXasHwIBVRVjabLm
         2LIIsy/c1qkYzbew+yql1hi/l/B8+Eoumn2ewdrAHC7xXiFboBeiyzjhYAYLQmyIFSEa
         gjiKFZPn/L24s5AnA823dmSBnIJ8mU6Nyw/1U=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693466983; x=1694071783;
        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=JMd3gczAs7JD06u/z8Wh/a1j8wusp/GsfyomL3izWPI=;
        b=hMyCJ31hVPPJRbf4NHYhr2pr4rfuvvrrmzlcEsfUvDThkDGQw5JmxRYPX0xoJrYZ3x
         6UeRiaOwmEuRhN9+oCKoKkvA1D9Fl4rU+Od++bWSL9SzG1twZ4Ag4EzIJ60E1qihDsr/
         LyiCdWsyOVHfqU0Uc2zrKu6UbI6kAGEC7C4S1YYGbfd06iACXY3nUcG+XrSqYCUZYsuv
         N2q+Iy/z7FzsgR1FFoIHMR4Qh+OgdGdjRlwcqb8i7l5GCsMJKKPsi9zhz0VAAc4TT4PI
         OFWODKc4Anm2Xd3D9zVDijqmJpur8qd2B/Mq8qGYcQ3tQSiox+VzAlN4Ekg2NTSdX93I
         7mQg==
X-Gm-Message-State: AOJu0Yx/KgJXPFfa82zznth3vlPaxPtX7f2gAsYv5D6k3qpvbqnCIkfk
	6kRd/9lxkRNf2b53/LxRGG+sU16BSNf5Vpd2+Oj9
X-Google-Smtp-Source: AGHT+IGyVUCZs7rYHc+eQoc2Z5VZkbpjqj9l/IaEknibBd5G3ejDco5FeLWNLuLzb6Q94IwUsjObxA==
X-Received: by 2002:a05:6000:110e:b0:313:e88d:e6cf with SMTP id z14-20020a056000110e00b00313e88de6cfmr2955917wrw.69.1693466981933;
        Thu, 31 Aug 2023 00:29:41 -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 3/6] Delete CoInstaller code
Date: Thu, 31 Aug 2023 08:29:18 +0100
Message-ID: <20230831072921.1258-4-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.3
In-Reply-To: <20230831072921.1258-1-owen.smith@cloud.com>
References: <20230831072921.1258-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

With the CoInstaller removed from the INF file, delete the CoInstaller
source code and projects.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/coinst/coinst.c                           | 2136 -----------------
 src/coinst/xenbus_coinst.def                  |   38 -
 src/coinst/xenbus_coinst.rc                   |   57 -
 vs2015/package/package.vcxproj                |    3 -
 vs2015/xenbus.sln                             |   22 -
 vs2015/xenbus_coinst/xenbus_coinst.vcxproj    |   64 -
 .../xenbus_coinst/xenbus_coinst.vcxproj.user  |    8 -
 vs2017/package/package.vcxproj                |    3 -
 vs2017/xenbus.sln                             |   22 -
 vs2017/xenbus_coinst/xenbus_coinst.vcxproj    |   64 -
 .../xenbus_coinst/xenbus_coinst.vcxproj.user  |    8 -
 vs2019/package/package.vcxproj                |    3 -
 vs2019/xenbus.sln                             |   22 -
 vs2019/xenbus_coinst/xenbus_coinst.vcxproj    |   70 -
 .../xenbus_coinst/xenbus_coinst.vcxproj.user  |    8 -
 vs2022/package/package.vcxproj                |    3 -
 vs2022/xenbus.sln                             |   22 -
 vs2022/xenbus_coinst/xenbus_coinst.vcxproj    |   70 -
 .../xenbus_coinst/xenbus_coinst.vcxproj.user  |    8 -
 19 files changed, 2631 deletions(-)
 delete mode 100644 src/coinst/coinst.c
 delete mode 100644 src/coinst/xenbus_coinst.def
 delete mode 100644 src/coinst/xenbus_coinst.rc
 delete mode 100644 vs2015/xenbus_coinst/xenbus_coinst.vcxproj
 delete mode 100644 vs2015/xenbus_coinst/xenbus_coinst.vcxproj.user
 delete mode 100644 vs2017/xenbus_coinst/xenbus_coinst.vcxproj
 delete mode 100644 vs2017/xenbus_coinst/xenbus_coinst.vcxproj.user
 delete mode 100644 vs2019/xenbus_coinst/xenbus_coinst.vcxproj
 delete mode 100644 vs2019/xenbus_coinst/xenbus_coinst.vcxproj.user
 delete mode 100644 vs2022/xenbus_coinst/xenbus_coinst.vcxproj
 delete mode 100644 vs2022/xenbus_coinst/xenbus_coinst.vcxproj.user

diff --git a/src/coinst/coinst.c b/src/coinst/coinst.c
deleted file mode 100644
index caa1102..0000000
--- a/src/coinst/coinst.c
+++ /dev/null
@@ -1,2136 +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.
- */
-
-#define INITGUID
-
-#include <windows.h>
-#include <setupapi.h>
-#include <devguid.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strsafe.h>
-#include <malloc.h>
-#include <assert.h>
-
-#include <version.h>
-#include <revision.h>
-
-#define stringify_literal(_text) #_text
-#define stringify(_text) stringify_literal(_text)
-#define __MODULE__ stringify(PROJECT)
-
-__user_code;
-
-#define MAXIMUM_BUFFER_SIZE 1024
-
-#define SERVICES_KEY "SYSTEM\\CurrentControlSet\\Services"
-
-#define SERVICE_KEY(_Driver)    \
-        SERVICES_KEY ## "\\" ## #_Driver
-
-#define PARAMETERS_KEY(_Driver) \
-        SERVICE_KEY(_Driver) ## "\\Parameters"
-
-#define UNPLUG_KEY \
-        SERVICE_KEY(XEN) ## "\\Unplug"
-
-#define CONTROL_KEY "SYSTEM\\CurrentControlSet\\Control"
-
-#define CLASS_KEY   \
-        CONTROL_KEY ## "\\Class"
-
-#define ENUM_KEY    "SYSTEM\\CurrentControlSet\\Enum"
-
-#define MONITOR_NAME    "XENBUS_MONITOR"
-
-static VOID
-#pragma prefast(suppress:6262) // Function uses '1036' bytes of stack: exceeds /analyze:stacksize'1024'
-__Log(
-    IN  const CHAR  *Format,
-    IN  ...
-    )
-{
-    TCHAR               Buffer[MAXIMUM_BUFFER_SIZE];
-    va_list             Arguments;
-    size_t              Length;
-    SP_LOG_TOKEN        LogToken;
-    DWORD               Category;
-    DWORD               Flags;
-    HRESULT             Result;
-
-    va_start(Arguments, Format);
-    Result = StringCchVPrintf(Buffer, MAXIMUM_BUFFER_SIZE, Format, Arguments);
-    va_end(Arguments);
-
-    if (Result != S_OK && Result != STRSAFE_E_INSUFFICIENT_BUFFER)
-        return;
-
-    Result = StringCchLength(Buffer, MAXIMUM_BUFFER_SIZE, &Length);
-    if (Result != S_OK)
-        return;
-
-    LogToken = SetupGetThreadLogToken();
-    Category = TXTLOG_VENDOR;
-    Flags = TXTLOG_WARNING;
-
-    SetupWriteTextLog(LogToken, Category, Flags, Buffer);
-    Length = __min(MAXIMUM_BUFFER_SIZE - 1, Length + 2);
-
-    __analysis_assume(Length < MAXIMUM_BUFFER_SIZE);
-    __analysis_assume(Length >= 2);
-    Buffer[Length] = '\0';
-    Buffer[Length - 1] = '\n';
-    Buffer[Length - 2] = '\r';
-
-    OutputDebugString(Buffer);
-}
-
-#define Log(_Format, ...) \
-        __Log(__MODULE__ "|" __FUNCTION__ ": " _Format, __VA_ARGS__)
-
-static PTCHAR
-GetErrorMessage(
-    IN  DWORD   Error
-    )
-{
-    PTCHAR      Message;
-    ULONG       Index;
-
-    if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                       FORMAT_MESSAGE_FROM_SYSTEM |
-                       FORMAT_MESSAGE_IGNORE_INSERTS,
-                       NULL,
-                       Error,
-                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                       (LPTSTR)&Message,
-                       0,
-                       NULL))
-        return NULL;
-
-    for (Index = 0; Message[Index] != '\0'; Index++) {
-        if (Message[Index] == '\r' || Message[Index] == '\n') {
-            Message[Index] = '\0';
-            break;
-        }
-    }
-
-    return Message;
-}
-
-static FORCEINLINE const CHAR *
-__FunctionName(
-    IN  DI_FUNCTION Function
-    )
-{
-#define _NAME(_Function)        \
-        case DIF_ ## _Function: \
-            return #_Function;
-
-    switch (Function) {
-    _NAME(INSTALLDEVICE);
-    _NAME(REMOVE);
-    _NAME(SELECTDEVICE);
-    _NAME(ASSIGNRESOURCES);
-    _NAME(PROPERTIES);
-    _NAME(FIRSTTIMESETUP);
-    _NAME(FOUNDDEVICE);
-    _NAME(SELECTCLASSDRIVERS);
-    _NAME(VALIDATECLASSDRIVERS);
-    _NAME(INSTALLCLASSDRIVERS);
-    _NAME(CALCDISKSPACE);
-    _NAME(DESTROYPRIVATEDATA);
-    _NAME(VALIDATEDRIVER);
-    _NAME(MOVEDEVICE);
-    _NAME(DETECT);
-    _NAME(INSTALLWIZARD);
-    _NAME(DESTROYWIZARDDATA);
-    _NAME(PROPERTYCHANGE);
-    _NAME(ENABLECLASS);
-    _NAME(DETECTVERIFY);
-    _NAME(INSTALLDEVICEFILES);
-    _NAME(ALLOW_INSTALL);
-    _NAME(SELECTBESTCOMPATDRV);
-    _NAME(REGISTERDEVICE);
-    _NAME(NEWDEVICEWIZARD_PRESELECT);
-    _NAME(NEWDEVICEWIZARD_SELECT);
-    _NAME(NEWDEVICEWIZARD_PREANALYZE);
-    _NAME(NEWDEVICEWIZARD_POSTANALYZE);
-    _NAME(NEWDEVICEWIZARD_FINISHINSTALL);
-    _NAME(INSTALLINTERFACES);
-    _NAME(DETECTCANCEL);
-    _NAME(REGISTER_COINSTALLERS);
-    _NAME(ADDPROPERTYPAGE_ADVANCED);
-    _NAME(ADDPROPERTYPAGE_BASIC);
-    _NAME(TROUBLESHOOTER);
-    _NAME(POWERMESSAGEWAKE);
-    default:
-        break;
-    }
-
-    return "UNKNOWN";
-
-#undef  _NAME
-}
-
-static BOOLEAN
-AllowUpdate(
-    IN  PTCHAR      DriverName,
-    OUT PBOOLEAN    Allow
-    )
-{
-    TCHAR           ServiceKeyName[MAX_PATH];
-    HKEY            ServiceKey;
-    HRESULT         Result;
-    HRESULT         Error;
-    DWORD           ValueLength;
-    DWORD           Value;
-    DWORD           Type;
-
-    Log("====> (%s)", DriverName);
-
-    Result = StringCbPrintf(ServiceKeyName,
-                            MAX_PATH,
-                            SERVICES_KEY "\\%s",
-                            DriverName);
-    assert(SUCCEEDED(Result));
-
-    Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                         ServiceKeyName,
-                         0,
-                         KEY_READ,
-                         &ServiceKey);
-    if (Error != ERROR_SUCCESS) {
-        if (Error == ERROR_FILE_NOT_FOUND) {
-            Value = 1;
-            goto done;
-        }
-
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    ValueLength = sizeof (Value);
-
-    Error = RegQueryValueEx(ServiceKey,
-                            "AllowUpdate",
-                            NULL,
-                            &Type,
-                            (LPBYTE)&Value,
-                            &ValueLength);
-    if (Error != ERROR_SUCCESS) {
-        if (Error == ERROR_FILE_NOT_FOUND) {
-            Type = REG_DWORD;
-            Value = 1;
-        } else {
-            SetLastError(Error);
-            goto fail2;
-        }
-    }
-
-    if (Type != REG_DWORD) {
-        SetLastError(ERROR_BAD_FORMAT);
-        goto fail3;
-    }
-
-    RegCloseKey(ServiceKey);
-
-done:
-    if (Value == 0) {
-        Log("DISALLOWED");
-        *Allow = FALSE;
-    }
-
-    Log("<====");
-
-    return TRUE;
-
-fail3:
-    Log("fail3");
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(ServiceKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-AllowInstall(
-    OUT PBOOLEAN    Allow
-    )
-{
-    BOOLEAN         Success;
-    HRESULT         Error;
-
-    Log("====>");
-
-    *Allow = TRUE;
-
-    Success = AllowUpdate("XEN", Allow);
-    if (!Success)
-        goto fail1;
-
-    Success = AllowUpdate("XENBUS", Allow);
-    if (!Success)
-        goto fail2;
-
-    Success = AllowUpdate("XENFILT", Allow);
-    if (!Success)
-        goto fail3;
-
-    Log("<====");
-
-    return TRUE;
-
-fail3:
-    Log("fail3");
-
-fail2:
-    Log("fail2");
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-OpenEnumKey(
-    OUT PHKEY   EnumKey
-    )
-{
-    HRESULT     Error;
-
-    Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                         ENUM_KEY,
-                         0,
-                         KEY_READ,
-                         EnumKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    return TRUE;
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-OpenBusKey(
-    IN  PTCHAR  BusKeyName,
-    OUT PHKEY   BusKey
-    )
-{
-    BOOLEAN     Success;
-    HKEY        EnumKey;
-    HRESULT     Error;
-
-    Success = OpenEnumKey(&EnumKey);
-    if (!Success)
-        goto fail1;
-
-    Error = RegOpenKeyEx(EnumKey,
-                         BusKeyName,
-                         0,
-                         KEY_READ,
-                         BusKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    RegCloseKey(EnumKey);
-
-    return TRUE;
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(EnumKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-GetDeviceKeyName(
-    IN  PTCHAR  BusKeyName,
-    IN  PTCHAR  DeviceKeyPrefix,
-    OUT PTCHAR  *DeviceKeyName
-    )
-{
-    BOOLEAN     Success;
-    HKEY        BusKey;
-    HRESULT     Error;
-    DWORD       SubKeys;
-    DWORD       MaxSubKeyLength;
-    DWORD       SubKeyLength;
-    PTCHAR      SubKeyName;
-    DWORD       Index;
-
-    Success = OpenBusKey(BusKeyName, &BusKey);
-    if (!Success)
-        goto fail1;
-
-    Error = RegQueryInfoKey(BusKey,
-                            NULL,
-                            NULL,
-                            NULL,
-                            &SubKeys,
-                            &MaxSubKeyLength,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    SubKeyLength = MaxSubKeyLength + sizeof (TCHAR);
-
-    SubKeyName = malloc(SubKeyLength);
-    if (SubKeyName == NULL)
-        goto fail3;
-
-    for (Index = 0; Index < SubKeys; Index++) {
-        SubKeyLength = MaxSubKeyLength + sizeof (TCHAR);
-        memset(SubKeyName, 0, SubKeyLength);
-
-        Error = RegEnumKeyEx(BusKey,
-                             Index,
-                             (LPTSTR)SubKeyName,
-                             &SubKeyLength,
-                             NULL,
-                             NULL,
-                             NULL,
-                             NULL);
-        if (Error != ERROR_SUCCESS) {
-            SetLastError(Error);
-            goto fail4;
-        }
-
-        if (strncmp(SubKeyName, DeviceKeyPrefix, strlen(DeviceKeyPrefix)) == 0)
-            goto found;
-    }
-
-    free(SubKeyName);
-    SubKeyName = NULL;
-
-found:
-    RegCloseKey(BusKey);
-
-    Log("%s", (SubKeyName != NULL) ? SubKeyName : "none found");
-
-    *DeviceKeyName = SubKeyName;
-    return TRUE;
-
-fail4:
-    Log("fail4");
-
-    free(SubKeyName);
-
-fail3:
-    Log("fail3");
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(BusKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-#define XEN_PLATFORM_PCI_DEVICE_STR         "VEN_5853&DEV_0001"
-#define XENSERVER_PLATFORM_PCI_DEVICE_STR   "VEN_5853&DEV_0002"
-
-static BOOLEAN
-OpenDeviceKey(
-    IN  PTCHAR  BusKeyName,
-    IN  PTCHAR  DeviceKeyName,
-    OUT PHKEY   DeviceKey
-    )
-{
-    BOOLEAN     Success;
-    HKEY        BusKey;
-    HRESULT     Error;
-
-    Success = OpenBusKey(BusKeyName, &BusKey);
-    if (!Success)
-        goto fail1;
-
-    Error = RegOpenKeyEx(BusKey,
-                         DeviceKeyName,
-                         0,
-                         KEY_READ,
-                         DeviceKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    RegCloseKey(BusKey);
-
-    return TRUE;
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(BusKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-GetDriverKeyName(
-    IN  HKEY    DeviceKey,
-    OUT PTCHAR  *Name,
-    OUT DWORD   *ConfigFlags
-    )
-{
-    HRESULT     Error;
-    DWORD       SubKeys;
-    DWORD       MaxSubKeyLength;
-    DWORD       SubKeyLength;
-    PTCHAR      SubKeyName;
-    DWORD       Index;
-    HKEY        SubKey;
-    PTCHAR      DriverKeyName;
-    DWORD       Flags;
-
-    Error = RegQueryInfoKey(DeviceKey,
-                            NULL,
-                            NULL,
-                            NULL,
-                            &SubKeys,
-                            &MaxSubKeyLength,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    SubKeyLength = MaxSubKeyLength + sizeof (TCHAR);
-
-    SubKeyName = malloc(SubKeyLength);
-    if (SubKeyName == NULL)
-        goto fail2;
-
-    SubKey = NULL;
-    DriverKeyName = NULL;
-    Flags = 0;
-
-    for (Index = 0; Index < SubKeys; Index++) {
-        DWORD       MaxValueLength;
-        DWORD       ConfigFlagsLength;
-        DWORD       DriverKeyNameLength;
-        DWORD       Type;
-
-        SubKeyLength = MaxSubKeyLength + sizeof (TCHAR);
-        memset(SubKeyName, 0, SubKeyLength);
-
-        Error = RegEnumKeyEx(DeviceKey,
-                             Index,
-                             (LPTSTR)SubKeyName,
-                             &SubKeyLength,
-                             NULL,
-                             NULL,
-                             NULL,
-                             NULL);
-        if (Error != ERROR_SUCCESS) {
-            SetLastError(Error);
-            goto fail3;
-        }
-
-        Error = RegOpenKeyEx(DeviceKey,
-                             SubKeyName,
-                             0,
-                             KEY_READ,
-                             &SubKey);
-        if (Error != ERROR_SUCCESS) {
-            SubKey = NULL;
-            continue;
-        }
-
-        Error = RegQueryInfoKey(SubKey,
-                                NULL,
-                                NULL,
-                                NULL,    
-                                NULL,
-                                NULL,
-                                NULL,
-                                NULL,
-                                NULL,
-                                &MaxValueLength,
-                                NULL,
-                                NULL);
-        if (Error != ERROR_SUCCESS) {
-            SetLastError(Error);
-            goto fail4;
-        }
-
-        ConfigFlagsLength = (DWORD)sizeof(DWORD);
-
-        Error = RegQueryValueEx(SubKey,
-                                "ConfigFlags",
-                                NULL,
-                                &Type,
-                                (LPBYTE)&Flags,
-                                &ConfigFlagsLength);
-        if (Error != ERROR_SUCCESS ||
-            Type != REG_DWORD)
-            Flags = 0;
-
-        DriverKeyNameLength = MaxValueLength + sizeof (TCHAR);
-
-        DriverKeyName = calloc(1, DriverKeyNameLength);
-        if (DriverKeyName == NULL)
-            goto fail5;
-
-        Error = RegQueryValueEx(SubKey,
-                                "Driver",
-                                NULL,
-                                &Type,
-                                (LPBYTE)DriverKeyName,
-                                &DriverKeyNameLength);
-        if (Error == ERROR_SUCCESS &&
-            Type == REG_SZ)
-            break;
-
-        free(DriverKeyName);
-        DriverKeyName = NULL;
-        Flags = 0;
-
-        RegCloseKey(SubKey);
-        SubKey = NULL;
-    }
-
-    Log("%s", (DriverKeyName != NULL) ? DriverKeyName : "none found");
-
-    if (SubKey != NULL)
-        RegCloseKey(SubKey);
-
-    free(SubKeyName);
-
-    *Name = DriverKeyName;
-    if (ConfigFlags)
-        *ConfigFlags = Flags;
-    return TRUE;
-
-fail5:
-    Log("fail5");
-
-fail4:
-    Log("fail4");
-
-    if (SubKey != NULL)
-        RegCloseKey(SubKey);
-
-fail3:
-    Log("fail3");
-
-    free(SubKeyName);
-
-fail2:
-    Log("fail2");
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-OpenClassKey(
-    OUT PHKEY   ClassKey
-    )
-{
-    HRESULT     Error;
-
-    Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                         CLASS_KEY,
-                         0,
-                         KEY_READ,
-                         ClassKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    return TRUE;
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-OpenDriverKey(
-    IN  PTCHAR  DriverKeyName,
-    OUT PHKEY   DriverKey
-    )
-{
-    BOOLEAN     Success;
-    HKEY        ClassKey;
-    HRESULT     Error;
-
-    Success = OpenClassKey(&ClassKey);
-    if (!Success)
-        goto fail1;
-
-    Error = RegOpenKeyEx(ClassKey,
-                         DriverKeyName,
-                         0,
-                         KEY_READ,
-                         DriverKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    RegCloseKey(ClassKey);
-
-    return TRUE;
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(ClassKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-MatchExistingDriver(
-    VOID
-    )
-{
-    BOOLEAN Success;
-    PTCHAR  DeviceKeyName = NULL;
-    HKEY    DeviceKey = NULL;
-    PTCHAR  DriverKeyName = NULL;
-    HKEY    DriverKey = NULL;
-    HRESULT Error;
-    DWORD   MaxValueLength;
-    DWORD   DriverDescLength;
-    PTCHAR  DriverDesc = NULL;
-    DWORD   ProductNameLength;
-    DWORD   Type;
-
-    Log("====>");
-
-    // Look for a legacy platform device
-    Success = GetDeviceKeyName("PCI",
-                               XEN_PLATFORM_PCI_DEVICE_STR,
-                               &DeviceKeyName);
-    if (!Success)
-        goto fail1;
-
-    if (DeviceKeyName != NULL)
-        goto found;
-
-    Success = GetDeviceKeyName("PCI",
-                               XENSERVER_PLATFORM_PCI_DEVICE_STR,
-                               &DeviceKeyName);
-    if (!Success)
-        goto fail2;
-
-    if (DeviceKeyName != NULL)
-        goto found;
-
-    // No legacy platform device
-    goto done;
-
-found:
-    Success = OpenDeviceKey("PCI", DeviceKeyName, &DeviceKey);
-    if (!Success)
-        goto fail3;
-
-    // Check for a bound driver
-    Success = GetDriverKeyName(DeviceKey, &DriverKeyName, NULL);
-    if (!Success)
-        goto fail4;
-
-    if (DriverKeyName == NULL)
-        goto done;
-
-    Success = OpenDriverKey(DriverKeyName, &DriverKey);
-    if (!Success)
-        goto done;
-
-    Error = RegQueryInfoKey(DriverKey,
-                            NULL,
-                            NULL,
-                            NULL,    
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            &MaxValueLength,
-                            NULL,
-                            NULL);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail5;
-    }
-
-    DriverDescLength = MaxValueLength + sizeof (TCHAR);
-
-    DriverDesc = calloc(1, DriverDescLength);
-    if (DriverDesc == NULL)
-        goto fail6;
-
-    Error = RegQueryValueEx(DriverKey,
-                            "DriverDesc",
-                            NULL,
-                            &Type,
-                            (LPBYTE)DriverDesc,
-                            &DriverDescLength);
-    if (Error != ERROR_SUCCESS) {
-        if (Error == ERROR_FILE_NOT_FOUND)
-            goto done;
-
-        SetLastError(Error);
-        goto fail7;
-    }
-
-    if (Type != REG_SZ) {
-        SetLastError(ERROR_BAD_FORMAT);
-        goto fail8;
-    }
-
-    ProductNameLength = (DWORD)strlen(PRODUCT_NAME_STR);
-
-    if (strncmp(DriverDesc,
-                PRODUCT_NAME_STR,
-                ProductNameLength) != 0) {
-        SetLastError(ERROR_INSTALL_FAILURE);
-        goto fail9;
-    }
-
-    if (strcmp(DriverDesc + ProductNameLength,
-               " PV Bus") != 0) {
-        SetLastError(ERROR_INSTALL_FAILURE);
-        goto fail10;
-    }
-
-done:
-    if (DriverDesc != NULL) {
-        free(DriverDesc);
-        RegCloseKey(DriverKey);
-    }
-
-    if (DriverKeyName != NULL) {
-        free(DriverKeyName);
-        RegCloseKey(DeviceKey);
-    }
-
-    if (DeviceKeyName != NULL)
-        free(DeviceKeyName);
-
-    Log("<====");
-
-    return TRUE;
-
-fail10:
-    Log("fail10");
-
-fail9:
-    Log("fail9");
-
-fail8:
-    Log("fail8");
-
-fail7:
-    Log("fail7");
-
-    free(DriverDesc);
-
-fail6:
-    Log("fail6");
-
-fail5:
-    Log("fail5");
-
-    RegCloseKey(DriverKey);
-
-    free(DriverKeyName);
-
-fail4:
-    Log("fail4");
-
-    RegCloseKey(DeviceKey);
-
-fail3:
-    Log("fail3");
-
-    free(DeviceKeyName);
-
-fail2:
-    Log("fail2");
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-#define DEFINE_REVISION(_N, _S, _SI, _E, _D, _ST, _R, _C, _G, _U, _CO, _EM) \
-    (_N)
-
-static DWORD    DeviceRevision[] = {
-    DEFINE_REVISION_TABLE
-};
-
-#undef DEFINE_REVISION
-
-static BOOLEAN
-SupportDeviceID(
-    IN  PTCHAR      DeviceID,
-    OUT PBOOLEAN    NewBinding
-    )
-{
-    unsigned int    Revision;
-    int             Count;
-    DWORD           Index;
-    HRESULT         Error;
-
-    DeviceID = strrchr(DeviceID, '&');
-    assert(DeviceID != NULL);
-    DeviceID++;
-
-    Count = sscanf_s(DeviceID,
-                     "REV_%8x",
-                     &Revision);
-    if (Count != 1) {
-        SetLastError(ERROR_BAD_FORMAT);
-        goto fail1;
-    }
-
-    for (Index = 0; Index < ARRAYSIZE(DeviceRevision); Index++) {
-        if (Revision == DeviceRevision[Index])
-            goto found;
-    }
-
-    SetLastError(ERROR_FILE_NOT_FOUND);
-    goto fail2;
-
-found:
-    // If we don't match the latest revision then it means the driver
-    // binding will change.
-    if (Index < ARRAYSIZE(DeviceRevision) - 1)
-        *NewBinding = TRUE;
-
-    Log("%x", Revision);
-
-    return TRUE;
-
-fail2:
-    Log("fail2");
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-GetMatchingDeviceID(
-    IN  HKEY    DriverKey,
-    OUT PTCHAR  *MatchingDeviceID
-    )
-{
-    HRESULT     Error;
-    DWORD       MaxValueLength;
-    DWORD       MatchingDeviceIDLength;
-    DWORD       Type;
-    DWORD       Index;
-
-    Error = RegQueryInfoKey(DriverKey,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            &MaxValueLength,
-                            NULL,
-                            NULL);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    MatchingDeviceIDLength = MaxValueLength + sizeof (TCHAR);
-
-    *MatchingDeviceID = calloc(1, MatchingDeviceIDLength);
-    if (*MatchingDeviceID == NULL)
-        goto fail2;
-
-    Error = RegQueryValueEx(DriverKey,
-                            "MatchingDeviceId",
-                            NULL,
-                            &Type,
-                            (LPBYTE)*MatchingDeviceID,
-                            &MatchingDeviceIDLength);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail3;
-    }
-
-    if (Type != REG_SZ) {
-        SetLastError(ERROR_BAD_FORMAT);
-        goto fail4;
-    }
-
-    for (Index = 0; Index < strlen(*MatchingDeviceID); Index++)
-        (*MatchingDeviceID)[Index] = (CHAR)toupper((*MatchingDeviceID)[Index]);
-
-    Log("%s", *MatchingDeviceID);
-
-    return TRUE;
-
-fail4:
-    Log("fail4");
-
-fail3:
-    Log("fail3");
-
-    free(*MatchingDeviceID);
-
-fail2:
-    Log("fail2");
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-GetDeviceInstanceID(
-    IN  HDEVINFO            DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA    DeviceInfoData,
-    OUT PTCHAR              *DeviceID,
-    OUT PTCHAR              *InstanceID
-    )
-{
-    DWORD                   DeviceInstanceIDLength;
-    PTCHAR                  DeviceInstanceID;
-    DWORD                   Index;
-    PTCHAR                  Prefix;
-    DWORD                   InstanceIDLength;
-    HRESULT                 Result;
-    HRESULT                 Error;
-
-    if (!SetupDiGetDeviceInstanceId(DeviceInfoSet,
-                                    DeviceInfoData,
-                                    NULL,
-                                    0,
-                                    &DeviceInstanceIDLength)) {
-        if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
-            goto fail1;
-    }
-
-    DeviceInstanceIDLength += sizeof (TCHAR);
-
-    DeviceInstanceID = calloc(1, DeviceInstanceIDLength);
-    if (DeviceInstanceID == NULL)
-        goto fail2;
-
-    if (!SetupDiGetDeviceInstanceId(DeviceInfoSet,
-                                    DeviceInfoData,
-                                    DeviceInstanceID,
-                                    DeviceInstanceIDLength,
-                                    NULL))
-        goto fail3;
-
-    for (Index = 0; Index < strlen(DeviceInstanceID); Index++)
-        DeviceInstanceID[Index] = (CHAR)toupper(DeviceInstanceID[Index]);
-
-    *DeviceID = DeviceInstanceID;
-
-    Prefix = strrchr(DeviceInstanceID, '\\');
-    assert(Prefix != NULL);
-    *Prefix++ = '\0';
-
-    DeviceInstanceID = strrchr(Prefix, '&');
-    if (DeviceInstanceID != NULL) {
-        *DeviceInstanceID++ = '\0';
-    } else {
-        DeviceInstanceID = Prefix;
-        Prefix = NULL;
-    }
-
-    if (Prefix != NULL)
-        Log("Parent Prefix = %s", Prefix);
-
-    InstanceIDLength = (ULONG)((strlen(DeviceInstanceID) +
-                                1) * sizeof (TCHAR));
-
-    *InstanceID = calloc(1, InstanceIDLength);
-    if (*InstanceID == NULL)
-        goto fail4;
-
-    Result = StringCbPrintf(*InstanceID,
-                            InstanceIDLength,
-                            "%s",
-                            DeviceInstanceID);
-    assert(SUCCEEDED(Result));
-
-    Log("DeviceID = %s", *DeviceID);
-    Log("InstanceID = %s", *InstanceID);
-
-    return TRUE;
-
-fail4:
-    Log("fail4");
-
-    DeviceInstanceID = *DeviceID;
-    *DeviceID = NULL;
-
-fail3:
-    Log("fail3");
-
-    free(DeviceInstanceID);
-
-fail2:
-    Log("fail2");
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-GetActiveDeviceInstanceID(
-    OUT PTCHAR  *DeviceID,
-    OUT PTCHAR  *InstanceID
-    )
-{
-    HKEY        ParametersKey;
-    DWORD       MaxValueLength;
-    DWORD       DeviceIDLength;
-    DWORD       InstanceIDLength;
-    DWORD       Type;
-    HRESULT     Error;
-
-    Error = RegCreateKeyEx(HKEY_LOCAL_MACHINE,
-                           PARAMETERS_KEY(XENFILT),
-                           0,
-                           NULL,
-                           REG_OPTION_NON_VOLATILE,
-                           KEY_ALL_ACCESS,
-                           NULL,
-                           &ParametersKey,
-                           NULL);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    Error = RegQueryInfoKey(ParametersKey,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            &MaxValueLength,
-                            NULL,
-                            NULL);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    DeviceIDLength = MaxValueLength + sizeof (TCHAR);
-
-    *DeviceID = calloc(1, DeviceIDLength);
-    if (*DeviceID == NULL)
-        goto fail3;
-
-    Error = RegQueryValueEx(ParametersKey,
-                            "ActiveDeviceID",
-                            NULL,
-                            &Type,
-                            (LPBYTE)*DeviceID,
-                            &DeviceIDLength);
-    if (Error != ERROR_SUCCESS || Type != REG_SZ) {
-        free(*DeviceID);
-        *DeviceID = NULL;
-    }
-
-    InstanceIDLength = MaxValueLength + sizeof (TCHAR);
-
-    *InstanceID = calloc(1, InstanceIDLength);
-    if (*InstanceID == NULL)
-        goto fail4;
-
-    Error = RegQueryValueEx(ParametersKey,
-                            "ActiveInstanceID",
-                            NULL,
-                            &Type,
-                            (LPBYTE)*InstanceID,
-                            &InstanceIDLength);
-    if (Error != ERROR_SUCCESS || Type != REG_SZ) {
-        free(*InstanceID);
-        *InstanceID = NULL;
-    }
-
-    Log("DeviceID = %s", (*DeviceID != NULL) ? *DeviceID : "NOT SET");
-    Log("InstanceID = %s", (*InstanceID != NULL) ? *InstanceID : "NOT SET");
-
-    RegCloseKey(ParametersKey);
-
-    return TRUE;
-
-fail4:
-    Log("fail4");
-
-    if (*DeviceID != NULL) {
-        free(*DeviceID);
-        *DeviceID = NULL;
-    }
-
-fail3:
-    Log("fail3");
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(ParametersKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-IsActiveDevice(
-    IN  HDEVINFO            DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA    DeviceInfoData,
-    OUT PBOOLEAN            ActiveDevice,
-    OUT PBOOLEAN            VendorIsActive
-    )
-{
-    PTCHAR                  ActiveDeviceID;
-    PTCHAR                  ActiveInstanceID;
-    PTCHAR                  DeviceID;
-    PTCHAR                  InstanceID;
-    HRESULT                 Error;
-    BOOLEAN                 Success;
-
-    Log("====>");
-
-    Success = GetActiveDeviceInstanceID(&ActiveDeviceID, &ActiveInstanceID);
-    if (!Success)
-        goto fail1;
-
-    if (ActiveDeviceID == NULL)
-        goto done;
-
-    assert(ActiveInstanceID != NULL);
-
-    Success = GetDeviceInstanceID(DeviceInfoSet, DeviceInfoData,
-                                  &DeviceID, &InstanceID);
-    if (!Success)
-        goto fail2;
-
-    *ActiveDevice = (_stricmp(ActiveDeviceID, DeviceID) == 0 &&
-                     _stricmp(ActiveInstanceID, InstanceID) == 0) ?
-        TRUE :
-        FALSE;
-
-#ifdef VENDOR_DEVICE_ID_STR
-
-#define DRIVER_VENDOR_DEVICE_ID "PCI\\VEN_5853&DEV_" ## VENDOR_DEVICE_ID_STR ## "&SUBSYS_C0005853&REV_01"
-
-    *VendorIsActive = (_stricmp(ActiveDeviceID, DRIVER_VENDOR_DEVICE_ID) == 0) ?
-        TRUE :
-        FALSE;
-
-#undef DRIVER_VENDOR_DEVICE_ID
-
-#else
-    *VendorIsActive = FALSE;
-#endif
-
-    free(DeviceID);
-    free(InstanceID);
-
-    free(ActiveDeviceID);
-    free(ActiveInstanceID);
-
-done:
-    Log("<====");
-
-    return TRUE;
-
-fail2:
-    Log("fail2");
-
-    free(ActiveDeviceID);
-    free(ActiveInstanceID);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-SupportChildDrivers(
-    OUT PBOOLEAN    NewBinding
-    )
-{
-    BOOLEAN         Success;
-    HKEY            XenbusKey;
-    HRESULT         Error;
-    DWORD           SubKeys;
-    DWORD           MaxSubKeyLength;
-    DWORD           SubKeyLength;
-    PTCHAR          SubKeyName;
-    HKEY            DeviceKey;
-    PTCHAR          DriverKeyName;
-    DWORD           ConfigFlags;
-    HKEY            DriverKey;
-    PTCHAR          MatchingDeviceID;
-    DWORD           Index;
-
-    Log("====>");
-
-    Success = OpenBusKey("XENBUS", &XenbusKey);
-    if (!Success) {
-        // If there is no key then this must be a fresh installation
-        if (GetLastError() == ERROR_FILE_NOT_FOUND)
-            goto done;
-
-        goto fail1;
-    }
-
-    Error = RegQueryInfoKey(XenbusKey,
-                            NULL,
-                            NULL,
-                            NULL,
-                            &SubKeys,
-                            &MaxSubKeyLength,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    SubKeyLength = MaxSubKeyLength + sizeof (TCHAR);
-
-    SubKeyName = malloc(SubKeyLength);
-    if (SubKeyName == NULL)
-        goto fail3;
-
-    for (Index = 0; Index < SubKeys; Index++) {
-        SubKeyLength = MaxSubKeyLength + sizeof (TCHAR);
-        memset(SubKeyName, 0, SubKeyLength);
-
-        Error = RegEnumKeyEx(XenbusKey,
-                             Index,
-                             (LPTSTR)SubKeyName,
-                             &SubKeyLength,
-                             NULL,
-                             NULL,
-                             NULL,
-                             NULL);
-        if (Error != ERROR_SUCCESS) {
-            SetLastError(Error);
-            goto fail4;
-        }
-
-        Success = OpenDeviceKey("XENBUS", SubKeyName, &DeviceKey);
-        if (!Success)
-            goto fail5;
-
-        Success = GetDriverKeyName(DeviceKey, &DriverKeyName, &ConfigFlags);
-        if (!Success)
-            goto fail6;
-
-        if (DriverKeyName == NULL)
-            goto loop1;
-
-        if (ConfigFlags & 0x20)
-            goto loop2;
-
-        Success = OpenDriverKey(DriverKeyName, &DriverKey);
-        if (!Success)
-            goto loop3;
-
-        Success = GetMatchingDeviceID(DriverKey, &MatchingDeviceID);
-        if (!Success)
-            goto loop4;
-
-        Success = SupportDeviceID(MatchingDeviceID, NewBinding);
-        if (!Success)
-            goto fail7;
-
-        free(MatchingDeviceID);
-
-    loop4:
-        RegCloseKey(DriverKey);
-
-    loop3:
-
-    loop2:
-        free(DriverKeyName);
-
-    loop1:
-        RegCloseKey(DeviceKey);
-    }
-
-    free(SubKeyName);
-
-    RegCloseKey(XenbusKey);
-
-done:
-    Log("<====");
-
-    return TRUE;
-
-fail7:
-    Log("fail7");
-
-    free(MatchingDeviceID);
-
-    RegCloseKey(DriverKey);
-
-    free(DriverKeyName);
-
-fail6:
-    Log("fail6");
-
-    RegCloseKey(DeviceKey);
-
-fail5:
-    Log("fail5");
-
-fail4:
-    Log("fail4");
-
-    free(SubKeyName);
-
-fail3:
-    Log("fail3");
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(XenbusKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-ClearUnplugRequest(
-    IN  PTCHAR      ClassName
-    )
-{
-    HKEY            UnplugKey;
-    HRESULT         Error;
-
-    Log("====> (%s)", ClassName);
-
-    Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                         UNPLUG_KEY,
-                         0,
-                         KEY_ALL_ACCESS,
-                         &UnplugKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    Error = RegDeleteValue(UnplugKey, ClassName);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    RegCloseKey(UnplugKey);
-
-    Log("<====");
-
-    return TRUE;
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(UnplugKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOL
-MonitorDelete(
-    VOID
-    )
-{
-    SC_HANDLE           SCManager;
-    SC_HANDLE           Service;
-    BOOL                Success;
-    SERVICE_STATUS      Status;
-    HRESULT             Error;
-
-    Log("====>");
-
-    SCManager = OpenSCManager(NULL,
-                              NULL,
-                              SC_MANAGER_ALL_ACCESS);
-
-    if (SCManager == NULL)
-        goto fail1;
-
-    Service = OpenService(SCManager,
-                          MONITOR_NAME,
-                          SERVICE_ALL_ACCESS);
-
-    if (Service == NULL)
-        goto fail2;
-
-    Success = ControlService(Service,
-                             SERVICE_CONTROL_STOP,
-                             &Status);
-
-    if (!Success &&
-        GetLastError() != ERROR_SERVICE_NOT_ACTIVE)
-        goto fail3;
-
-    Success = DeleteService(Service);
-
-    if (!Success)
-        goto fail4;
-
-    CloseServiceHandle(Service);
-    CloseServiceHandle(SCManager);
-
-    Log("<====");
-
-    return TRUE;
-
-fail4:
-    Log("fail4");
-
-fail3:
-    Log("fail3");
-
-    CloseServiceHandle(Service);
-
-fail2:
-    Log("fail2");
-
-    CloseServiceHandle(SCManager);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static HRESULT
-DifInstallPreProcess(
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    BOOLEAN                         Success;
-    HRESULT                         Error;
-    BOOLEAN                         Allow;
-    BOOLEAN                         NewBinding;
-
-    UNREFERENCED_PARAMETER(DeviceInfoSet);
-    UNREFERENCED_PARAMETER(DeviceInfoData);
-
-    Log("====>");
-
-    Success = AllowInstall(&Allow);
-    if (!Success)
-        goto fail1;
-
-    if (!Allow) {
-        SetLastError(ERROR_ACCESS_DENIED);
-        goto fail2;
-    }
-
-    Success = MatchExistingDriver();
-    if (!Success)
-        goto fail3;
-
-    NewBinding = FALSE;
-
-    Success = SupportChildDrivers(&NewBinding);
-    if (!Success)
-        goto fail4;
-
-    Context->PrivateData = (PVOID)(ULONG_PTR)NewBinding;
-
-    Log("<====");
-    
-    return NO_ERROR;
-
-fail4:
-    Log("fail4");
-
-fail3:
-    Log("fail3");
-
-fail2:
-    Log("fail2");
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return Error;
-}
-
-static HRESULT
-DifInstallPostProcess(
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    BOOLEAN                         NewBinding;
-    BOOLEAN                         Active;
-    BOOLEAN                         VendorIsActive;
-
-    Log("====>");
-
-    NewBinding = (BOOLEAN)(ULONG_PTR)Context->PrivateData;
-
-    Active = TRUE;
-
-    (VOID) IsActiveDevice(DeviceInfoSet,
-                          DeviceInfoData,
-                          &Active,
-                          &VendorIsActive);
-
-    Log("Active = %s", Active ? "TRUE" : "FALSE");
-    Log("NewBinding = %s", NewBinding ? "TRUE" : "FALSE");
-
-    if ((Active && NewBinding) || !VendorIsActive) {
-        (VOID) ClearUnplugRequest("DISKS");
-        (VOID) ClearUnplugRequest("NICS");
-    }
-
-    Log("<====");
-
-    return NO_ERROR;
-}
-
-static HRESULT
-DifInstall(
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    SP_DEVINSTALL_PARAMS            DeviceInstallParams;
-    HRESULT                         Error;
-
-    DeviceInstallParams.cbSize = sizeof (DeviceInstallParams);
-
-    if (!SetupDiGetDeviceInstallParams(DeviceInfoSet,
-                                       DeviceInfoData,
-                                       &DeviceInstallParams))
-        goto fail1;
-
-    Log("Flags = %08x", DeviceInstallParams.Flags);
-
-    if (!Context->PostProcessing) {
-        Error = DifInstallPreProcess(DeviceInfoSet, DeviceInfoData, Context);
-
-        if (Error == NO_ERROR)
-            Error = ERROR_DI_POSTPROCESSING_REQUIRED; 
-    } else {
-        Error = Context->InstallResult;
-        
-        if (Error == NO_ERROR) {
-            (VOID) DifInstallPostProcess(DeviceInfoSet, DeviceInfoData, Context);
-        } else {
-            PTCHAR  Message;
-
-            Message = GetErrorMessage(Error);
-            Log("NOT RUNNING (DifInstallPreProcess Error: %s)", Message);
-            LocalFree(Message);
-        }
-
-        Error = NO_ERROR; 
-    }
-
-    return Error;
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return Error;
-}
-
-static HRESULT
-DifRemovePreProcess(
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    UNREFERENCED_PARAMETER(DeviceInfoSet);
-    UNREFERENCED_PARAMETER(DeviceInfoData);
-    UNREFERENCED_PARAMETER(Context);
-
-    Log("====>");
-
-    (VOID) MonitorDelete();
-
-    Log("<====");
-
-    return NO_ERROR;
-}
-
-static HRESULT
-DifRemovePostProcess(
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    UNREFERENCED_PARAMETER(DeviceInfoSet);
-    UNREFERENCED_PARAMETER(DeviceInfoData);
-    UNREFERENCED_PARAMETER(Context);
-
-    Log("<===>");
-
-    return NO_ERROR;
-}
-
-static HRESULT
-DifRemove(
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    SP_DEVINSTALL_PARAMS            DeviceInstallParams;
-    HRESULT                         Error;
-
-    DeviceInstallParams.cbSize = sizeof (DeviceInstallParams);
-
-    if (!SetupDiGetDeviceInstallParams(DeviceInfoSet,
-                                       DeviceInfoData,
-                                       &DeviceInstallParams))
-        goto fail1;
-
-    Log("Flags = %08x", DeviceInstallParams.Flags);
-
-    if (!Context->PostProcessing) {
-        Error = DifRemovePreProcess(DeviceInfoSet, DeviceInfoData, Context);
-
-        if (Error == NO_ERROR)
-            Error = ERROR_DI_POSTPROCESSING_REQUIRED; 
-    } else {
-        Error = Context->InstallResult;
-        
-        if (Error == NO_ERROR) {
-            (VOID) DifRemovePostProcess(DeviceInfoSet, DeviceInfoData, Context);
-        } else {
-            PTCHAR  Message;
-
-            Message = GetErrorMessage(Error);
-            Log("NOT RUNNING (DifRemovePreProcess Error: %s)", Message);
-            LocalFree(Message);
-        }
-
-        Error = NO_ERROR; 
-    }
-
-    return Error;
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return Error;
-}
-
-DWORD CALLBACK
-Entry(
-    IN  DI_FUNCTION                 Function,
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    HRESULT                         Error;
-    SP_DRVINFO_DATA                 DriverInfoData;
-    BOOLEAN                         DriverInfoAvailable;
-    BOOLEAN                         IsNullDriver;
-
-    Log("%s (%s) ===>",
-        MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR,
-        DAY_STR "/" MONTH_STR "/" YEAR_STR);
-
-    if (!Context->PostProcessing) {
-        Log("%s PreProcessing",
-            __FunctionName(Function));
-    } else {
-        Log("%s PostProcessing (%08x)",
-            __FunctionName(Function),
-            Context->InstallResult);
-    }
-
-    DriverInfoData.cbSize = sizeof(DriverInfoData);
-    DriverInfoAvailable = SetupDiGetSelectedDriver(DeviceInfoSet,
-                                                   DeviceInfoData,
-                                                   &DriverInfoData) ?
-                          TRUE :
-                          FALSE;
-    IsNullDriver = !(DriverInfoAvailable &&
-                    (DriverInfoData.DriverType == SPDIT_CLASSDRIVER ||
-                     DriverInfoData.DriverType == SPDIT_COMPATDRIVER));
-
-    switch (Function) {
-	case DIF_SELECTBESTCOMPATDRV: {
-        //
-        // If the NULL driver will be installed, treat this as we would a
-        // DIF_REMOVE to work around the fact that Windows 10 2004 doesn't
-        // call DIF_INSTALLDEVICE on uninstall.
-        // An InstallResult value of ERROR_NO_COMPAT_DRIVERS simply means
-        // that the NULL driver was selected, and so should not be treated
-        // as an error.
-        //
-        if (Context->PostProcessing &&
-            Context->InstallResult == ERROR_NO_COMPAT_DRIVERS)
-            Context->InstallResult = NO_ERROR;
-
-        Error = (IsNullDriver) ?
-                DifRemove(DeviceInfoSet, DeviceInfoData, Context) :
-                NO_ERROR;
-        break;
-    }
-    case DIF_INSTALLDEVICE: {
-        Error = (IsNullDriver) ?
-                NO_ERROR :
-                DifInstall(DeviceInfoSet, DeviceInfoData, Context);
-        break;
-    }
-    case DIF_REMOVE:
-        Error = DifRemove(DeviceInfoSet, DeviceInfoData, Context);
-        break;
-    default:
-        if (!Context->PostProcessing) {
-            Error = NO_ERROR;
-        } else {
-            Error = Context->InstallResult;
-        }
-
-        break;
-    }
-
-    Log("%s (%s) <===",
-        MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR,
-        DAY_STR "/" MONTH_STR "/" YEAR_STR);
-
-    return (DWORD)Error;
-}
-
-DWORD CALLBACK
-Version(
-    IN  HWND        Window,
-    IN  HINSTANCE   Module,
-    IN  PTCHAR      Buffer,
-    IN  INT         Reserved
-    )
-{
-    UNREFERENCED_PARAMETER(Window);
-    UNREFERENCED_PARAMETER(Module);
-    UNREFERENCED_PARAMETER(Buffer);
-    UNREFERENCED_PARAMETER(Reserved);
-
-    Log("%s (%s)",
-        MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR,
-        DAY_STR "/" MONTH_STR "/" YEAR_STR);
-
-    return NO_ERROR;
-}
-
-static FORCEINLINE const CHAR *
-__ReasonName(
-    IN  DWORD       Reason
-    )
-{
-#define _NAME(_Reason)          \
-        case DLL_ ## _Reason:   \
-            return #_Reason;
-
-    switch (Reason) {
-    _NAME(PROCESS_ATTACH);
-    _NAME(PROCESS_DETACH);
-    _NAME(THREAD_ATTACH);
-    _NAME(THREAD_DETACH);
-    default:
-        break;
-    }
-
-    return "UNKNOWN";
-
-#undef  _NAME
-}
-
-BOOL WINAPI
-DllMain(
-    IN  HINSTANCE   Module,
-    IN  DWORD       Reason,
-    IN  PVOID       Reserved
-    )
-{
-    UNREFERENCED_PARAMETER(Module);
-    UNREFERENCED_PARAMETER(Reserved);
-
-    Log("%s (%s): %s",
-        MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR,
-        DAY_STR "/" MONTH_STR "/" YEAR_STR,
-        __ReasonName(Reason));
-
-    return TRUE;
-}
diff --git a/src/coinst/xenbus_coinst.def b/src/coinst/xenbus_coinst.def
deleted file mode 100644
index 71d8f65..0000000
--- a/src/coinst/xenbus_coinst.def
+++ /dev/null
@@ -1,38 +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.
-
-LIBRARY  XENBUS_COINST
-
-EXPORTS   
-   Entry 
-   Version
-
-   DllMain PRIVATE
diff --git a/src/coinst/xenbus_coinst.rc b/src/coinst/xenbus_coinst.rc
deleted file mode 100644
index 4d46edc..0000000
--- a/src/coinst/xenbus_coinst.rc
+++ /dev/null
@@ -1,57 +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 <windows.h>
-#include <ntverp.h>
-
-
-#undef VER_COMPANYNAME_STR
-#undef VER_PRODUCTNAME_STR
-#undef VER_PRODUCTVERSION
-#undef VER_PRODUCTVERSION_STR
-
-#include <version.h>
-
-#define VER_COMPANYNAME_STR         VENDOR_NAME_STR
-#define VER_LEGALCOPYRIGHT_STR      COPYRIGHT_STR
-
-#define VER_PRODUCTNAME_STR         "XENBUS_COINST"
-#define VER_PRODUCTVERSION          MAJOR_VERSION,MINOR_VERSION,MICRO_VERSION,BUILD_NUMBER
-#define VER_PRODUCTVERSION_STR      MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR
-
-#define VER_INTERNALNAME_STR        "XENBUS_COINST.DLL"
-#define VER_FILEDESCRIPTION_STR     "XENBUS_COINST"
-
-#define VER_FILETYPE                VFT_DRV
-#define VER_FILESUBTYPE             VFT2_DRV_SYSTEM
-
-#include <common.ver>
diff --git a/vs2015/package/package.vcxproj b/vs2015/package/package.vcxproj
index 2518c3f..e536109 100644
--- a/vs2015/package/package.vcxproj
+++ b/vs2015/package/package.vcxproj
@@ -42,9 +42,6 @@
     <ProjectReference Include="..\xenfilt\xenfilt.vcxproj">
       <Project>{d7411b2c-2c43-434d-9f56-e10a3d2f5bad}</Project>
     </ProjectReference>
-    <ProjectReference Include="..\xenbus_coinst\xenbus_coinst.vcxproj">
-      <Project>{4bf41378-c01b-4002-8581-563c5f703362}</Project>
-    </ProjectReference>
     <ProjectReference Include="..\xenbus\xenbus.vcxproj">
       <Project>{14c16c29-77c9-475b-a618-1b01e67cf985}</Project>
     </ProjectReference>
diff --git a/vs2015/xenbus.sln b/vs2015/xenbus.sln
index ecb3540..552d43d 100644
--- a/vs2015/xenbus.sln
+++ b/vs2015/xenbus.sln
@@ -4,11 +4,6 @@ VisualStudioVersion = 14.0.25420.1
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "version", "version\version.vcxproj", "{65FA97EA-A569-4FC1-BFE7-D68E109143F7}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenbus_coinst", "xenbus_coinst\xenbus_coinst.vcxproj", "{4BF41378-C01B-4002-8581-563C5F703362}"
-	ProjectSection(ProjectDependencies) = postProject
-		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
-	EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenbus_monitor", "xenbus_monitor\xenbus_monitor.vcxproj", "{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}"
 	ProjectSection(ProjectDependencies) = postProject
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
@@ -35,7 +30,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "package\package.
 	ProjectSection(ProjectDependencies) = postProject
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
 		{14C16C29-77C9-475B-A618-1B01E67CF985} = {14C16C29-77C9-475B-A618-1B01E67CF985}
-		{4BF41378-C01B-4002-8581-563C5F703362} = {4BF41378-C01B-4002-8581-563C5F703362}
 		{9C6A5D48-A331-4B1F-A004-7BB67BA5BE1C} = {9C6A5D48-A331-4B1F-A004-7BB67BA5BE1C}
 		{D7411B2C-2C43-434D-9F56-E10A3D2F5BAD} = {D7411B2C-2C43-434D-9F56-E10A3D2F5BAD}
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B} = {2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}
@@ -69,22 +63,6 @@ Global
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 10 Release|Win32.Build.0 = Windows 10 Release|Win32
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 10 Release|x64.ActiveCfg = Windows 10 Release|x64
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 10 Release|x64.Build.0 = Windows 10 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|Win32.ActiveCfg = Windows 8 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|Win32.Build.0 = Windows 8 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|x64.ActiveCfg = Windows 8 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|x64.Build.0 = Windows 8 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|Win32.ActiveCfg = Windows 8 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|Win32.ActiveCfg = Windows 10 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|Win32.Build.0 = Windows 10 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|x64.ActiveCfg = Windows 10 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|x64.Build.0 = Windows 10 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|Win32.ActiveCfg = Windows 10 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|Win32.Build.0 = Windows 10 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|x64.ActiveCfg = Windows 10 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|x64.Build.0 = Windows 10 Release|x64
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}.Windows 8 Debug|Win32.ActiveCfg = Windows 8 Debug|Win32
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}.Windows 8 Debug|Win32.Build.0 = Windows 8 Debug|Win32
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}.Windows 8 Debug|x64.ActiveCfg = Windows 8 Debug|x64
diff --git a/vs2015/xenbus_coinst/xenbus_coinst.vcxproj b/vs2015/xenbus_coinst/xenbus_coinst.vcxproj
deleted file mode 100644
index 1d51f96..0000000
--- a/vs2015/xenbus_coinst/xenbus_coinst.vcxproj
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="..\configs.props" />
-  <PropertyGroup Label="PropertySheets">
-    <DriverType>WDM</DriverType>
-    <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{4BF41378-C01B-4002-8581-563C5F703362}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="..\targets.props" />
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <PropertyGroup>
-    <RunCodeAnalysis>true</RunCodeAnalysis>
-    <EnableInf2cat>false</EnableInf2cat>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>PROJECT=$(ProjectName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <WarningLevel>EnableAllWarnings</WarningLevel>
-      <DisableSpecificWarnings>4127;4711;4548;4820;4668;4255;6001;6054;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-      <EnablePREfast>true</EnablePREfast>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <ModuleDefinitionFile>../../src/coinst/xenbus_coinst.def</ModuleDefinitionFile>
-      <AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <EnableCOMDATFolding>false</EnableCOMDATFolding>
-    </Link>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
-    <ClCompile>
-      <PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
-    <ClCompile>
-      <PreprocessorDefinitions>__x86_64__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <FilesToPackage Include="$(TargetPath)" />
-    <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
-    <FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\coinst\coinst.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\src\coinst\xenbus_coinst.def" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\src\coinst\xenbus_coinst.rc" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project>
diff --git a/vs2015/xenbus_coinst/xenbus_coinst.vcxproj.user b/vs2015/xenbus_coinst/xenbus_coinst.vcxproj.user
deleted file mode 100644
index db41a92..0000000
--- a/vs2015/xenbus_coinst/xenbus_coinst.vcxproj.user
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <SignMode>TestSign</SignMode>
-    <TestCertificate>..\..\src\xenbus.pfx</TestCertificate>
-    <TimeStampServer>http://timestamp.verisign.com/scripts/timstamp.dll</TimeStampServer>
-  </PropertyGroup>
-</Project>
diff --git a/vs2017/package/package.vcxproj b/vs2017/package/package.vcxproj
index 2a83c90..5edf0a7 100644
--- a/vs2017/package/package.vcxproj
+++ b/vs2017/package/package.vcxproj
@@ -42,9 +42,6 @@
     <ProjectReference Include="..\xenfilt\xenfilt.vcxproj">
       <Project>{d7411b2c-2c43-434d-9f56-e10a3d2f5bad}</Project>
     </ProjectReference>
-    <ProjectReference Include="..\xenbus_coinst\xenbus_coinst.vcxproj">
-      <Project>{4bf41378-c01b-4002-8581-563c5f703362}</Project>
-    </ProjectReference>
     <ProjectReference Include="..\xenbus\xenbus.vcxproj">
       <Project>{14c16c29-77c9-475b-a618-1b01e67cf985}</Project>
     </ProjectReference>
diff --git a/vs2017/xenbus.sln b/vs2017/xenbus.sln
index fc85d47..19fa290 100644
--- a/vs2017/xenbus.sln
+++ b/vs2017/xenbus.sln
@@ -4,11 +4,6 @@ VisualStudioVersion = 15.0.27703.2042
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "version", "version\version.vcxproj", "{65FA97EA-A569-4FC1-BFE7-D68E109143F7}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenbus_coinst", "xenbus_coinst\xenbus_coinst.vcxproj", "{4BF41378-C01B-4002-8581-563C5F703362}"
-	ProjectSection(ProjectDependencies) = postProject
-		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
-	EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenbus_monitor", "xenbus_monitor\xenbus_monitor.vcxproj", "{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}"
 	ProjectSection(ProjectDependencies) = postProject
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
@@ -35,7 +30,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "package\package.
 	ProjectSection(ProjectDependencies) = postProject
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
 		{14C16C29-77C9-475B-A618-1B01E67CF985} = {14C16C29-77C9-475B-A618-1B01E67CF985}
-		{4BF41378-C01B-4002-8581-563C5F703362} = {4BF41378-C01B-4002-8581-563C5F703362}
 		{9C6A5D48-A331-4B1F-A004-7BB67BA5BE1C} = {9C6A5D48-A331-4B1F-A004-7BB67BA5BE1C}
 		{D7411B2C-2C43-434D-9F56-E10A3D2F5BAD} = {D7411B2C-2C43-434D-9F56-E10A3D2F5BAD}
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B} = {2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}
@@ -69,22 +63,6 @@ Global
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|Win32.ActiveCfg = Windows 10 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|Win32.Build.0 = Windows 10 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|x64.ActiveCfg = Windows 10 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|x64.Build.0 = Windows 10 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|Win32.ActiveCfg = Windows 10 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|Win32.Build.0 = Windows 10 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|x64.ActiveCfg = Windows 10 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|x64.Build.0 = Windows 10 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|Win32.ActiveCfg = Windows 8 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|Win32.Build.0 = Windows 8 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|x64.ActiveCfg = Windows 8 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|x64.Build.0 = Windows 8 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|Win32.ActiveCfg = Windows 8 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}.Windows 10 Debug|Win32.ActiveCfg = Windows 10 Debug|Win32
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}.Windows 10 Debug|Win32.Build.0 = Windows 10 Debug|Win32
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}.Windows 10 Debug|x64.ActiveCfg = Windows 10 Debug|x64
diff --git a/vs2017/xenbus_coinst/xenbus_coinst.vcxproj b/vs2017/xenbus_coinst/xenbus_coinst.vcxproj
deleted file mode 100644
index 7eeb228..0000000
--- a/vs2017/xenbus_coinst/xenbus_coinst.vcxproj
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="..\configs.props" />
-  <PropertyGroup Label="PropertySheets">
-    <DriverType>WDM</DriverType>
-    <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{4BF41378-C01B-4002-8581-563C5F703362}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="..\targets.props" />
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <PropertyGroup>
-    <RunCodeAnalysis>true</RunCodeAnalysis>
-    <EnableInf2cat>false</EnableInf2cat>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>PROJECT=$(ProjectName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <WarningLevel>EnableAllWarnings</WarningLevel>
-      <DisableSpecificWarnings>4127;4711;4548;4820;4668;4255;5045;6001;6054;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-      <EnablePREfast>true</EnablePREfast>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <ModuleDefinitionFile>../../src/coinst/xenbus_coinst.def</ModuleDefinitionFile>
-      <AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <EnableCOMDATFolding>false</EnableCOMDATFolding>
-    </Link>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
-    <ClCompile>
-      <PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
-    <ClCompile>
-      <PreprocessorDefinitions>__x86_64__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <FilesToPackage Include="$(TargetPath)" />
-    <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
-    <FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\coinst\coinst.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\src\coinst\xenbus_coinst.def" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\src\coinst\xenbus_coinst.rc" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project>
diff --git a/vs2017/xenbus_coinst/xenbus_coinst.vcxproj.user b/vs2017/xenbus_coinst/xenbus_coinst.vcxproj.user
deleted file mode 100644
index db41a92..0000000
--- a/vs2017/xenbus_coinst/xenbus_coinst.vcxproj.user
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <SignMode>TestSign</SignMode>
-    <TestCertificate>..\..\src\xenbus.pfx</TestCertificate>
-    <TimeStampServer>http://timestamp.verisign.com/scripts/timstamp.dll</TimeStampServer>
-  </PropertyGroup>
-</Project>
diff --git a/vs2019/package/package.vcxproj b/vs2019/package/package.vcxproj
index 4d03e23..839c047 100644
--- a/vs2019/package/package.vcxproj
+++ b/vs2019/package/package.vcxproj
@@ -47,9 +47,6 @@
     <ProjectReference Include="..\xenfilt\xenfilt.vcxproj">
       <Project>{d7411b2c-2c43-434d-9f56-e10a3d2f5bad}</Project>
     </ProjectReference>
-    <ProjectReference Include="..\xenbus_coinst\xenbus_coinst.vcxproj">
-      <Project>{4bf41378-c01b-4002-8581-563c5f703362}</Project>
-    </ProjectReference>
     <ProjectReference Include="..\xenbus\xenbus.vcxproj">
       <Project>{14c16c29-77c9-475b-a618-1b01e67cf985}</Project>
     </ProjectReference>
diff --git a/vs2019/xenbus.sln b/vs2019/xenbus.sln
index 4ced8db..65867c9 100644
--- a/vs2019/xenbus.sln
+++ b/vs2019/xenbus.sln
@@ -4,11 +4,6 @@ VisualStudioVersion = 16.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "version", "version\version.vcxproj", "{65FA97EA-A569-4FC1-BFE7-D68E109143F7}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenbus_coinst", "xenbus_coinst\xenbus_coinst.vcxproj", "{4BF41378-C01B-4002-8581-563C5F703362}"
-	ProjectSection(ProjectDependencies) = postProject
-		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
-	EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenbus_monitor", "xenbus_monitor\xenbus_monitor.vcxproj", "{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}"
 	ProjectSection(ProjectDependencies) = postProject
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
@@ -35,7 +30,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "package\package.
 	ProjectSection(ProjectDependencies) = postProject
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
 		{14C16C29-77C9-475B-A618-1B01E67CF985} = {14C16C29-77C9-475B-A618-1B01E67CF985}
-		{4BF41378-C01B-4002-8581-563C5F703362} = {4BF41378-C01B-4002-8581-563C5F703362}
 		{9C6A5D48-A331-4B1F-A004-7BB67BA5BE1C} = {9C6A5D48-A331-4B1F-A004-7BB67BA5BE1C}
 		{D7411B2C-2C43-434D-9F56-E10A3D2F5BAD} = {D7411B2C-2C43-434D-9F56-E10A3D2F5BAD}
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B} = {2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}
@@ -69,22 +63,6 @@ Global
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|Win32.ActiveCfg = Windows 10 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|Win32.Build.0 = Windows 10 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|x64.ActiveCfg = Windows 10 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|x64.Build.0 = Windows 10 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|Win32.ActiveCfg = Windows 10 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|Win32.Build.0 = Windows 10 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|x64.ActiveCfg = Windows 10 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|x64.Build.0 = Windows 10 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|Win32.ActiveCfg = Windows 8 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|Win32.Build.0 = Windows 8 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|x64.ActiveCfg = Windows 8 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|x64.Build.0 = Windows 8 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|Win32.ActiveCfg = Windows 8 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}.Windows 10 Debug|Win32.ActiveCfg = Windows 10 Debug|Win32
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}.Windows 10 Debug|Win32.Build.0 = Windows 10 Debug|Win32
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}.Windows 10 Debug|x64.ActiveCfg = Windows 10 Debug|x64
diff --git a/vs2019/xenbus_coinst/xenbus_coinst.vcxproj b/vs2019/xenbus_coinst/xenbus_coinst.vcxproj
deleted file mode 100644
index c4e47d0..0000000
--- a/vs2019/xenbus_coinst/xenbus_coinst.vcxproj
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="..\configs.props" />
-  <PropertyGroup Label="PropertySheets">
-    <DriverType>WDM</DriverType>
-    <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{4BF41378-C01B-4002-8581-563C5F703362}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="..\targets.props" />
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <PropertyGroup>
-    <RunCodeAnalysis>true</RunCodeAnalysis>
-    <EnableInf2cat>false</EnableInf2cat>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
-      <SDLCheck>true</SDLCheck>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>PROJECT=$(ProjectName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <WarningLevel>EnableAllWarnings</WarningLevel>
-      <DisableSpecificWarnings>4127;4711;4548;4820;4668;4255;5045;6001;6054;26052;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-      <EnablePREfast>true</EnablePREfast>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <ModuleDefinitionFile>../../src/coinst/xenbus_coinst.def</ModuleDefinitionFile>
-      <AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <EnableCOMDATFolding>false</EnableCOMDATFolding>
-      <CETCompat>true</CETCompat>
-    </Link>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <DriverSign>
-      <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
-    </DriverSign>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
-    <ClCompile>
-      <PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
-    <ClCompile>
-      <PreprocessorDefinitions>__x86_64__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <FilesToPackage Include="$(TargetPath)" />
-    <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
-    <FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\coinst\coinst.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\src\coinst\xenbus_coinst.def" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\src\coinst\xenbus_coinst.rc" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project>
diff --git a/vs2019/xenbus_coinst/xenbus_coinst.vcxproj.user b/vs2019/xenbus_coinst/xenbus_coinst.vcxproj.user
deleted file mode 100644
index db41a92..0000000
--- a/vs2019/xenbus_coinst/xenbus_coinst.vcxproj.user
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <SignMode>TestSign</SignMode>
-    <TestCertificate>..\..\src\xenbus.pfx</TestCertificate>
-    <TimeStampServer>http://timestamp.verisign.com/scripts/timstamp.dll</TimeStampServer>
-  </PropertyGroup>
-</Project>
diff --git a/vs2022/package/package.vcxproj b/vs2022/package/package.vcxproj
index 885ce5a..e9f7a52 100644
--- a/vs2022/package/package.vcxproj
+++ b/vs2022/package/package.vcxproj
@@ -47,9 +47,6 @@
     <ProjectReference Include="..\xenfilt\xenfilt.vcxproj">
       <Project>{d7411b2c-2c43-434d-9f56-e10a3d2f5bad}</Project>
     </ProjectReference>
-    <ProjectReference Include="..\xenbus_coinst\xenbus_coinst.vcxproj">
-      <Project>{4bf41378-c01b-4002-8581-563c5f703362}</Project>
-    </ProjectReference>
     <ProjectReference Include="..\xenbus\xenbus.vcxproj">
       <Project>{14c16c29-77c9-475b-a618-1b01e67cf985}</Project>
     </ProjectReference>
diff --git a/vs2022/xenbus.sln b/vs2022/xenbus.sln
index 4ced8db..65867c9 100644
--- a/vs2022/xenbus.sln
+++ b/vs2022/xenbus.sln
@@ -4,11 +4,6 @@ VisualStudioVersion = 16.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "version", "version\version.vcxproj", "{65FA97EA-A569-4FC1-BFE7-D68E109143F7}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenbus_coinst", "xenbus_coinst\xenbus_coinst.vcxproj", "{4BF41378-C01B-4002-8581-563C5F703362}"
-	ProjectSection(ProjectDependencies) = postProject
-		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
-	EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenbus_monitor", "xenbus_monitor\xenbus_monitor.vcxproj", "{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}"
 	ProjectSection(ProjectDependencies) = postProject
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
@@ -35,7 +30,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "package\package.
 	ProjectSection(ProjectDependencies) = postProject
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
 		{14C16C29-77C9-475B-A618-1B01E67CF985} = {14C16C29-77C9-475B-A618-1B01E67CF985}
-		{4BF41378-C01B-4002-8581-563C5F703362} = {4BF41378-C01B-4002-8581-563C5F703362}
 		{9C6A5D48-A331-4B1F-A004-7BB67BA5BE1C} = {9C6A5D48-A331-4B1F-A004-7BB67BA5BE1C}
 		{D7411B2C-2C43-434D-9F56-E10A3D2F5BAD} = {D7411B2C-2C43-434D-9F56-E10A3D2F5BAD}
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B} = {2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}
@@ -69,22 +63,6 @@ Global
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|Win32.ActiveCfg = Windows 10 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|Win32.Build.0 = Windows 10 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|x64.ActiveCfg = Windows 10 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Debug|x64.Build.0 = Windows 10 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|Win32.ActiveCfg = Windows 10 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|Win32.Build.0 = Windows 10 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|x64.ActiveCfg = Windows 10 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 10 Release|x64.Build.0 = Windows 10 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|Win32.ActiveCfg = Windows 8 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|Win32.Build.0 = Windows 8 Debug|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|x64.ActiveCfg = Windows 8 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Debug|x64.Build.0 = Windows 8 Debug|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|Win32.ActiveCfg = Windows 8 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
-		{4BF41378-C01B-4002-8581-563C5F703362}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}.Windows 10 Debug|Win32.ActiveCfg = Windows 10 Debug|Win32
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}.Windows 10 Debug|Win32.Build.0 = Windows 10 Debug|Win32
 		{2E61D2CC-865E-442C-8C83-B8DAFD7BBD3B}.Windows 10 Debug|x64.ActiveCfg = Windows 10 Debug|x64
diff --git a/vs2022/xenbus_coinst/xenbus_coinst.vcxproj b/vs2022/xenbus_coinst/xenbus_coinst.vcxproj
deleted file mode 100644
index c4e47d0..0000000
--- a/vs2022/xenbus_coinst/xenbus_coinst.vcxproj
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="..\configs.props" />
-  <PropertyGroup Label="PropertySheets">
-    <DriverType>WDM</DriverType>
-    <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{4BF41378-C01B-4002-8581-563C5F703362}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="..\targets.props" />
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <PropertyGroup>
-    <RunCodeAnalysis>true</RunCodeAnalysis>
-    <EnableInf2cat>false</EnableInf2cat>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
-      <SDLCheck>true</SDLCheck>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>PROJECT=$(ProjectName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <WarningLevel>EnableAllWarnings</WarningLevel>
-      <DisableSpecificWarnings>4127;4711;4548;4820;4668;4255;5045;6001;6054;26052;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-      <EnablePREfast>true</EnablePREfast>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <ModuleDefinitionFile>../../src/coinst/xenbus_coinst.def</ModuleDefinitionFile>
-      <AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <EnableCOMDATFolding>false</EnableCOMDATFolding>
-      <CETCompat>true</CETCompat>
-    </Link>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <DriverSign>
-      <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
-    </DriverSign>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
-    <ClCompile>
-      <PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
-    <ClCompile>
-      <PreprocessorDefinitions>__x86_64__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <FilesToPackage Include="$(TargetPath)" />
-    <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
-    <FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\coinst\coinst.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\src\coinst\xenbus_coinst.def" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\src\coinst\xenbus_coinst.rc" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project>
diff --git a/vs2022/xenbus_coinst/xenbus_coinst.vcxproj.user b/vs2022/xenbus_coinst/xenbus_coinst.vcxproj.user
deleted file mode 100644
index db41a92..0000000
--- a/vs2022/xenbus_coinst/xenbus_coinst.vcxproj.user
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <SignMode>TestSign</SignMode>
-    <TestCertificate>..\..\src\xenbus.pfx</TestCertificate>
-    <TimeStampServer>http://timestamp.verisign.com/scripts/timstamp.dll</TimeStampServer>
-  </PropertyGroup>
-</Project>
-- 
2.41.0.windows.3



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:29:47 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:29:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593406.926436 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbc7f-0000pj-Pb; Thu, 31 Aug 2023 07:29:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593406.926436; Thu, 31 Aug 2023 07:29:47 +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 1qbc7f-0000p5-Hz; Thu, 31 Aug 2023 07:29:47 +0000
Received: by outflank-mailman (input) for mailman id 593406;
 Thu, 31 Aug 2023 07:29:46 +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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbc7e-0000gZ-Ou
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:29:46 +0000
Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com
 [2a00:1450:4864:20::32d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2868be89-47d0-11ee-8783-cb3800f73035;
 Thu, 31 Aug 2023 09:29:45 +0200 (CEST)
Received: by mail-wm1-x32d.google.com with SMTP id
 5b1f17b1804b1-401bdff4cb4so4694225e9.3
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:29:45 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 p15-20020a5d68cf000000b0031416362e23sm1224278wrw.3.2023.08.31.00.29.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Aug 2023 00:29:44 -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: 2868be89-47d0-11ee-8783-cb3800f73035
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693466984; x=1694071784; 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=reJnTd4g/YW1vUSCE78f4AaZpiTKXAQutT8DKPPR7iQ=;
        b=TxzUsCMzqdU7v7qnJ3MhlmcNQBGUIDx0sEGBxvX8tE7TtfcXdHd09Yx9uaznTBSTnD
         SeL4ccd96kpfNGbJ1BiAio0bTHwWdFZ6pIK2clopWItC1fRNKTyYfPtwA5Y0o+pxRa9N
         Pav2VDPazJ0eGZJ4V1QO7ovYVSQItvUrtqnwc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693466984; x=1694071784;
        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=reJnTd4g/YW1vUSCE78f4AaZpiTKXAQutT8DKPPR7iQ=;
        b=BDtdOPUDuRSGaMll25L4Jl7xYqn/G/4NyyIE5akF31eNnh4qpg71mCENUR9ye2tWlE
         hWG5JiLkWHK4LL0VAB0OYLNuO5zG5Oil9t+onkfAp1aUfXg1pUJVr15/9O1YYnsbKlnW
         JXQsZ9epbydyzMINbnoLUEXSCxWeZmTPyWWdWdyRQoL9KDJrpVEbrpTwpJr2W30FMKm0
         gQ3PiHC8GaeQMm/t5tBMkz5GyMCjJhP2SOU+rAg0mniUp0UvVz+XpxGxn8sC/ADOOqCJ
         mZXJPayjsz8L6GOyfyazub9BdqS3qDb/klQjhIHDTLKFZ5XUyUJUOmn5PJoCFoDpYOaQ
         9ikA==
X-Gm-Message-State: AOJu0Yz+C83AeHj8bOcQ522bPDNUDRJMbjC2uukotWq1J6XoYnqlgL3K
	y9d2upUaTMrv6ESl2Pc6YKhHfxUMdykVgehW/Mp6
X-Google-Smtp-Source: AGHT+IGTvA0slQFssIbqeUmMbo2nqPalISlj8dCDtfXTx9MFs1UmSyMBpwiBRx+53PqTiy4eaLUWbQ==
X-Received: by 2002:adf:f5c6:0:b0:31a:dc2e:2db2 with SMTP id k6-20020adff5c6000000b0031adc2e2db2mr3575193wrp.49.1693466984684;
        Thu, 31 Aug 2023 00:29:44 -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 6/6] Add Unplug v2 interface (REV_0900000A)
Date: Thu, 31 Aug 2023 08:29:21 +0100
Message-ID: <20230831072921.1258-7-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.3
In-Reply-To: <20230831072921.1258-1-owen.smith@cloud.com>
References: <20230831072921.1258-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Unplug v2 adds a query call to determine if a device type has had its unplug issued.
This is useful during upgrade cases when the Unplug keys have been set to 0, and can
be used to prevent XenVif from starting whilst emulated devices are present, but those
emulated devices have not been assigned a valid configuration yet (emulated devices
will receive valid configuration, but not at this point in the startup sequence during
upgrade)

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 include/revision.h         |  3 +-
 include/unplug_interface.h | 30 +++++++++++++++++--
 include/xen.h              |  7 +++++
 src/xen/unplug.c           | 15 ++++++++++
 src/xenbus/unplug.c        | 61 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 113 insertions(+), 3 deletions(-)

diff --git a/include/revision.h b/include/revision.h
index 4d91927..9577fdb 100644
--- a/include/revision.h
+++ b/include/revision.h
@@ -57,6 +57,7 @@
     DEFINE_REVISION(0x09000006,  1,  3,  8,  1,  2,  1,  2,  4,  1,  1,  1), \
     DEFINE_REVISION(0x09000007,  1,  3,  8,  1,  2,  1,  2,  4,  1,  1,  2), \
     DEFINE_REVISION(0x09000008,  1,  3,  9,  1,  2,  1,  2,  4,  1,  1,  2), \
-    DEFINE_REVISION(0x09000009,  1,  4,  9,  1,  2,  1,  2,  4,  1,  1,  2)
+    DEFINE_REVISION(0x09000009,  1,  4,  9,  1,  2,  1,  2,  4,  1,  1,  2), \
+    DEFINE_REVISION(0x0900000A,  1,  4,  9,  1,  2,  1,  2,  4,  2,  1,  2)
 
 #endif  // _REVISION_H
diff --git a/include/unplug_interface.h b/include/unplug_interface.h
index e465e2e..82afb63 100644
--- a/include/unplug_interface.h
+++ b/include/unplug_interface.h
@@ -85,6 +85,20 @@ typedef VOID
     IN  BOOLEAN                     Make
     );
 
+/*! \typedef XENBUS_UNPLUG_GETSTATE
+    \brief Has a type of emulated device been unplugged
+
+    \param Interface The interface header
+    \param Type The type of device
+
+    \return TRUE The type of device has been unplugged this boot
+*/
+typedef BOOLEAN
+(*XENBUS_UNPLUG_GETSTATE)(
+    IN  PINTERFACE                  Interface,
+    IN  XENBUS_UNPLUG_DEVICE_TYPE   Type
+    );
+
 // {73db6517-3d06-4937-989f-199b7501e229}
 DEFINE_GUID(GUID_XENBUS_UNPLUG_INTERFACE,
 0x73db6517, 0x3d06, 0x4937, 0x98, 0x9f, 0x19, 0x9b, 0x75, 0x01, 0xe2, 0x29);
@@ -100,7 +114,19 @@ struct _XENBUS_UNPLUG_INTERFACE_V1 {
     XENBUS_UNPLUG_REQUEST   UnplugRequest;
 };
 
-typedef struct _XENBUS_UNPLUG_INTERFACE_V1 XENBUS_UNPLUG_INTERFACE, *PXENBUS_UNPLUG_INTERFACE;
+/*! \struct _XENBUS_UNPLUG_INTERFACE_V2
+    \brief UNPLUG interface version 2
+    \ingroup interfaces
+*/
+struct _XENBUS_UNPLUG_INTERFACE_V2 {
+    INTERFACE               Interface;
+    XENBUS_UNPLUG_ACQUIRE   UnplugAcquire;
+    XENBUS_UNPLUG_RELEASE   UnplugRelease;
+    XENBUS_UNPLUG_REQUEST   UnplugRequest;
+    XENBUS_UNPLUG_GETSTATE  UnplugGetState;
+};
+
+typedef struct _XENBUS_UNPLUG_INTERFACE_V2 XENBUS_UNPLUG_INTERFACE, *PXENBUS_UNPLUG_INTERFACE;
 
 /*! \def XENBUS_UNPLUG
     \brief Macro at assist in method invocation
@@ -111,6 +137,6 @@ typedef struct _XENBUS_UNPLUG_INTERFACE_V1 XENBUS_UNPLUG_INTERFACE, *PXENBUS_UNP
 #endif  // _WINDLL
 
 #define XENBUS_UNPLUG_INTERFACE_VERSION_MIN  1
-#define XENBUS_UNPLUG_INTERFACE_VERSION_MAX  1
+#define XENBUS_UNPLUG_INTERFACE_VERSION_MAX  2
 
 #endif  // _XENBUS_UNPLUG_INTERFACE_H
diff --git a/include/xen.h b/include/xen.h
index 132de21..ead5ca0 100644
--- a/include/xen.h
+++ b/include/xen.h
@@ -377,6 +377,13 @@ UnplugDecrementValue(
     IN  UNPLUG_TYPE Type
     );
 
+XEN_API
+VOID
+UnplugWasRequested(
+    IN  UNPLUG_TYPE Type,
+    OUT PBOOLEAN    Requested
+    );
+
 // LOG
 
 typedef enum _LOG_LEVEL {
diff --git a/src/xen/unplug.c b/src/xen/unplug.c
index ab94da5..fa3a4ae 100644
--- a/src/xen/unplug.c
+++ b/src/xen/unplug.c
@@ -344,6 +344,21 @@ fail1:
     return status;
 }
 
+XEN_API
+VOID
+UnplugWasRequested(
+    IN  UNPLUG_TYPE Type,
+    OUT PBOOLEAN    Requested
+    )
+{
+    PUNPLUG_CONTEXT Context = &UnplugContext;
+    KIRQL           Irql;
+
+    AcquireHighLock(&Context->Lock, &Irql);
+    *Requested = Context->Request[Type];
+    ReleaseHighLock(&Context->Lock, Irql);
+}
+
 XEN_API
 VOID
 UnplugDevices(
diff --git a/src/xenbus/unplug.c b/src/xenbus/unplug.c
index f2f13fa..86871d7 100644
--- a/src/xenbus/unplug.c
+++ b/src/xenbus/unplug.c
@@ -110,6 +110,41 @@ UnplugRequest(
     ReleaseMutex(&Context->Mutex);
 }
 
+__drv_requiresIRQL(PASSIVE_LEVEL)
+static BOOLEAN
+UnplugGetState(
+    IN  PINTERFACE                  Interface,
+    IN  XENBUS_UNPLUG_DEVICE_TYPE   Type
+    )
+{
+    PXENBUS_UNPLUG_CONTEXT          Context = Interface->Context;
+    BOOLEAN                         Requested;
+
+    ASSERT3U(KeGetCurrentIrql(), ==, PASSIVE_LEVEL);
+
+    AcquireMutex(&Context->Mutex);
+
+    Requested = FALSE;
+    switch (Type) {
+    case XENBUS_UNPLUG_DEVICE_TYPE_NICS:
+        UnplugWasRequested(UNPLUG_NICS, &Requested);
+        break;
+
+    case XENBUS_UNPLUG_DEVICE_TYPE_DISKS:
+        UnplugWasRequested(UNPLUG_DISKS, &Requested);
+        break;
+
+    default:
+        ASSERT(FALSE);
+        break;
+    }
+
+    ReleaseMutex(&Context->Mutex);
+
+    return Requested;
+}
+
+
 static NTSTATUS
 UnplugAcquire(
     IN  PINTERFACE          Interface
@@ -157,6 +192,15 @@ static struct _XENBUS_UNPLUG_INTERFACE_V1 UnplugInterfaceVersion1 = {
     UnplugRequest
 };
 
+static struct _XENBUS_UNPLUG_INTERFACE_V2 UnplugInterfaceVersion2 = {
+    { sizeof (struct _XENBUS_UNPLUG_INTERFACE_V2), 2, NULL, NULL, NULL },
+    UnplugAcquire,
+    UnplugRelease,
+    UnplugRequest,
+    UnplugGetState
+};
+
+
 NTSTATUS
 UnplugInitialize(
     IN  PXENBUS_FDO             Fdo,
@@ -218,6 +262,23 @@ UnplugGetInterface(
         status = STATUS_SUCCESS;
         break;
     }
+    case 2: {
+        struct _XENBUS_UNPLUG_INTERFACE_V2   *UnplugInterface;
+
+        UnplugInterface = (struct _XENBUS_UNPLUG_INTERFACE_V2 *)Interface;
+
+        status = STATUS_BUFFER_OVERFLOW;
+        if (Size < sizeof (struct _XENBUS_UNPLUG_INTERFACE_V2))
+            break;
+
+        *UnplugInterface = UnplugInterfaceVersion2;
+
+        ASSERT3U(Interface->Version, ==, Version);
+        Interface->Context = Context;
+
+        status = STATUS_SUCCESS;
+        break;
+    }
     default:
         status = STATUS_NOT_SUPPORTED;
         break;
-- 
2.41.0.windows.3



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:45:34 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593454.926452 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbcMu-0004AH-3L; Thu, 31 Aug 2023 07:45:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593454.926452; Thu, 31 Aug 2023 07:45:32 +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 1qbcMu-0004AA-0Y; Thu, 31 Aug 2023 07:45:32 +0000
Received: by outflank-mailman (input) for mailman id 593454;
 Thu, 31 Aug 2023 07:45: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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbcMs-00049n-Nx
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:45:30 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5a3efaf1-47d2-11ee-9b0d-b553b5be7939;
 Thu, 31 Aug 2023 09:45:27 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-500a8b2b73eso1039420e87.0
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:45: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: 5a3efaf1-47d2-11ee-9b0d-b553b5be7939
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693467927; x=1694072727; darn=lists.xenproject.org;
        h=to:subject:message-id:date:from:in-reply-to:references:mime-version
         :from:to:cc:subject:date:message-id:reply-to;
        bh=cREV80ZiaGBShtypRmmUSCr/aG4XL9SKARqfJhn2fBI=;
        b=KcOFAM7Ax/bq3jY6T/BrLJh1z+PBaWLs6MHAEOkNmSarJOWRtykjfvGOj5OwnrAVbm
         ga2S6Ba4wdCjQ87h8sgcsmCcXs3pnD6e2dYND1Ml/RUb7eLkaBzq6o9T7b9/T1LO1GAp
         NdCxchSQOXIjKZ1F0si7E/tCoMAUi/ZMCfqlQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693467927; x=1694072727;
        h=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=cREV80ZiaGBShtypRmmUSCr/aG4XL9SKARqfJhn2fBI=;
        b=l+lO78HouzK0m4XR4CiFX8pcXU584QUXQxjAyMEKRniBCUoND52+qGpXmxNx09zxC8
         Nr1eHRa3GmihVl1hmLF8eh0O2yfJPNncYCrqkyOtd932j6fGjlmOiVJs0ZoARWWZ2R75
         ab6f0npFnuRy7VzN54oXiy07BGMEor4wC4hRY6aW888mY1NOYP8lZQS2m4WdVN/bPk+B
         skFLBr/2J4Sut+hOtNiylTFSoG40xXKfheWlT2q2d/CnK73u16qUpYYYzylbBsSI4a+/
         udETXisgmVUNBRvGmkgTdHqB0HHCntjT+01V5dgQDXUy+/fBQ3VnEfjopbLqgnh6AO91
         0IPg==
X-Gm-Message-State: AOJu0Yw60Pm1IpvOOnmpFUckKFFrv2w3mb8JIanCZVwFkEKv8VUa+O8S
	8ifrgjD0411UOV4PjEBTzdVfHtiMDr/pEPycJJqu8RKpvbnpz09C5w==
X-Google-Smtp-Source: AGHT+IHhP2x6HQ/HFLSpV5aUz08QcSHujLPk5LEHnvgkGtQBzyRXX6RrnjSkLDZ1JmlMA7WXOGYjDrPzaavR385JavM=
X-Received: by 2002:ac2:5b9c:0:b0:4ff:7e1e:b4b4 with SMTP id
 o28-20020ac25b9c000000b004ff7e1eb4b4mr2899387lfn.39.1693467921867; Thu, 31
 Aug 2023 00:45:21 -0700 (PDT)
MIME-Version: 1.0
References: <20230831072921.1258-1-owen.smith@cloud.com>
In-Reply-To: <20230831072921.1258-1-owen.smith@cloud.com>
From: Owen Smith <owen.smith@cloud.com>
Date: Thu, 31 Aug 2023 08:45:10 +0100
Message-ID: <CAC_UY88F7EA10v3Nriuf4Mt-+Z7giD1diN3gYTOwwo4neRNJhw@mail.gmail.com>
Subject: Re: [PATCH 0/6] Remove CoInstallers
To: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000ec08f906043339bf"

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

I should have tagged this patch series as RFC

On Thu, Aug 31, 2023 at 8:29=E2=80=AFAM Owen Smith <owen.smith@cloud.com> w=
rote:

> Windows 11 22H2 WHQL testing has highlighted the need to remove
> CoInstallers.
> The current CoInstaller handle several edge cases that will need
> replacement
> implementations. This patch series for most drivers offers a potential
> solution
> to the removal of CoInstallers and the required changes to avoid upgrade
> issues.
>
> CoInstallers have several uses currently:
> - Adds an upgrade block function with the "AllowUpgrade" value blocking
> driver
>   upgrades when set.
> - Adds a check to prevent XenBus upgrades from a different vendor / brand=
.
>   This checks the current device name (if it exists) matches the new
> device name.
> - Checks all currently installed child devices have a supported set of
> interfaces
>   common with the new parent device.
> - Clears the Unplug keys only when required.
> - Correctly cleans up user mode services on uninstall.
>
> The AllowUpgrade function has not been replaced - I have not seen this
> used in
> the current implementations of the drivers.
>
> The vendor naming check is specific to XenBus, and I dont think there is =
a
> reliable replacement, and was intended to prevent different vendor driver=
s
> from
> attempting to coexist, or upgrade cases from particularly old versions
> which had
> a different naming scheme.
>
> The interface compatability checks can be replaced with the matching if
> RevisionIDs
> in the INF files, so that child devices will only install on parent
> devices that
> expose a matching HardwareID or CompatibleID. This does leave the case
> where the
> new parent driver could drop support for an interface version that is
> currently in
> use. This will mandate a further driver upgrade, and should remove the
> Unplug keys
> and mandate a reboot where the emulated devices are present, to ensure
> continued
> operation. After this reboot using emulated devices, updates to the child
> devices
> should be detected and installed, requiring another reboot to revert to P=
V
> devices.
>
> Unplug keys getting cleared on all upgrades should allow the next boot to
> use emulated
> devices, unless a subsequent install updates dependent drivers to use a
> working set
> of new interfaces. The requirement here is that updating any driver shoul=
d
> always
> allow a reboot with emulated devices, should any further issues be
> detected.
>
> I believe that, going forward, changing the DeviceID to remove the
> RevisionID will
> avoid the need to set network IDs and copy settings from the previous
> network
> connection to the new network connection. This change will mean the drive=
r
> selection
> during installation/upgrade will use the HardwareIDs (with RevisionIDs) t=
o
> match the
> ID in the DDInstall INF section (with RevisionID), and use the DeviceID t=
o
> generate
> the Matching Device ID and Instance ID. This means that once drivers have
> been
> upgraded, the InstanceIDs should not change, and Windows should not
> generate a new
> network connection (with default settings) for the upgraded driver set -
> meaning the
> correct network settings are persisted.
>
> I dont have a good replacement for cleaning up user mode services
> (xenbus_monitor
> xenagent and xencons_monitor) on device uninstall. This *should* be
> handled correctly
> by the PnP manager, but failing to stop either service should not be
> detremental to
> the operation of the VM. Selecting the "Delete Drivers" option during
> uninstall will
> stop and disable these services, not selecting this option will leave
> these services
> running.
>
> Owen Smith (6):
>   Remove CoInstaller from INF
>   Reset StorNvme's StartOverride
>   Delete CoInstaller code
>   Fix Length calculation in PdoQueryId
>   Remove REV from DeviceID
>   Add Unplug v2 interface (REV_0900000A)
>
>  include/revision.h                            |    3 +-
>  include/unplug_interface.h                    |   30 +-
>  include/xen.h                                 |    7 +
>  src/coinst/coinst.c                           | 2136 -----------------
>  src/coinst/xenbus_coinst.def                  |   38 -
>  src/coinst/xenbus_coinst.rc                   |   57 -
>  src/monitor/monitor.c                         |   63 +
>  src/xen/unplug.c                              |   15 +
>  src/xenbus.inf                                |   20 +-
>  src/xenbus/pdo.c                              |   14 +-
>  src/xenbus/unplug.c                           |   61 +
>  vs2015/package/package.vcxproj                |    3 -
>  vs2015/xenbus.sln                             |   22 -
>  vs2015/xenbus_coinst/xenbus_coinst.vcxproj    |   64 -
>  .../xenbus_coinst/xenbus_coinst.vcxproj.user  |    8 -
>  vs2017/package/package.vcxproj                |    3 -
>  vs2017/xenbus.sln                             |   22 -
>  vs2017/xenbus_coinst/xenbus_coinst.vcxproj    |   64 -
>  .../xenbus_coinst/xenbus_coinst.vcxproj.user  |    8 -
>  vs2019/package/package.vcxproj                |    3 -
>  vs2019/xenbus.sln                             |   22 -
>  vs2019/xenbus_coinst/xenbus_coinst.vcxproj    |   70 -
>  .../xenbus_coinst/xenbus_coinst.vcxproj.user  |    8 -
>  vs2022/package/package.vcxproj                |    3 -
>  vs2022/xenbus.sln                             |   22 -
>  vs2022/xenbus_coinst/xenbus_coinst.vcxproj    |   70 -
>  .../xenbus_coinst/xenbus_coinst.vcxproj.user  |    8 -
>  27 files changed, 187 insertions(+), 2657 deletions(-)
>  delete mode 100644 src/coinst/coinst.c
>  delete mode 100644 src/coinst/xenbus_coinst.def
>  delete mode 100644 src/coinst/xenbus_coinst.rc
>  delete mode 100644 vs2015/xenbus_coinst/xenbus_coinst.vcxproj
>  delete mode 100644 vs2015/xenbus_coinst/xenbus_coinst.vcxproj.user
>  delete mode 100644 vs2017/xenbus_coinst/xenbus_coinst.vcxproj
>  delete mode 100644 vs2017/xenbus_coinst/xenbus_coinst.vcxproj.user
>  delete mode 100644 vs2019/xenbus_coinst/xenbus_coinst.vcxproj
>  delete mode 100644 vs2019/xenbus_coinst/xenbus_coinst.vcxproj.user
>  delete mode 100644 vs2022/xenbus_coinst/xenbus_coinst.vcxproj
>  delete mode 100644 vs2022/xenbus_coinst/xenbus_coinst.vcxproj.user
>
> --
> 2.41.0.windows.3
>
>

--000000000000ec08f906043339bf
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 should have tagged this patch series as RFC</div></div><br><div class=
=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Aug 31, 2023=
 at 8:29=E2=80=AFAM Owen Smith &lt;<a href=3D"mailto:owen.smith@cloud.com">=
owen.smith@cloud.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex">Windows 11 22H2 WHQL testing has highlighted the need t=
o remove CoInstallers.<br>
The current CoInstaller handle several edge cases that will need replacemen=
t<br>
implementations. This patch series for most drivers offers a potential solu=
tion<br>
to the removal of CoInstallers and the required changes to avoid upgrade is=
sues.<br>
<br>
CoInstallers have several uses currently:<br>
- Adds an upgrade block function with the &quot;AllowUpgrade&quot; value bl=
ocking driver<br>
=C2=A0 upgrades when set.<br>
- Adds a check to prevent XenBus upgrades from a different vendor / brand.<=
br>
=C2=A0 This checks the current device name (if it exists) matches the new d=
evice name.<br>
- Checks all currently installed child devices have a supported set of inte=
rfaces<br>
=C2=A0 common with the new parent device.<br>
- Clears the Unplug keys only when required.<br>
- Correctly cleans up user mode services on uninstall.<br>
<br>
The AllowUpgrade function has not been replaced - I have not seen this used=
 in<br>
the current implementations of the drivers.<br>
<br>
The vendor naming check is specific to XenBus, and I dont think there is a<=
br>
reliable replacement, and was intended to prevent different vendor drivers =
from<br>
attempting to coexist, or upgrade cases from particularly old versions whic=
h had<br>
a different naming scheme.<br>
<br>
The interface compatability checks can be replaced with the matching if Rev=
isionIDs<br>
in the INF files, so that child devices will only install on parent devices=
 that<br>
expose a matching HardwareID or CompatibleID. This does leave the case wher=
e the<br>
new parent driver could drop support for an interface version that is curre=
ntly in<br>
use. This will mandate a further driver upgrade, and should remove the Unpl=
ug keys<br>
and mandate a reboot where the emulated devices are present, to ensure cont=
inued<br>
operation. After this reboot using emulated devices, updates to the child d=
evices<br>
should be detected and installed, requiring another reboot to revert to PV =
devices.<br>
<br>
Unplug keys getting cleared on all upgrades should allow the next boot to u=
se emulated<br>
devices, unless a subsequent install updates dependent drivers to use a wor=
king set<br>
of new interfaces. The requirement here is that updating any driver should =
always<br>
allow a reboot with emulated devices, should any further issues be detected=
.<br>
<br>
I believe that, going forward, changing the DeviceID to remove the Revision=
ID will<br>
avoid the need to set network IDs and copy settings from the previous netwo=
rk<br>
connection to the new network connection. This change will mean the driver =
selection<br>
during installation/upgrade will use the HardwareIDs (with RevisionIDs) to =
match the<br>
ID in the DDInstall INF section (with RevisionID), and use the DeviceID to =
generate<br>
the Matching Device ID and Instance ID. This means that once drivers have b=
een<br>
upgraded, the InstanceIDs should not change, and Windows should not generat=
e a new<br>
network connection (with default settings) for the upgraded driver set - me=
aning the<br>
correct network settings are persisted.<br>
<br>
I dont have a good replacement for cleaning up user mode services (xenbus_m=
onitor<br>
xenagent and xencons_monitor) on device uninstall. This *should* be handled=
 correctly<br>
by the PnP manager, but failing to stop either service should not be detrem=
ental to<br>
the operation of the VM. Selecting the &quot;Delete Drivers&quot; option du=
ring uninstall will<br>
stop and disable these services, not selecting this option will leave these=
 services<br>
running.<br>
<br>
Owen Smith (6):<br>
=C2=A0 Remove CoInstaller from INF<br>
=C2=A0 Reset StorNvme&#39;s StartOverride<br>
=C2=A0 Delete CoInstaller code<br>
=C2=A0 Fix Length calculation in PdoQueryId<br>
=C2=A0 Remove REV from DeviceID<br>
=C2=A0 Add Unplug v2 interface (REV_0900000A)<br>
<br>
=C2=A0include/revision.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 3 +-<br>
=C2=A0include/unplug_interface.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A030 +-<br>
=C2=A0include/xen.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=
=A0 7 +<br>
=C2=A0src/coinst/coinst.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 2136 -----------------<br=
>
=C2=A0src/coinst/xenbus_coinst.def=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A038 -<br>
=C2=A0src/coinst/xenbus_coinst.rc=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A057 -<br>
=C2=A0src/monitor/monitor.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A063 +<br>
=C2=A0src/xen/unplug.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A015 +<br>
=C2=A0src/xenbus.inf=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A020 +=
-<br>
=C2=A0src/xenbus/pdo.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A014 +-<br=
>
=C2=A0src/xenbus/unplug.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A061 +<br>
=C2=A0vs2015/package/package.vcxproj=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 3 -<br>
=C2=A0vs2015/xenbus.sln=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A022 -<br>
=C2=A0vs2015/xenbus_coinst/xenbus_coinst.vcxproj=C2=A0 =C2=A0 |=C2=A0 =C2=
=A064 -<br>
=C2=A0.../xenbus_coinst/xenbus_coinst.vcxproj.user=C2=A0 |=C2=A0 =C2=A0 8 -=
<br>
=C2=A0vs2017/package/package.vcxproj=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 3 -<br>
=C2=A0vs2017/xenbus.sln=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A022 -<br>
=C2=A0vs2017/xenbus_coinst/xenbus_coinst.vcxproj=C2=A0 =C2=A0 |=C2=A0 =C2=
=A064 -<br>
=C2=A0.../xenbus_coinst/xenbus_coinst.vcxproj.user=C2=A0 |=C2=A0 =C2=A0 8 -=
<br>
=C2=A0vs2019/package/package.vcxproj=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 3 -<br>
=C2=A0vs2019/xenbus.sln=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A022 -<br>
=C2=A0vs2019/xenbus_coinst/xenbus_coinst.vcxproj=C2=A0 =C2=A0 |=C2=A0 =C2=
=A070 -<br>
=C2=A0.../xenbus_coinst/xenbus_coinst.vcxproj.user=C2=A0 |=C2=A0 =C2=A0 8 -=
<br>
=C2=A0vs2022/package/package.vcxproj=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 3 -<br>
=C2=A0vs2022/xenbus.sln=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A022 -<br>
=C2=A0vs2022/xenbus_coinst/xenbus_coinst.vcxproj=C2=A0 =C2=A0 |=C2=A0 =C2=
=A070 -<br>
=C2=A0.../xenbus_coinst/xenbus_coinst.vcxproj.user=C2=A0 |=C2=A0 =C2=A0 8 -=
<br>
=C2=A027 files changed, 187 insertions(+), 2657 deletions(-)<br>
=C2=A0delete mode 100644 src/coinst/coinst.c<br>
=C2=A0delete mode 100644 src/coinst/xenbus_coinst.def<br>
=C2=A0delete mode 100644 src/coinst/xenbus_coinst.rc<br>
=C2=A0delete mode 100644 vs2015/xenbus_coinst/xenbus_coinst.vcxproj<br>
=C2=A0delete mode 100644 vs2015/xenbus_coinst/xenbus_coinst.vcxproj.user<br=
>
=C2=A0delete mode 100644 vs2017/xenbus_coinst/xenbus_coinst.vcxproj<br>
=C2=A0delete mode 100644 vs2017/xenbus_coinst/xenbus_coinst.vcxproj.user<br=
>
=C2=A0delete mode 100644 vs2019/xenbus_coinst/xenbus_coinst.vcxproj<br>
=C2=A0delete mode 100644 vs2019/xenbus_coinst/xenbus_coinst.vcxproj.user<br=
>
=C2=A0delete mode 100644 vs2022/xenbus_coinst/xenbus_coinst.vcxproj<br>
=C2=A0delete mode 100644 vs2022/xenbus_coinst/xenbus_coinst.vcxproj.user<br=
>
<br>
-- <br>
2.41.0.windows.3<br>
<br>
</blockquote></div>

--000000000000ec08f906043339bf--


From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:50:14 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:50:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593461.926455 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbcRS-00057Q-FA; Thu, 31 Aug 2023 07:50:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593461.926455; Thu, 31 Aug 2023 07:50: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 1qbcRS-00057J-CX; Thu, 31 Aug 2023 07:50:14 +0000
Received: by outflank-mailman (input) for mailman id 593461;
 Thu, 31 Aug 2023 07:50:12 +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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbcRQ-00057D-MD
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:50:12 +0000
Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com
 [2a00:1450:4864:20::336])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 03388737-47d3-11ee-8783-cb3800f73035;
 Thu, 31 Aug 2023 09:50:11 +0200 (CEST)
Received: by mail-wm1-x336.google.com with SMTP id
 5b1f17b1804b1-401bdff4cb4so4848915e9.3
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:50:11 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 k8-20020a5d6d48000000b0031434c08bb7sm1260078wri.105.2023.08.31.00.50.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Aug 2023 00:50: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: 03388737-47d3-11ee-8783-cb3800f73035
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693468210; x=1694073010; 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=buVEqalihLj5yy45L9BmSbh+xn0Km8z2ER4IIbFCypk=;
        b=Gu50A+1NdAyWVGSsou3kS7GhCQDW3F6xyHodpsDn/ZIPyucVelNEq9XjGkSK5UOzRX
         9PDekX/HiEJ89B+Qa1X3v9XSxiXzPq+a3m/7oa/kPTf7dCWaIAolLB3tbSG8GiktIZSL
         F4AvPVxoOsvAij4PMrxub25tDVakjKLsxel20=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693468210; x=1694073010;
        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=buVEqalihLj5yy45L9BmSbh+xn0Km8z2ER4IIbFCypk=;
        b=Mho3jX4rmFqVLm2CILRsc+cJnGsEiHjY9ymthDMbexOiyDjALuNz9l140szYbyrvql
         0dO1Axb23K+7XyskLMZndl7CkqKZphD4r5mAWI1PWBNETfc0njynLwEcP9i56FQIK8ed
         A7udGizHK+rOWwBatyuzd+EcBkFZW3BdtkpD5IC3b5m88I/5sm6PHAbycITB0Ufc2W5V
         OkW4VAVy03BoGeLy00CI0kZG+3zTO2tWtOEWzf78XTKYkzxRz6FVub7EtBNzVn+zCNS5
         Wh+vEAsdqJRirfMBqptz/p7idSX43WvBwD8j+RrsPR6kYVxdFJAZYLKx6VUzRdRbbnm7
         40lw==
X-Gm-Message-State: AOJu0YzVovRb8mM1Fu/IywlOyVdpInFjVySNO6AdmBsysSHAmKUO0YjG
	NMwKW5fGlSIw8MX3CdYpeT3AEAmu0Hjl/9Ru3c0l
X-Google-Smtp-Source: AGHT+IE9vYEvBxZ1mjb0Y9cOAAraiK/7HLEZ1Aaja/0mYxKP4AS03xZI5yzf5iDkWOjkuyphNDqWtw==
X-Received: by 2002:a5d:490a:0:b0:317:6965:ef4d with SMTP id x10-20020a5d490a000000b003176965ef4dmr3025393wrq.56.1693468210590;
        Thu, 31 Aug 2023 00:50:10 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [RFC: PATCH 0/5] Remove CoInstallers
Date: Thu, 31 Aug 2023 08:49:55 +0100
Message-ID: <20230831075000.984-1-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Windows 11 22H2 WHQL testing has highlighted the need to remove CoInstallers.
The current CoInstaller handle several edge cases that will need replacement
implementations. This patch series for most drivers offers a potential solution
to the removal of CoInstallers and the required changes to avoid upgrade issues.

CoInstallers have several uses currently:
- Adds an upgrade block function with the "AllowUpgrade" value blocking driver
  upgrades when set.
- Checks all currently installed child devices have a supported set of interfaces
  common with the new parent device.
- Clears the Unplug keys only when required.

The AllowUpgrade function has not been replaced - I have not seen this used in
the current implementations of the drivers.

The interface compatability checks can be replaced with the matching if RevisionIDs
in the INF files, so that child devices will only install on parent devices that
expose a matching HardwareID or CompatibleID. This does leave the case where the
new parent driver could drop support for an interface version that is currently in
use. This will mandate a further driver upgrade, and should remove the Unplug keys
and mandate a reboot where the emulated devices are present, to ensure continued
operation. After this reboot using emulated devices, updates to the child devices
should be detected and installed, requiring another reboot to revert to PV devices.

Unplug keys getting cleared on all upgrades should allow the next boot to use emulated
devices, unless a subsequent install updates dependent drivers to use a working set
of new interfaces. The requirement here is that updating any driver should always
allow a reboot with emulated devices, should any further issues be detected.

I believe that, going forward, changing the DeviceID to remove the RevisionID will
avoid the need to set network IDs and copy settings from the previous network
connection to the new network connection. This change will mean the driver selection
during installation/upgrade will use the HardwareIDs (with RevisionIDs) to match the
ID in the DDInstall INF section (with RevisionID), and use the DeviceID to generate
the Matching Device ID and Instance ID. This means that once drivers have been
upgraded, the InstanceIDs should not change, and Windows should not generate a new
network connection (with default settings) for the upgraded driver set - meaning the
correct network settings are persisted.

Owen Smith (5):
  Remove CoInstaller from INF
  Delete CoInstaller code
  Fix Length calculation in PdoQueryId
  Remove REV from DeviceID
  Add Unplug v2

 include/unplug_interface.h                    |   30 +-
 src/coinst/coinst.c                           | 1732 -----------------
 src/coinst/xenvif_coinst.def                  |   38 -
 src/coinst/xenvif_coinst.rc                   |   57 -
 src/xenvif.inf                                |   23 +-
 src/xenvif/pdo.c                              |   37 +-
 vs2015/package/package.vcxproj                |    3 -
 vs2015/xenvif.sln                             |   27 -
 vs2015/xenvif_coinst/xenvif_coinst.vcxproj    |   65 -
 .../xenvif_coinst/xenvif_coinst.vcxproj.user  |    8 -
 vs2017/package/package.vcxproj                |    3 -
 vs2017/xenvif.sln                             |   27 -
 vs2017/xenvif_coinst/xenvif_coinst.vcxproj    |   65 -
 .../xenvif_coinst/xenvif_coinst.vcxproj.user  |    8 -
 vs2019/package/package.vcxproj                |    3 -
 vs2019/xenvif.sln                             |   27 -
 vs2019/xenvif_coinst/xenvif_coinst.vcxproj    |   71 -
 .../xenvif_coinst/xenvif_coinst.vcxproj.user  |    8 -
 vs2022/package/package.vcxproj                |    3 -
 vs2022/xenvif.sln                             |   27 -
 vs2022/xenvif_coinst/xenvif_coinst.vcxproj    |   71 -
 .../xenvif_coinst/xenvif_coinst.vcxproj.user  |    8 -
 22 files changed, 62 insertions(+), 2279 deletions(-)
 delete mode 100644 src/coinst/coinst.c
 delete mode 100644 src/coinst/xenvif_coinst.def
 delete mode 100644 src/coinst/xenvif_coinst.rc
 delete mode 100644 vs2015/xenvif_coinst/xenvif_coinst.vcxproj
 delete mode 100644 vs2015/xenvif_coinst/xenvif_coinst.vcxproj.user
 delete mode 100644 vs2017/xenvif_coinst/xenvif_coinst.vcxproj
 delete mode 100644 vs2017/xenvif_coinst/xenvif_coinst.vcxproj.user
 delete mode 100644 vs2019/xenvif_coinst/xenvif_coinst.vcxproj
 delete mode 100644 vs2019/xenvif_coinst/xenvif_coinst.vcxproj.user
 delete mode 100644 vs2022/xenvif_coinst/xenvif_coinst.vcxproj
 delete mode 100644 vs2022/xenvif_coinst/xenvif_coinst.vcxproj.user

-- 
2.41.0.windows.3



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:50:16 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:50:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593462.926460 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbcRU-00059n-I0; Thu, 31 Aug 2023 07:50:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593462.926460; Thu, 31 Aug 2023 07:50: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 1qbcRU-00059g-EZ; Thu, 31 Aug 2023 07:50:16 +0000
Received: by outflank-mailman (input) for mailman id 593462;
 Thu, 31 Aug 2023 07:50:15 +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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbcRT-00059E-JD
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:50:15 +0000
Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com
 [2a00:1450:4864:20::32b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 04824ecc-47d3-11ee-9b0d-b553b5be7939;
 Thu, 31 Aug 2023 09:50:13 +0200 (CEST)
Received: by mail-wm1-x32b.google.com with SMTP id
 5b1f17b1804b1-401da71b7faso5163615e9.2
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:50:13 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 k8-20020a5d6d48000000b0031434c08bb7sm1260078wri.105.2023.08.31.00.50.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Aug 2023 00:50: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: 04824ecc-47d3-11ee-9b0d-b553b5be7939
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693468213; x=1694073013; 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=vzOOAnBW85OAXZ4uheMTNkrqVuaLfmoTGmP3jZpJsec=;
        b=LP6NIO5CJZ4cef2/3alR3xPI5MeKFCyQ6M04HBY60Pu16ZX474BOVZ1xdEGTLKUhUn
         lLy03K81DOVuRamN3xsBiE45VrfPsVq4CGtojxiAwzu5D7TPyb0uZc/mcauNQDFQYym8
         /0o0SeoNNHZEAEUzsn/Sx9IR+hfmOCyc3mTes=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693468213; x=1694073013;
        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=vzOOAnBW85OAXZ4uheMTNkrqVuaLfmoTGmP3jZpJsec=;
        b=c3WLiJpWnZ7sn60xdq6iGYDyOmSwanNIVGtjy017J4Or+XtzGIn750iOWySPULb0uz
         cByU/Boswmzw/yBpuyPJuTMXhoa3jsyHHavkbRZ1BFvwz2m0fCNlHe6cILTjtD0nz+vQ
         0xqqrj4xsj0wYfmS9VLV2HXxSJw9TOYAfbIcxsXs6TDfh0/KnW+nR9/U4333ITaYkEY/
         WVQvNb20mEY0ss/KhjrbQvzXnhDk/xILvpfJSaOEg4q2li/yk/nPVkiVKX9gUIO5JTeo
         izoRvhwfNmqBQNRO0glFfS8bP4yYceI9utcmQjOQlMEGqM5KAfurYjypr+Ng9EiBP3GS
         nbuQ==
X-Gm-Message-State: AOJu0YxrIo7UHx4iWrAFtFLTrz46trjATkTw2VIHP3PZqoQaUXH3nzWg
	SHgu4c1tt/qjrlOrLPiJMxFwx8nOR9+T9KMwAudV
X-Google-Smtp-Source: AGHT+IF3hdPo5RI44DnolyQj3bIJ2ivp9NDIjT1CxREh/vhIyGs/0AkoTfwymDtSoxs1LFT3/D4Icg==
X-Received: by 2002:a5d:50c5:0:b0:319:74b5:b67d with SMTP id f5-20020a5d50c5000000b0031974b5b67dmr3276283wrt.66.1693468212907;
        Thu, 31 Aug 2023 00:50:12 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [RFC: PATCH 3/5] Fix Length calculation in PdoQueryId
Date: Thu, 31 Aug 2023 08:49:58 +0100
Message-ID: <20230831075000.984-4-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.3
In-Reply-To: <20230831075000.984-1-owen.smith@cloud.com>
References: <20230831075000.984-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Decrease Length by the string length of the current ID before moving
the Buffer value to the end of the current ID. Without this, Length
is not decreased, leading to potential issues with the next call to
RtlStringCbPrintfW.

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

diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
index 1d163c9..d43702e 100644
--- a/src/xenvif/pdo.c
+++ b/src/xenvif/pdo.c
@@ -2100,11 +2100,11 @@ PdoQueryId(
                                         Revision->Number);
             ASSERT(NT_SUCCESS(status));
 
-            Buffer += wcslen(Buffer);
             Length -= (ULONG)(wcslen(Buffer) * sizeof (WCHAR));
+            Buffer += wcslen(Buffer);
 
-            Buffer++;
             Length -= sizeof (WCHAR);
+            Buffer++;
 
             --Index;
         }
-- 
2.41.0.windows.3



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:50:16 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:50:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593464.926463 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbcRU-0005Ab-Lq; Thu, 31 Aug 2023 07:50:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593464.926463; Thu, 31 Aug 2023 07:50: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 1qbcRU-0005A6-HQ; Thu, 31 Aug 2023 07:50:16 +0000
Received: by outflank-mailman (input) for mailman id 593464;
 Thu, 31 Aug 2023 07:50:16 +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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbcRU-00059E-8K
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:50:16 +0000
Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com
 [2a00:1450:4864:20::42c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 03b8d1e5-47d3-11ee-9b0d-b553b5be7939;
 Thu, 31 Aug 2023 09:50:12 +0200 (CEST)
Received: by mail-wr1-x42c.google.com with SMTP id
 ffacd0b85a97d-31c615eb6feso374266f8f.3
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:50:12 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 k8-20020a5d6d48000000b0031434c08bb7sm1260078wri.105.2023.08.31.00.50.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Aug 2023 00:50: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: 03b8d1e5-47d3-11ee-9b0d-b553b5be7939
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693468211; x=1694073011; 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=fvg/ECA2e7WackSZSti5BtkGIDmuOKBlDMQvD5kjk+w=;
        b=bxutw60oikdCGUDJz1M5+AKipb0SKYzvG6SZOpckY0Z5TZedRrxkBsL6g/8tTWF6xO
         /3G/Yfx63tRP2lTzS5N02Ig+xeB6FZLYcdTlhNRjazLyLlToGMAZ8/+vyWNhNJ6D+Pb1
         uBbchx5lnnVNe+jjN/cPBYQsZwsmSz6g7IhT0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693468211; x=1694073011;
        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=fvg/ECA2e7WackSZSti5BtkGIDmuOKBlDMQvD5kjk+w=;
        b=hHaNEtwuNTp5y9LEoPFs+7wX7Ly2sB2UznWje4n2TXs1bXA6jsnBAFCE6YmXPlZWSf
         K9pMbwU3RlmKxo+wvy61XLY0ugtaQWyc4pxFHQ1BCczro8B7mthIgsIezifzujH4dB54
         FuHnyxGTz+p59HQW522KLsXB+A3FPufbOAiSw1kAvSh6vjvPYQfRErZAxzliLEg9982A
         EpUzOM+bTINFhusFyaNEDzikm9aZYfXIFfdosM4plvp57x8AWEN/a0J4ak83WrbbWzg3
         HhMogtn+aG0xeyyYVM7x0mVYHJiX7j0hKfGN4IT+QFGOyec5HCd0aC0E3HK1bRA+npyw
         uEaA==
X-Gm-Message-State: AOJu0YwX1eMilvguaCcK7l2XD3HmK3SSFXvaqgW/u+u8k440VYcWfGjh
	90vgbFxNmSUYj+HvTYJ0V07HEzynDBL/BHjtygyF
X-Google-Smtp-Source: AGHT+IGvK22/u3gkdJOHMO87qOEEQnTK0Dp3ENdm2mGWlF1lvM00t5M7hVxgFPI5pO4ae7TBCmxQRA==
X-Received: by 2002:adf:f30d:0:b0:319:6e74:1637 with SMTP id i13-20020adff30d000000b003196e741637mr3220576wro.27.1693468211450;
        Thu, 31 Aug 2023 00:50: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: [RFC: PATCH 1/5] Remove CoInstaller from INF
Date: Thu, 31 Aug 2023 08:49:56 +0100
Message-ID: <20230831075000.984-2-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.3
In-Reply-To: <20230831075000.984-1-owen.smith@cloud.com>
References: <20230831075000.984-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Windows 11 22H2 WHQL requires INF file pass "InfVerif /k", which highlights
several issues
- PnpLockdown=1 needs to be specified
- CoInstallers are no longer allowed

The CoInstaller has several functions that will need alternative solutions:
- The AllowUpdate mechanism is no longer possible
- The safety checks that ensure interface versionings remain compatible
- The writing of 'current' network identifiers to the registry in order to
  copy network settings.

Interface safety checks need to be handled by changes to child device bindings,
and assuming upgrade via emulated devices is safe. The unplug key is cleared
in the INF to revert to emulated NICs on the next boot, incase the current child
drivers rely on an interface that is no longer present (note: in this case,
child drivers will need updating).

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

diff --git a/src/xenvif.inf b/src/xenvif.inf
index 4b5c9f7..ec66434 100644
--- a/src/xenvif.inf
+++ b/src/xenvif.inf
@@ -38,20 +38,16 @@ Provider=%Vendor%
 CatalogFile=xenvif.cat
 DriverVer=@INF_DATE@,@MAJOR_VERSION@.@MINOR_VERSION@.@MICRO_VERSION@.@BUILD_NUMBER@
 DriverPackageDisplayName=%DiskDesc%
+PnpLockdown=1
 
 [DestinationDirs] 
 DefaultDestDir=12 
-CoInst_CopyFiles=11
 
 [SourceDisksNames]
 0=%DiskDesc%
 
 [SourceDisksFiles]
 xenvif.sys=0,,
-xenvif_coinst.dll=0,,
-
-[CoInst_CopyFiles]
-xenvif_coinst_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll,xenvif_coinst.dll
 
 [Manufacturer] 
 %Vendor%=Inst,NT@INF_ARCH@
@@ -80,7 +76,7 @@ StartType=%SERVICE_DEMAND_START%
 ErrorControl=%SERVICE_ERROR_NORMAL% 
 ServiceBinary=%12%\xenvif.sys 
 LoadOrderGroup="NDIS"
-AddReg = XenVif_BootFlags, XenVif_Parameters
+AddReg = XenVif_BootFlags, XenVif_Parameters, XenVif_Unplug
 
 [XenVif_BootFlags]
 HKR,,"BootFlags",0x00010003,0x81
@@ -90,12 +86,8 @@ HKR,"Parameters",,0x00000010
 HKR,"Parameters","RequestKey",0x00000000,%RequestKey%
 HKR,"Parameters","FrontendMaxQueues",0x00010001,0x00000008
 
-[XenVif_Inst.CoInstallers]
-CopyFiles=CoInst_CopyFiles
-AddReg=CoInst_AddReg
-
-[CoInst_AddReg]
-HKR,,CoInstallers32,0x00010000,"xenvif_coinst_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll,Entry"
+[XenVif_Unplug]
+HKLM,%UnplugKey%,"NICS",0x00010001,0
 
 [Strings] 
 
@@ -103,6 +95,7 @@ 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 
 SERVICE_SYSTEM_START=0x1 
-- 
2.41.0.windows.3



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:50:16 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:50:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593463.926466 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbcRU-0005A7-NK; Thu, 31 Aug 2023 07:50:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593463.926466; Thu, 31 Aug 2023 07:50: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 1qbcRU-00059r-Fn; Thu, 31 Aug 2023 07:50:16 +0000
Received: by outflank-mailman (input) for mailman id 593463;
 Thu, 31 Aug 2023 07:50: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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbcRT-00057D-PM
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:50:15 +0000
Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com
 [2a00:1450:4864:20::42f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0577375b-47d3-11ee-8783-cb3800f73035;
 Thu, 31 Aug 2023 09:50:15 +0200 (CEST)
Received: by mail-wr1-x42f.google.com with SMTP id
 ffacd0b85a97d-31ad779e6b3so378004f8f.2
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:50:15 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 k8-20020a5d6d48000000b0031434c08bb7sm1260078wri.105.2023.08.31.00.50.13
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Aug 2023 00:50: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: 0577375b-47d3-11ee-8783-cb3800f73035
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693468214; x=1694073014; 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=b1CXxDgwz4Ac/nSw39f2puvA+A3Qghfzh/cDLS0i06Y=;
        b=Ij/DaSAUi19YSA7K8cNgpZj7b7kxo7UkxPG2XJ+mjDskVM9nUOg8y29raI5Q3jHC/v
         gJv7/N3wxP+aEOiN9MXKhWbcOVHB1LRPNTGX/m+/9GxiViq5qMKKEoYUgrkRGyzenR5H
         fJ8D7sB3ZuBUMENZ8DzKIpp6FKn7fSLCvfofs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693468214; x=1694073014;
        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=b1CXxDgwz4Ac/nSw39f2puvA+A3Qghfzh/cDLS0i06Y=;
        b=L3dnG+a2Ze66+Og8baxtS4vu2IGWd2zDb/cDhaT8PlN33MTrIM2673/4JiG6CIGQNh
         UDVlyDfjsAuamDFUXeCPNfkR9jIp4q+0gMP5Uk4n+MOtGLV0T5aXSvHrRb45HwepH+iX
         HhHtfpvYsPL0hUpARYkKmU9ajsuId49RB3Qv59MGOnYOK7y3ClUnLt3k6MeXv7YKkclg
         19gY8FsCmFROtrppBZRTi7GP5ys4yxnunLUExHggSr133TH/6QMUaTkeBmUPz0rjJEzB
         rDbpW74vyIoKG7zczd6PiR3NeoIpkNmUr+rDHMXOZRVZLoJXWNtAx+R3V6Nd9mkMsLsX
         bn2A==
X-Gm-Message-State: AOJu0Yz6kusqUqrwrhVkY1URuy3L+GKNbaqNw/DO+W09CDUyjJAvlArv
	z7EyofBNOZT5PBGOnuZ47JwHJdoQeUMIJPb9s7xs
X-Google-Smtp-Source: AGHT+IGrjyL1vwVu1iB5RB2GEI9ZvXDDtQlP7Sax9eJoKqX2gppEwplNZ15wEyXV8hNzkFnhBG/wbw==
X-Received: by 2002:a5d:500d:0:b0:31a:d90d:8d9f with SMTP id e13-20020a5d500d000000b0031ad90d8d9fmr3385291wrt.25.1693468214526;
        Thu, 31 Aug 2023 00:50:14 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [RFC: PATCH 4/5] Remove REV from DeviceID
Date: Thu, 31 Aug 2023 08:49:59 +0100
Message-ID: <20230831075000.984-5-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.3
In-Reply-To: <20230831075000.984-1-owen.smith@cloud.com>
References: <20230831075000.984-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Driver upgrades use HardwareIDs (or CompatibleIDs) to match the child INF DDInstall
section (stored as matching device id), but use the DeviceID to generate the device
instance path. By keeping the device instance path the same over upgrades, the network
stack should identify this as an upgrade, rather than 'replacement hardware', and
not generate a new network connection, which would require network settings to be
copied from the existing network connection to the new network connection.

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

diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
index d43702e..288419c 100644
--- a/src/xenvif/pdo.c
+++ b/src/xenvif/pdo.c
@@ -2062,18 +2062,12 @@ PdoQueryId(
         break;
 
     case BusQueryDeviceID: {
-        ULONG                   Index;
-        PXENVIF_PDO_REVISION    Revision;
-
         Type = REG_SZ;
-        Index = ARRAYSIZE(PdoRevision) - 1;
-        Revision = &PdoRevision[Index];
 
         status = RtlStringCbPrintfW(Buffer,
                                     Id.MaximumLength,
-                                    L"XENVIF\\VEN_%hs&DEV_NET&REV_%08X",
-                                    __PdoGetVendorName(Pdo),
-                                    Revision->Number);
+                                    L"XENVIF\\VEN_%hs&DEV_NET",
+                                    __PdoGetVendorName(Pdo));
         ASSERT(NT_SUCCESS(status));
 
         Buffer += wcslen(Buffer);
-- 
2.41.0.windows.3



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:50:18 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:50:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593465.926472 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbcRW-0005GK-M0; Thu, 31 Aug 2023 07:50:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593465.926472; Thu, 31 Aug 2023 07:50: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 1qbcRW-0005GC-Ix; Thu, 31 Aug 2023 07:50:18 +0000
Received: by outflank-mailman (input) for mailman id 593465;
 Thu, 31 Aug 2023 07:50: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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbcRV-00059E-Ih
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:50:17 +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 05ee465f-47d3-11ee-9b0d-b553b5be7939;
 Thu, 31 Aug 2023 09:50:15 +0200 (CEST)
Received: by mail-lj1-x22d.google.com with SMTP id
 38308e7fff4ca-2bc63e0d8cdso9796831fa.2
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:50:15 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 k8-20020a5d6d48000000b0031434c08bb7sm1260078wri.105.2023.08.31.00.50.14
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Aug 2023 00:50: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: 05ee465f-47d3-11ee-9b0d-b553b5be7939
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693468215; x=1694073015; 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=YO56EIEVNn0zXIR3OParEGUq5FiEJ8ldw9arbwhnWF4=;
        b=bMCe5cJ4zvpstrY7v5aUUlyuncNwnN4al82NMrdGmYDRxHeHq/As7/V186gjjuc0bk
         GSCRO801vi7J+pXjeQv63n1pzPXrgNM3YPnBck6TwgDOCRT+lrpGelmsAUE1ludPYA8/
         dfgNeR9LDjjLVF4K5CHgWcadFtr9VEwtyIMb0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693468215; x=1694073015;
        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=YO56EIEVNn0zXIR3OParEGUq5FiEJ8ldw9arbwhnWF4=;
        b=d/lfplNLv8pCGX3z6l4B8jlACz7+fYrVCI6skE9T++Sr0BPTnNkuEhqKP1EmPkBrV+
         fFLhh/zRECdI58UyqzKdwoMMKfzw1ENGu42WAsPDSsdH04ZUpSX4vLEHgmad1PU9Wfkt
         k3Twlma71qKSQqJKX1dwlUi/Xy03c2YFQfZhw/XBQy35AwfRzzXHPdTmuSqhqIrH4rgf
         jiqHR0mfRJJ52tMW3WMPDyNZF1rvx21Z+gBoY/OPGpxiaMaQDImwYpT0akLN+TT1Ndcs
         omZ535zu4yf4TUnzOMx3KWY2vXJdpzdWZkx6OKPF0a7v48g6pFqYzCbdoh5igWWjYyad
         kvbg==
X-Gm-Message-State: AOJu0Yya7D1a+kbohfgKwB/JroE+LVzQCJSG+HNAKbLC0T+2ds9ZiO4u
	N+DL4bK0a0GivCV6YZi+icxwPf9lsyR+zRRbpCQK
X-Google-Smtp-Source: AGHT+IHcX6klEHy8vzIQS/sWInoy81kKLdKDMVtpLAxR+9+ZbnQ6tRJPr3yNpPzbxd/8GpOHXYuc5Q==
X-Received: by 2002:a2e:3203:0:b0:2bc:c259:5dae with SMTP id y3-20020a2e3203000000b002bcc2595daemr3385599ljy.12.1693468215242;
        Thu, 31 Aug 2023 00:50:15 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [RFC: PATCH 5/5] Add Unplug v2
Date: Thu, 31 Aug 2023 08:50:00 +0100
Message-ID: <20230831075000.984-6-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.3
In-Reply-To: <20230831075000.984-1-owen.smith@cloud.com>
References: <20230831075000.984-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

If NICs have not been unplugged, do not start PV network devices and trigger a
required reboot.
This is to avoid the upgrade case where both emulated and PV devices could be
present, due to a 'revert to emulated' policy and emulated NICs not currently
getting IP configurations so the HasAlias value is not determined correctly.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 include/unplug_interface.h | 30 ++++++++++++++++++++++++++++--
 src/xenvif.inf             |  6 +++---
 src/xenvif/pdo.c           | 23 ++++++++++++++++++++++-
 3 files changed, 53 insertions(+), 6 deletions(-)

diff --git a/include/unplug_interface.h b/include/unplug_interface.h
index e465e2e..82afb63 100644
--- a/include/unplug_interface.h
+++ b/include/unplug_interface.h
@@ -85,6 +85,20 @@ typedef VOID
     IN  BOOLEAN                     Make
     );
 
+/*! \typedef XENBUS_UNPLUG_GETSTATE
+    \brief Has a type of emulated device been unplugged
+
+    \param Interface The interface header
+    \param Type The type of device
+
+    \return TRUE The type of device has been unplugged this boot
+*/
+typedef BOOLEAN
+(*XENBUS_UNPLUG_GETSTATE)(
+    IN  PINTERFACE                  Interface,
+    IN  XENBUS_UNPLUG_DEVICE_TYPE   Type
+    );
+
 // {73db6517-3d06-4937-989f-199b7501e229}
 DEFINE_GUID(GUID_XENBUS_UNPLUG_INTERFACE,
 0x73db6517, 0x3d06, 0x4937, 0x98, 0x9f, 0x19, 0x9b, 0x75, 0x01, 0xe2, 0x29);
@@ -100,7 +114,19 @@ struct _XENBUS_UNPLUG_INTERFACE_V1 {
     XENBUS_UNPLUG_REQUEST   UnplugRequest;
 };
 
-typedef struct _XENBUS_UNPLUG_INTERFACE_V1 XENBUS_UNPLUG_INTERFACE, *PXENBUS_UNPLUG_INTERFACE;
+/*! \struct _XENBUS_UNPLUG_INTERFACE_V2
+    \brief UNPLUG interface version 2
+    \ingroup interfaces
+*/
+struct _XENBUS_UNPLUG_INTERFACE_V2 {
+    INTERFACE               Interface;
+    XENBUS_UNPLUG_ACQUIRE   UnplugAcquire;
+    XENBUS_UNPLUG_RELEASE   UnplugRelease;
+    XENBUS_UNPLUG_REQUEST   UnplugRequest;
+    XENBUS_UNPLUG_GETSTATE  UnplugGetState;
+};
+
+typedef struct _XENBUS_UNPLUG_INTERFACE_V2 XENBUS_UNPLUG_INTERFACE, *PXENBUS_UNPLUG_INTERFACE;
 
 /*! \def XENBUS_UNPLUG
     \brief Macro at assist in method invocation
@@ -111,6 +137,6 @@ typedef struct _XENBUS_UNPLUG_INTERFACE_V1 XENBUS_UNPLUG_INTERFACE, *PXENBUS_UNP
 #endif  // _WINDLL
 
 #define XENBUS_UNPLUG_INTERFACE_VERSION_MIN  1
-#define XENBUS_UNPLUG_INTERFACE_VERSION_MAX  1
+#define XENBUS_UNPLUG_INTERFACE_VERSION_MAX  2
 
 #endif  // _XENBUS_UNPLUG_INTERFACE_H
diff --git a/src/xenvif.inf b/src/xenvif.inf
index ec66434..8bfc37c 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_09000009
-%XenVifName%		=XenVif_Inst,	XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_VIF&REV_09000009
-%XenVifName%		=XenVif_Inst,	XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_VIF&REV_09000009
+%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
 
 [XenVif_Inst] 
 CopyFiles=XenVif_Copyfiles
diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
index 288419c..de7d991 100644
--- a/src/xenvif/pdo.c
+++ b/src/xenvif/pdo.c
@@ -1247,6 +1247,27 @@ PdoUnplugRequest(
     XENBUS_UNPLUG(Release, &Pdo->UnplugInterface);
 }
 
+static BOOLEAN
+PdoUnplugRequested(
+    IN  PXENVIF_PDO Pdo
+    )
+{
+    BOOLEAN         State;
+    NTSTATUS        status;
+
+    status = XENBUS_UNPLUG(Acquire, &Pdo->UnplugInterface);
+    if (!NT_SUCCESS(status))
+        return FALSE;
+
+    State = XENBUS_UNPLUG(GetState,
+                          &Pdo->UnplugInterface,
+                          XENBUS_UNPLUG_DEVICE_TYPE_NICS);
+
+    XENBUS_UNPLUG(Release, &Pdo->UnplugInterface);
+
+    return State;
+}
+
 static DECLSPEC_NOINLINE NTSTATUS
 PdoStartDevice(
     IN  PXENVIF_PDO     Pdo,
@@ -1343,7 +1364,7 @@ PdoStartDevice(
         break;
     }
 
-    if (Pdo->HasAlias) {
+    if (Pdo->HasAlias || !PdoUnplugRequested(Pdo)) {
         PdoUnplugRequest(Pdo, TRUE);
 
         status = STATUS_PNP_REBOOT_REQUIRED;
-- 
2.41.0.windows.3



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 31 07:50:19 2023
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 31 Aug 2023 07:50:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.593466.926476 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1qbcRX-0005J1-Ng; Thu, 31 Aug 2023 07:50:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 593466.926476; Thu, 31 Aug 2023 07:50:19 +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 1qbcRX-0005Iu-KV; Thu, 31 Aug 2023 07:50:19 +0000
Received: by outflank-mailman (input) for mailman id 593466;
 Thu, 31 Aug 2023 07:50:18 +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=hH+Z=EQ=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1qbcRW-00059E-8g
 for win-pv-devel@lists.xenproject.org; Thu, 31 Aug 2023 07:50:18 +0000
Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com
 [2a00:1450:4864:20::330])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0515b13d-47d3-11ee-9b0d-b553b5be7939;
 Thu, 31 Aug 2023 09:50:14 +0200 (CEST)
Received: by mail-wm1-x330.google.com with SMTP id
 5b1f17b1804b1-401f503b529so4663655e9.0
 for <win-pv-devel@lists.xenproject.org>; Thu, 31 Aug 2023 00:50:14 -0700 (PDT)
Received: from localhost.localdomain ([185.25.65.68])
 by smtp.gmail.com with ESMTPSA id
 k8-20020a5d6d48000000b0031434c08bb7sm1260078wri.105.2023.08.31.00.50.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 31 Aug 2023 00:50: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: 0515b13d-47d3-11ee-9b0d-b553b5be7939
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1693468213; x=1694073013; 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=czgSoM1D8vavte25swbz1XvR99M1WJ2W3Q+75nbNmO8=;
        b=FH6ifWV0SSkyfa1JPz9PWYyCaicatWtKm1BYej9Y5pTqGp8jxusNbSWvQfL2d7O93F
         T5K+Pq9GZKwNr7XDxoQG9YKWYhMmI628LAAaq8MzRmznYO90UnBF8bjH9U6ZiepxxqPZ
         K+ETxCtv7TBR4PReL2Gm6yN9bK9KIJF3/rZ+0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1693468213; x=1694073013;
        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=czgSoM1D8vavte25swbz1XvR99M1WJ2W3Q+75nbNmO8=;
        b=ZStG5ecLnzWwpVBXZG0NymD1N7HsZKM2ntDVFZQOo9XZh+4HKATS3MPMHhKgGIi00s
         7AEatW2faJRkK3FaYl/mPXWQmiEEQHiIIBMdbFX3ythqXbAtk+X3LKgzOQZiq6qOyaSL
         Y0Q58337aPh7SnaEeiLlxNnjzP/zWFVibatbUs68hH9ZkO/rhq1SCXm7wGv5qto9zPeV
         RiiqTw1CRrPQ7FaCq00T/Pz6f9jGdw2RVfGUcat40Z/f3TWFmLz4+QWYAzcUUfnIBXFi
         yJzUf3vi0jlJFoukxJUjyny+vG6ffJuj1gvHhuGQZtCirA27qEbWSFTJHdl5yrtBNjze
         YonA==
X-Gm-Message-State: AOJu0YznXrjtOQiULyYkem14s3p/I8M+vapH5cDW8FK33KxlJN/ZjdZJ
	4UGFQ0dzmzvR/Dva23r2EsDOFTmjuQWbWe3db2yj
X-Google-Smtp-Source: AGHT+IGn0Rx/WIivY0vCRZWYWKrsBGgVh98m9TeRwS8kC2S/y2ozccQzxwaFJxsFn5hRXnnJ8iXf0A==
X-Received: by 2002:adf:f84d:0:b0:31d:d977:4e45 with SMTP id d13-20020adff84d000000b0031dd9774e45mr3487757wrq.18.1693468212277;
        Thu, 31 Aug 2023 00:50:12 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [RFC: PATCH 2/5] Delete CoInstaller code
Date: Thu, 31 Aug 2023 08:49:57 +0100
Message-ID: <20230831075000.984-3-owen.smith@cloud.com>
X-Mailer: git-send-email 2.41.0.windows.3
In-Reply-To: <20230831075000.984-1-owen.smith@cloud.com>
References: <20230831075000.984-1-owen.smith@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

With the CoInstaller removed from the INF file, delete the CoInstaller
source code and projects.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/coinst/coinst.c                           | 1732 -----------------
 src/coinst/xenvif_coinst.def                  |   38 -
 src/coinst/xenvif_coinst.rc                   |   57 -
 vs2015/package/package.vcxproj                |    3 -
 vs2015/xenvif.sln                             |   27 -
 vs2015/xenvif_coinst/xenvif_coinst.vcxproj    |   65 -
 .../xenvif_coinst/xenvif_coinst.vcxproj.user  |    8 -
 vs2017/package/package.vcxproj                |    3 -
 vs2017/xenvif.sln                             |   27 -
 vs2017/xenvif_coinst/xenvif_coinst.vcxproj    |   65 -
 .../xenvif_coinst/xenvif_coinst.vcxproj.user  |    8 -
 vs2019/package/package.vcxproj                |    3 -
 vs2019/xenvif.sln                             |   27 -
 vs2019/xenvif_coinst/xenvif_coinst.vcxproj    |   71 -
 .../xenvif_coinst/xenvif_coinst.vcxproj.user  |    8 -
 vs2022/package/package.vcxproj                |    3 -
 vs2022/xenvif.sln                             |   27 -
 vs2022/xenvif_coinst/xenvif_coinst.vcxproj    |   71 -
 .../xenvif_coinst/xenvif_coinst.vcxproj.user  |    8 -
 19 files changed, 2251 deletions(-)
 delete mode 100644 src/coinst/coinst.c
 delete mode 100644 src/coinst/xenvif_coinst.def
 delete mode 100644 src/coinst/xenvif_coinst.rc
 delete mode 100644 vs2015/xenvif_coinst/xenvif_coinst.vcxproj
 delete mode 100644 vs2015/xenvif_coinst/xenvif_coinst.vcxproj.user
 delete mode 100644 vs2017/xenvif_coinst/xenvif_coinst.vcxproj
 delete mode 100644 vs2017/xenvif_coinst/xenvif_coinst.vcxproj.user
 delete mode 100644 vs2019/xenvif_coinst/xenvif_coinst.vcxproj
 delete mode 100644 vs2019/xenvif_coinst/xenvif_coinst.vcxproj.user
 delete mode 100644 vs2022/xenvif_coinst/xenvif_coinst.vcxproj
 delete mode 100644 vs2022/xenvif_coinst/xenvif_coinst.vcxproj.user

diff --git a/src/coinst/coinst.c b/src/coinst/coinst.c
deleted file mode 100644
index 49d76db..0000000
--- a/src/coinst/coinst.c
+++ /dev/null
@@ -1,1732 +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 <windows.h>
-#include <setupapi.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strsafe.h>
-#include <malloc.h>
-#include <assert.h>
-#include <iphlpapi.h>
-
-#include <version.h>
-#include <revision.h>
-
-#define stringify_literal(_text) #_text
-#define stringify(_text) stringify_literal(_text)
-#define __MODULE__ stringify(PROJECT)
-
-__user_code;
-
-#define MAXIMUM_BUFFER_SIZE 1024
-
-#define SERVICES_KEY "SYSTEM\\CurrentControlSet\\Services"
-
-#define SERVICE_KEY(_Driver)    \
-        SERVICES_KEY ## "\\" ## #_Driver
-
-#define UNPLUG_KEY \
-        SERVICE_KEY(XEN) ## "\\Unplug"
-
-#define SETTINGS_KEY \
-        SERVICE_KEY(XENVIF) ## "\\Settings"
-
-#define CONTROL_KEY "SYSTEM\\CurrentControlSet\\Control"
-
-#define CLASS_KEY   \
-        CONTROL_KEY ## "\\Class"
-
-#define ENUM_KEY    "SYSTEM\\CurrentControlSet\\Enum"
-
-#define NETWORK_CLASS_GUID \
-        "{4d36e972-e325-11ce-bfc1-08002be10318}"
-
-static VOID
-#pragma prefast(suppress:6262) // Function uses '1036' bytes of stack: exceeds /analyze:stacksize'1024'
-__Log(
-    IN  const CHAR  *Format,
-    IN  ...
-    )
-{
-    TCHAR               Buffer[MAXIMUM_BUFFER_SIZE];
-    va_list             Arguments;
-    size_t              Length;
-    SP_LOG_TOKEN        LogToken;
-    DWORD               Category;
-    DWORD               Flags;
-    HRESULT             Result;
-
-    va_start(Arguments, Format);
-    Result = StringCchVPrintf(Buffer, MAXIMUM_BUFFER_SIZE, Format, Arguments);
-    va_end(Arguments);
-
-    if (Result != S_OK && Result != STRSAFE_E_INSUFFICIENT_BUFFER)
-        return;
-
-    Result = StringCchLength(Buffer, MAXIMUM_BUFFER_SIZE, &Length);
-    if (Result != S_OK)
-        return;
-
-    LogToken = SetupGetThreadLogToken();
-    Category = TXTLOG_VENDOR;
-    Flags = TXTLOG_WARNING;
-
-    SetupWriteTextLog(LogToken, Category, Flags, Buffer);
-    Length = __min(MAXIMUM_BUFFER_SIZE - 1, Length + 2);
-
-    __analysis_assume(Length < MAXIMUM_BUFFER_SIZE);
-    __analysis_assume(Length >= 2);
-    Buffer[Length] = '\0';
-    Buffer[Length - 1] = '\n';
-    Buffer[Length - 2] = '\r';
-
-    OutputDebugString(Buffer);
-}
-
-#define Log(_Format, ...) \
-        __Log(__MODULE__ "|" __FUNCTION__ ": " _Format, __VA_ARGS__)
-
-static PTCHAR
-GetErrorMessage(
-    IN  DWORD   Error
-    )
-{
-    PTCHAR      Message;
-    ULONG       Index;
-
-    if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                       FORMAT_MESSAGE_FROM_SYSTEM |
-                       FORMAT_MESSAGE_IGNORE_INSERTS,
-                       NULL,
-                       Error,
-                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                       (LPTSTR)&Message,
-                       0,
-                       NULL))
-        return NULL;
-
-    for (Index = 0; Message[Index] != '\0'; Index++) {
-        if (Message[Index] == '\r' || Message[Index] == '\n') {
-            Message[Index] = '\0';
-            break;
-        }
-    }
-
-    return Message;
-}
-
-static FORCEINLINE const CHAR *
-__FunctionName(
-    IN  DI_FUNCTION Function
-    )
-{
-#define _NAME(_Function)        \
-        case DIF_ ## _Function: \
-            return #_Function;
-
-    switch (Function) {
-    _NAME(INSTALLDEVICE);
-    _NAME(REMOVE);
-    _NAME(SELECTDEVICE);
-    _NAME(ASSIGNRESOURCES);
-    _NAME(PROPERTIES);
-    _NAME(FIRSTTIMESETUP);
-    _NAME(FOUNDDEVICE);
-    _NAME(SELECTCLASSDRIVERS);
-    _NAME(VALIDATECLASSDRIVERS);
-    _NAME(INSTALLCLASSDRIVERS);
-    _NAME(CALCDISKSPACE);
-    _NAME(DESTROYPRIVATEDATA);
-    _NAME(VALIDATEDRIVER);
-    _NAME(MOVEDEVICE);
-    _NAME(DETECT);
-    _NAME(INSTALLWIZARD);
-    _NAME(DESTROYWIZARDDATA);
-    _NAME(PROPERTYCHANGE);
-    _NAME(ENABLECLASS);
-    _NAME(DETECTVERIFY);
-    _NAME(INSTALLDEVICEFILES);
-    _NAME(ALLOW_INSTALL);
-    _NAME(SELECTBESTCOMPATDRV);
-    _NAME(REGISTERDEVICE);
-    _NAME(NEWDEVICEWIZARD_PRESELECT);
-    _NAME(NEWDEVICEWIZARD_SELECT);
-    _NAME(NEWDEVICEWIZARD_PREANALYZE);
-    _NAME(NEWDEVICEWIZARD_POSTANALYZE);
-    _NAME(NEWDEVICEWIZARD_FINISHINSTALL);
-    _NAME(INSTALLINTERFACES);
-    _NAME(DETECTCANCEL);
-    _NAME(REGISTER_COINSTALLERS);
-    _NAME(ADDPROPERTYPAGE_ADVANCED);
-    _NAME(ADDPROPERTYPAGE_BASIC);
-    _NAME(TROUBLESHOOTER);
-    _NAME(POWERMESSAGEWAKE);
-    default:
-        break;
-    }
-
-    return "UNKNOWN";
-
-#undef  _NAME
-}
-
-static BOOLEAN
-ClearUnplugRequest(
-    IN  PTCHAR      ClassName
-    )
-{
-    HKEY            UnplugKey;
-    HRESULT         Error;
-
-    Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                         UNPLUG_KEY,
-                         0,
-                         KEY_ALL_ACCESS,
-                         &UnplugKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    Error = RegDeleteValue(UnplugKey, ClassName);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    RegCloseKey(UnplugKey);
-
-    return TRUE;
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(UnplugKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-AllowUpdate(
-    IN  PTCHAR      DriverName,
-    OUT PBOOLEAN    Allow
-    )
-{
-    TCHAR           ServiceKeyName[MAX_PATH];
-    HKEY            ServiceKey;
-    HRESULT         Result;
-    HRESULT         Error;
-    DWORD           ValueLength;
-    DWORD           Value;
-    DWORD           Type;
-
-    Log("====> (%s)", DriverName);
-
-    Result = StringCbPrintf(ServiceKeyName,
-                            MAX_PATH,
-                            SERVICES_KEY "\\%s",
-                            DriverName);
-    assert(SUCCEEDED(Result));
-
-    Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                         ServiceKeyName,
-                         0,
-                         KEY_READ,
-                         &ServiceKey);
-    if (Error != ERROR_SUCCESS) {
-        if (Error == ERROR_FILE_NOT_FOUND) {
-            Value = 1;
-            goto done;
-        }
-
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    ValueLength = sizeof (Value);
-
-    Error = RegQueryValueEx(ServiceKey,
-                            "AllowUpdate",
-                            NULL,
-                            &Type,
-                            (LPBYTE)&Value,
-                            &ValueLength);
-    if (Error != ERROR_SUCCESS) {
-        if (Error == ERROR_FILE_NOT_FOUND) {
-            Type = REG_DWORD;
-            Value = 1;
-        } else {
-            SetLastError(Error);
-            goto fail2;
-        }
-    }
-
-    if (Type != REG_DWORD) {
-        SetLastError(ERROR_BAD_FORMAT);
-        goto fail3;
-    }
-
-    RegCloseKey(ServiceKey);
-
-done:
-    if (Value == 0) {
-        Log("DISALLOWED");
-        *Allow = FALSE;
-    }
-
-    Log("<====");
-
-    return TRUE;
-
-fail3:
-    Log("fail3");
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(ServiceKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-AllowInstall(
-    OUT PBOOLEAN    Allow
-    )
-{
-    BOOLEAN         Success;
-    HRESULT         Error;
-
-    Log("====>");
-
-    *Allow = TRUE;
-
-    Success = AllowUpdate("XENVIF", Allow);
-    if (!Success)
-        goto fail1;
-
-    Log("<====");
-
-    return TRUE;
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-OpenEnumKey(
-    OUT PHKEY   EnumKey
-    )
-{
-    HRESULT     Error;
-
-    Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                         ENUM_KEY,
-                         0,
-                         KEY_READ,
-                         EnumKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    return TRUE;
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-OpenBusKey(
-    IN  PTCHAR  BusKeyName,
-    OUT PHKEY   BusKey
-    )
-{
-    BOOLEAN     Success;
-    HKEY        EnumKey;
-    HRESULT     Error;
-
-    Success = OpenEnumKey(&EnumKey);
-    if (!Success)
-        goto fail1;
-
-    Error = RegOpenKeyEx(EnumKey,
-                         BusKeyName,
-                         0,
-                         KEY_READ,
-                         BusKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    RegCloseKey(EnumKey);
-
-    return TRUE;
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(EnumKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-OpenDeviceKey(
-    IN  PTCHAR  BusKeyName,
-    IN  PTCHAR  DeviceKeyName,
-    OUT PHKEY   DeviceKey
-    )
-{
-    BOOLEAN     Success;
-    HKEY        BusKey;
-    HRESULT     Error;
-
-    Success = OpenBusKey(BusKeyName, &BusKey);
-    if (!Success)
-        goto fail1;
-
-    Error = RegOpenKeyEx(BusKey,
-                         DeviceKeyName,
-                         0,
-                         KEY_READ,
-                         DeviceKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    RegCloseKey(BusKey);
-
-    return TRUE;
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(BusKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-GetDriverKeyName(
-    IN  HKEY    DeviceKey,
-    OUT PTCHAR  *Name,
-    OUT DWORD   *ConfigFlags
-    )
-{
-    HRESULT     Error;
-    DWORD       SubKeys;
-    DWORD       MaxSubKeyLength;
-    DWORD       SubKeyLength;
-    PTCHAR      SubKeyName;
-    DWORD       Index;
-    HKEY        SubKey;
-    PTCHAR      DriverKeyName;
-    DWORD       Flags;
-
-    Error = RegQueryInfoKey(DeviceKey,
-                            NULL,
-                            NULL,
-                            NULL,
-                            &SubKeys,
-                            &MaxSubKeyLength,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    SubKeyLength = MaxSubKeyLength + sizeof (TCHAR);
-
-    SubKeyName = malloc(SubKeyLength);
-    if (SubKeyName == NULL)
-        goto fail2;
-
-    SubKey = NULL;
-    DriverKeyName = NULL;
-    Flags = 0;
-
-    for (Index = 0; Index < SubKeys; Index++) {
-        DWORD       MaxValueLength;
-        DWORD       ConfigFlagsLength;
-        DWORD       DriverKeyNameLength;
-        DWORD       Type;
-
-        SubKeyLength = MaxSubKeyLength + sizeof (TCHAR);
-        memset(SubKeyName, 0, SubKeyLength);
-
-        Error = RegEnumKeyEx(DeviceKey,
-                             Index,
-                             (LPTSTR)SubKeyName,
-                             &SubKeyLength,
-                             NULL,
-                             NULL,
-                             NULL,
-                             NULL);
-        if (Error != ERROR_SUCCESS) {
-            SetLastError(Error);
-            goto fail3;
-        }
-
-        Error = RegOpenKeyEx(DeviceKey,
-                             SubKeyName,
-                             0,
-                             KEY_READ,
-                             &SubKey);
-        if (Error != ERROR_SUCCESS) {
-            SubKey = NULL;
-            continue;
-        }
-
-        Error = RegQueryInfoKey(SubKey,
-                                NULL,
-                                NULL,
-                                NULL,
-                                NULL,
-                                NULL,
-                                NULL,
-                                NULL,
-                                NULL,
-                                &MaxValueLength,
-                                NULL,
-                                NULL);
-        if (Error != ERROR_SUCCESS) {
-            SetLastError(Error);
-            goto fail4;
-        }
-
-        ConfigFlagsLength = (DWORD)sizeof(DWORD);
-
-        Error = RegQueryValueEx(SubKey,
-                                "ConfigFlags",
-                                NULL,
-                                &Type,
-                                (LPBYTE)&Flags,
-                                &ConfigFlagsLength);
-        if (Error != ERROR_SUCCESS ||
-            Type != REG_DWORD)
-            Flags = 0;
-
-        DriverKeyNameLength = MaxValueLength + sizeof (TCHAR);
-
-        DriverKeyName = calloc(1, DriverKeyNameLength);
-        if (DriverKeyName == NULL)
-            goto fail5;
-
-        Error = RegQueryValueEx(SubKey,
-                                "Driver",
-                                NULL,
-                                &Type,
-                                (LPBYTE)DriverKeyName,
-                                &DriverKeyNameLength);
-        if (Error == ERROR_SUCCESS &&
-            Type == REG_SZ)
-            break;
-
-        free(DriverKeyName);
-        DriverKeyName = NULL;
-        Flags = 0;
-
-        RegCloseKey(SubKey);
-        SubKey = NULL;
-    }
-
-    Log("%s", (DriverKeyName != NULL) ? DriverKeyName : "none found");
-
-    if (SubKey != NULL)
-        RegCloseKey(SubKey);
-
-    free(SubKeyName);
-
-    *Name = DriverKeyName;
-    *ConfigFlags = Flags;
-
-    return TRUE;
-
-fail5:
-    Log("fail5");
-
-fail4:
-    Log("fail4");
-
-    if (SubKey != NULL)
-        RegCloseKey(SubKey);
-
-fail3:
-    Log("fail3");
-
-    free(SubKeyName);
-
-fail2:
-    Log("fail2");
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-OpenClassKey(
-    OUT PHKEY   ClassKey
-    )
-{
-    HRESULT     Error;
-
-    Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                         CLASS_KEY,
-                         0,
-                         KEY_READ,
-                         ClassKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    return TRUE;
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-OpenDriverKey(
-    IN  PTCHAR  DriverKeyName,
-    OUT PHKEY   DriverKey
-    )
-{
-    BOOLEAN     Success;
-    HKEY        ClassKey;
-    HRESULT     Error;
-
-    Success = OpenClassKey(&ClassKey);
-    if (!Success)
-        goto fail1;
-
-    Error = RegOpenKeyEx(ClassKey,
-                         DriverKeyName,
-                         0,
-                         KEY_READ,
-                         DriverKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    RegCloseKey(ClassKey);
-
-    return TRUE;
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(ClassKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-#define DEFINE_REVISION(_N, _C, _V, _ST, _SU) \
-    (_N)
-
-static DWORD    DeviceRevision[] = {
-    DEFINE_REVISION_TABLE
-};
-
-#undef DEFINE_REVISION
-
-static BOOLEAN
-SupportDeviceID(
-    IN  PTCHAR      DeviceID
-    )
-{
-    unsigned int    Revision;
-    int             Count;
-    DWORD           Index;
-    HRESULT         Error;
-
-    DeviceID = strrchr(DeviceID, '&');
-    assert(DeviceID != NULL);
-    DeviceID++;
-
-    Count = sscanf_s(DeviceID,
-                     "REV_%8x",
-                     &Revision);
-    if (Count != 1) {
-        SetLastError(ERROR_BAD_FORMAT);
-        goto fail1;
-    }
-
-    for (Index = 0; Index < ARRAYSIZE(DeviceRevision); Index++) {
-        if (Revision == DeviceRevision[Index])
-            goto found;
-    }
-
-    SetLastError(ERROR_FILE_NOT_FOUND);
-    goto fail2;
-
-found:
-    Log("%x", Revision);
-
-    return TRUE;
-
-fail2:
-    Log("fail2");
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-GetMatchingDeviceID(
-    IN  HKEY    DriverKey,
-    OUT PTCHAR  *MatchingDeviceID
-    )
-{
-    HRESULT     Error;
-    DWORD       MaxValueLength;
-    DWORD       MatchingDeviceIDLength;
-    DWORD       Type;
-    DWORD       Index;
-
-    Error = RegQueryInfoKey(DriverKey,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            &MaxValueLength,
-                            NULL,
-                            NULL);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    MatchingDeviceIDLength = MaxValueLength + sizeof (TCHAR);
-
-    *MatchingDeviceID = calloc(1, MatchingDeviceIDLength);
-    if (*MatchingDeviceID == NULL)
-        goto fail2;
-
-    Error = RegQueryValueEx(DriverKey,
-                            "MatchingDeviceId",
-                            NULL,
-                            &Type,
-                            (LPBYTE)*MatchingDeviceID,
-                            &MatchingDeviceIDLength);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail3;
-    }
-
-    if (Type != REG_SZ) {
-        SetLastError(ERROR_BAD_FORMAT);
-        goto fail4;
-    }
-
-    for (Index = 0; Index < strlen(*MatchingDeviceID); Index++)
-        (*MatchingDeviceID)[Index] = (CHAR)toupper((*MatchingDeviceID)[Index]);
-
-    Log("%s", *MatchingDeviceID);
-
-    return TRUE;
-
-fail4:
-    Log("fail4");
-
-fail3:
-    Log("fail3");
-
-    free(*MatchingDeviceID);
-
-fail2:
-    Log("fail2");
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-SupportChildDrivers(
-    VOID
-    )
-{
-    BOOLEAN     Success;
-    HKEY        XenbusKey;
-    HRESULT     Error;
-    DWORD       SubKeys;
-    DWORD       MaxSubKeyLength;
-    DWORD       SubKeyLength;
-    PTCHAR      SubKeyName;
-    HKEY        DeviceKey;
-    PTCHAR      DriverKeyName;
-    DWORD       ConfigFlags;
-    HKEY        DriverKey;
-    PTCHAR      MatchingDeviceID;
-    DWORD       Index;
-
-    Log("====>");
-
-    Success = OpenBusKey("XENVIF", &XenbusKey);
-    if (!Success) {
-        // If there is no key then this must be a fresh installation
-        if (GetLastError() == ERROR_FILE_NOT_FOUND)
-            goto done;
-
-        goto fail1;
-    }
-
-    Error = RegQueryInfoKey(XenbusKey,
-                            NULL,
-                            NULL,
-                            NULL,
-                            &SubKeys,
-                            &MaxSubKeyLength,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    SubKeyLength = MaxSubKeyLength + sizeof (TCHAR);
-
-    SubKeyName = malloc(SubKeyLength);
-    if (SubKeyName == NULL)
-        goto fail3;
-
-    for (Index = 0; Index < SubKeys; Index++) {
-        SubKeyLength = MaxSubKeyLength + sizeof (TCHAR);
-        memset(SubKeyName, 0, SubKeyLength);
-
-        Error = RegEnumKeyEx(XenbusKey,
-                             Index,
-                             (LPTSTR)SubKeyName,
-                             &SubKeyLength,
-                             NULL,
-                             NULL,
-                             NULL,
-                             NULL);
-        if (Error != ERROR_SUCCESS) {
-            SetLastError(Error);
-            goto fail4;
-        }
-
-        Success = OpenDeviceKey("XENVIF", SubKeyName, &DeviceKey);
-        if (!Success)
-            goto fail5;
-
-        Success = GetDriverKeyName(DeviceKey, &DriverKeyName, &ConfigFlags);
-        if (!Success)
-            goto fail6;
-
-        if (DriverKeyName == NULL)
-            goto loop1;
-
-        if (ConfigFlags & 0x20)
-            goto loop2;
-
-        Success = OpenDriverKey(DriverKeyName, &DriverKey);
-        if (!Success)
-            goto loop3;
-
-        Success = GetMatchingDeviceID(DriverKey, &MatchingDeviceID);
-        if (!Success)
-            goto loop4;
-
-        Success = SupportDeviceID(MatchingDeviceID);
-        if (!Success)
-            goto fail7;
-
-        free(MatchingDeviceID);
-
-    loop4:
-        RegCloseKey(DriverKey);
-
-    loop3:
-
-    loop2:
-        free(DriverKeyName);
-
-    loop1:
-        RegCloseKey(DeviceKey);
-    }
-
-    free(SubKeyName);
-
-    RegCloseKey(XenbusKey);
-
-done:
-    Log("<====");
-
-    return TRUE;
-
-fail7:
-    Log("fail7");
-
-    free(MatchingDeviceID);
-
-    RegCloseKey(DriverKey);
-
-    free(DriverKeyName);
-
-fail6:
-    Log("fail6");
-
-    RegCloseKey(DeviceKey);
-
-fail5:
-    Log("fail5");
-
-fail4:
-    Log("fail4");
-
-    free(SubKeyName);
-
-fail3:
-    Log("fail3");
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(XenbusKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-CreateSettingsKey(
-    IN  PTCHAR  KeyName,
-    OUT PHKEY   Key
-    )
-{
-    HKEY        SettingsKey;
-    HRESULT     Error;
-
-    Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                         SETTINGS_KEY,
-                         0,
-                         KEY_ALL_ACCESS,
-                         &SettingsKey);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    Error = RegCreateKeyEx(SettingsKey,
-                           KeyName,
-                           0,
-                           NULL,
-                           REG_OPTION_NON_VOLATILE,
-                           KEY_ALL_ACCESS,
-                           NULL,
-                           Key,
-                           NULL);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    RegCloseKey(SettingsKey);
-
-    return TRUE;
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(SettingsKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-CopyNetworkID(
-    IN  PTCHAR  VifIndex,
-    IN  HKEY    DriverKey
-    )
-{
-    BOOLEAN     Success;
-    HRESULT     Error;
-    TCHAR       NetCfgInstanceId[MAX_PATH];
-    DWORD       NetCfgInstanceIdLength;
-    DWORD       Value;
-    DWORD       ValueLength;
-    NET_LUID    NetLuid;
-    HKEY        SettingsKey;
-
-    NetCfgInstanceIdLength = sizeof(NetCfgInstanceId);
-    Error = RegQueryValueEx(DriverKey,
-                            "NetCfgInstanceId",
-                            NULL,
-                            NULL,
-                            (LPBYTE)NetCfgInstanceId,
-                            &NetCfgInstanceIdLength);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail1;
-    }
-
-    NetLuid.Value = 0ull;
-
-    ValueLength = sizeof(DWORD);
-    Error = RegQueryValueEx(DriverKey,
-                            "NetLuidIndex",
-                            NULL,
-                            NULL,
-                            (LPBYTE)&Value,
-                            &ValueLength);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    NetLuid.Info.NetLuidIndex = Value;
-
-    ValueLength = sizeof(DWORD);
-    Error = RegQueryValueEx(DriverKey,
-                            "*IfType",
-                            NULL,
-                            NULL,
-                            (LPBYTE)&Value,
-                            &ValueLength);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail3;
-    }
-
-    NetLuid.Info.IfType = Value;
-
-    Log("VIF/%s was %s", VifIndex, NetCfgInstanceId);
-
-    Success = CreateSettingsKey(VifIndex, &SettingsKey);
-    if (!Success)
-        goto fail4;
-
-    Error = RegSetValueEx(SettingsKey,
-                          "NetCfgInstanceId",
-                          0,
-                          REG_SZ,
-                          (const BYTE*)NetCfgInstanceId,
-                          NetCfgInstanceIdLength);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail5;
-    }
-
-    Error = RegSetValueEx(SettingsKey,
-                          "NetLuid",
-                          0,
-                          REG_BINARY,
-                          (const BYTE*)&NetLuid,
-                          sizeof(NET_LUID));
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail6;
-    }
-
-    Value = 1;
-    Error = RegSetValueEx(SettingsKey,
-                          "HasSettings",
-                          0,
-                          REG_DWORD,
-                          (const BYTE*)&Value,
-                          sizeof(DWORD));
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail7;
-    }
-
-    RegCloseKey(SettingsKey);
-
-    return TRUE;
-
-fail7:
-    Log("fail7");
-
-fail6:
-    Log("fail6");
-
-fail5:
-    Log("fail5");
-
-    RegCloseKey(SettingsKey);
-
-fail4:
-    Log("fail4");
-
-fail3:
-    Log("fail3");
-
-fail2:
-    Log("fail2");
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static BOOLEAN
-CopyNetworkIDs(
-    VOID
-    )
-{
-    BOOLEAN     Success;
-    HRESULT     Error;
-    HKEY        ClassKey;
-    DWORD       SubKeys;
-    DWORD       MaxSubKeyLength;
-    DWORD       Index;
-    DWORD       SubKeyLength;
-    PTCHAR      SubKeyName;
-
-    Log("====>");
-
-    Success = OpenDriverKey(NETWORK_CLASS_GUID, &ClassKey);
-    if (!Success)
-        goto fail1;
-
-    Error = RegQueryInfoKey(ClassKey,
-                            NULL,
-                            NULL,
-                            NULL,
-                            &SubKeys,
-                            &MaxSubKeyLength,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL,
-                            NULL);
-    if (Error != ERROR_SUCCESS) {
-        SetLastError(Error);
-        goto fail2;
-    }
-
-    SubKeyLength = MaxSubKeyLength + sizeof (TCHAR);
-
-    SubKeyName = malloc(SubKeyLength);
-    if (SubKeyName == NULL)
-        goto fail3;
-
-    for (Index = 0; Index < SubKeys; ++Index) {
-        HKEY        DriverKey;
-        TCHAR       DeviceInstanceID[MAX_PATH];
-        PTCHAR      VifIndex;
-        DWORD       Length;
-
-        SubKeyLength = MaxSubKeyLength + sizeof (TCHAR);
-        memset(SubKeyName, 0, SubKeyLength);
-
-        Error = RegEnumKeyEx(ClassKey,
-                             Index,
-                             (LPTSTR)SubKeyName,
-                             &SubKeyLength,
-                             NULL,
-                             NULL,
-                             NULL,
-                             NULL);
-        if (Error != ERROR_SUCCESS) {
-            SetLastError(Error);
-            goto fail4;
-        }
-
-        Error = RegOpenKeyEx(ClassKey,
-                             SubKeyName,
-                             0,
-                             KEY_READ,
-                             &DriverKey);
-        if (Error != ERROR_SUCCESS) {
-            SetLastError(Error);
-            continue;
-        }
-
-        Length = sizeof(DeviceInstanceID);
-        Error = RegQueryValueEx(DriverKey,
-                                "DeviceInstanceID",
-                                NULL,
-                                NULL,
-                                (LPBYTE)DeviceInstanceID,
-                                &Length);
-        if (Error != ERROR_SUCCESS) {
-            SetLastError(Error);
-            goto loop1;
-        }
-
-        if (_strnicmp("XENVIF", DeviceInstanceID, strlen("XENVIF")) != 0)
-            goto loop2;
-
-        VifIndex = strrchr(DeviceInstanceID, '\\');
-        if (VifIndex == NULL)
-            goto loop3;
-
-        ++VifIndex;
-
-        CopyNetworkID(VifIndex, DriverKey);
-
-    loop3:
-    loop2:
-    loop1:
-        RegCloseKey(DriverKey);
-    }
-
-    free(SubKeyName);
-    RegCloseKey(ClassKey);
-
-    Log("<====");
-
-    return TRUE;
-
-fail4:
-    Log("fail4");
-
-    free(SubKeyName);
-
-fail3:
-    Log("fail3");
-
-fail2:
-    Log("fail2");
-
-    RegCloseKey(ClassKey);
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return FALSE;
-}
-
-static HRESULT
-DifInstallPreProcess(
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    HRESULT                         Error;
-    BOOLEAN                         Success;
-    BOOLEAN                         Allow;
-
-    UNREFERENCED_PARAMETER(DeviceInfoSet);
-    UNREFERENCED_PARAMETER(DeviceInfoData);
-    UNREFERENCED_PARAMETER(Context);
-
-    Log("====>");
-
-    Success = AllowInstall(&Allow);
-    if (!Success)
-        goto fail1;
-
-    if (!Allow) {
-        SetLastError(ERROR_ACCESS_DENIED);
-        goto fail2;
-    }
-
-    Success = SupportChildDrivers();
-    if (!Success)
-        goto fail3;
-
-    Success = CopyNetworkIDs();
-    if (!Success)
-        goto fail4;
-
-    Log("<====");
-
-    return NO_ERROR;
-
-fail4:
-    Log("fail4");
-
-fail3:
-    Log("fail3");
-
-fail2:
-    Log("fail2");
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return Error;
-}
-
-static HRESULT
-DifInstallPostProcess(
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    UNREFERENCED_PARAMETER(DeviceInfoSet);
-    UNREFERENCED_PARAMETER(DeviceInfoData);
-    UNREFERENCED_PARAMETER(Context);
-
-    Log("<===>");
-
-    return NO_ERROR;
-}
-
-static DECLSPEC_NOINLINE HRESULT
-DifInstall(
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    SP_DEVINSTALL_PARAMS            DeviceInstallParams;
-    HRESULT                         Error;
-
-    DeviceInstallParams.cbSize = sizeof (DeviceInstallParams);
-
-    if (!SetupDiGetDeviceInstallParams(DeviceInfoSet,
-                                       DeviceInfoData,
-                                       &DeviceInstallParams))
-        goto fail1;
-
-    Log("Flags = %08x", DeviceInstallParams.Flags);
-
-    if (!Context->PostProcessing) {
-        Error = DifInstallPreProcess(DeviceInfoSet, DeviceInfoData, Context);
-
-        if (Error == NO_ERROR)
-            Error = ERROR_DI_POSTPROCESSING_REQUIRED; 
-    } else {
-        Error = Context->InstallResult;
-        
-        if (Error == NO_ERROR) {
-            (VOID) DifInstallPostProcess(DeviceInfoSet, DeviceInfoData, Context);
-        } else {
-            PTCHAR  Message;
-
-            Message = GetErrorMessage(Error);
-            Log("NOT RUNNING (DifInstallPreProcess Error: %s)", Message);
-            LocalFree(Message);
-        }
-
-        Error = NO_ERROR; 
-    }
-
-    return Error;
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return Error;
-}
-
-static HRESULT
-DifRemovePreProcess(
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    UNREFERENCED_PARAMETER(DeviceInfoSet);
-    UNREFERENCED_PARAMETER(DeviceInfoData);
-    UNREFERENCED_PARAMETER(Context);
-
-    Log("<===>");
-
-    return NO_ERROR; 
-}
-
-static HRESULT
-DifRemovePostProcess(
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    UNREFERENCED_PARAMETER(DeviceInfoSet);
-    UNREFERENCED_PARAMETER(DeviceInfoData);
-    UNREFERENCED_PARAMETER(Context);
-
-    Log("<===>");
-
-    return NO_ERROR;
-}
-
-static DECLSPEC_NOINLINE HRESULT
-DifRemove(
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    SP_DEVINSTALL_PARAMS            DeviceInstallParams;
-    HRESULT                         Error;
-
-    DeviceInstallParams.cbSize = sizeof (DeviceInstallParams);
-
-    if (!SetupDiGetDeviceInstallParams(DeviceInfoSet,
-                                       DeviceInfoData,
-                                       &DeviceInstallParams))
-        goto fail1;
-
-    Log("Flags = %08x", DeviceInstallParams.Flags);
-
-    if (!Context->PostProcessing) {
-        Error = DifRemovePreProcess(DeviceInfoSet, DeviceInfoData, Context);
-
-        if (Error == NO_ERROR)
-            Error = ERROR_DI_POSTPROCESSING_REQUIRED; 
-    } else {
-        Error = Context->InstallResult;
-        
-        if (Error == NO_ERROR) {
-            (VOID) DifRemovePostProcess(DeviceInfoSet, DeviceInfoData, Context);
-        } else {
-            PTCHAR  Message;
-
-            Message = GetErrorMessage(Error);
-            Log("NOT RUNNING (DifRemovePreProcess Error: %s)", Message);
-            LocalFree(Message);
-        }
-
-        Error = NO_ERROR; 
-    }
-
-    return Error;
-
-fail1:
-    Error = GetLastError();
-
-    {
-        PTCHAR  Message;
-
-        Message = GetErrorMessage(Error);
-        Log("fail1 (%s)", Message);
-        LocalFree(Message);
-    }
-
-    return Error;
-}
-
-DWORD CALLBACK
-Entry(
-    IN  DI_FUNCTION                 Function,
-    IN  HDEVINFO                    DeviceInfoSet,
-    IN  PSP_DEVINFO_DATA            DeviceInfoData,
-    IN  PCOINSTALLER_CONTEXT_DATA   Context
-    )
-{
-    HRESULT                         Error;
-
-    Log("%s (%s) ===>",
-        MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR,
-        DAY_STR "/" MONTH_STR "/" YEAR_STR);
-
-    if (!Context->PostProcessing) {
-        Log("%s PreProcessing",
-            __FunctionName(Function));
-    } else {
-        Log("%s PostProcessing (%08x)",
-            __FunctionName(Function),
-            Context->InstallResult);
-    }
-
-    switch (Function) {
-    case DIF_INSTALLDEVICE: {
-        SP_DRVINFO_DATA         DriverInfoData;
-        BOOLEAN                 DriverInfoAvailable;
-
-        DriverInfoData.cbSize = sizeof (DriverInfoData);
-        DriverInfoAvailable = SetupDiGetSelectedDriver(DeviceInfoSet,
-                                                       DeviceInfoData,
-                                                       &DriverInfoData) ?
-                              TRUE :
-                              FALSE;
-
-        // If there is no driver information then the NULL driver is being
-        // installed. Treat this as we would a DIF_REMOVE.
-        Error = (DriverInfoAvailable) ?
-                DifInstall(DeviceInfoSet, DeviceInfoData, Context) :
-                DifRemove(DeviceInfoSet, DeviceInfoData, Context);
-        break;
-    }
-    case DIF_REMOVE:
-        Error = DifRemove(DeviceInfoSet, DeviceInfoData, Context);
-        break;
-    default:
-        if (!Context->PostProcessing) {
-            Error = NO_ERROR;
-        } else {
-            Error = Context->InstallResult;
-        }
-
-        break;
-    }
-
-    Log("%s (%s) <===",
-        MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR,
-        DAY_STR "/" MONTH_STR "/" YEAR_STR);
-
-    return (DWORD)Error;
-}
-
-DWORD CALLBACK
-Version(
-    IN  HWND        Window,
-    IN  HINSTANCE   Module,
-    IN  PTCHAR      Buffer,
-    IN  INT         Reserved
-    )
-{
-    UNREFERENCED_PARAMETER(Window);
-    UNREFERENCED_PARAMETER(Module);
-    UNREFERENCED_PARAMETER(Buffer);
-    UNREFERENCED_PARAMETER(Reserved);
-
-    Log("%s (%s)",
-        MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR,
-        DAY_STR "/" MONTH_STR "/" YEAR_STR);
-
-    return NO_ERROR;
-}
-
-static FORCEINLINE const CHAR *
-__ReasonName(
-    IN  DWORD       Reason
-    )
-{
-#define _NAME(_Reason)          \
-        case DLL_ ## _Reason:   \
-            return #_Reason;
-
-    switch (Reason) {
-    _NAME(PROCESS_ATTACH);
-    _NAME(PROCESS_DETACH);
-    _NAME(THREAD_ATTACH);
-    _NAME(THREAD_DETACH);
-    default:
-        break;
-    }
-
-    return "UNKNOWN";
-
-#undef  _NAME
-}
-
-BOOL WINAPI
-DllMain(
-    IN  HINSTANCE   Module,
-    IN  DWORD       Reason,
-    IN  PVOID       Reserved
-    )
-{
-    UNREFERENCED_PARAMETER(Module);
-    UNREFERENCED_PARAMETER(Reserved);
-
-    Log("%s (%s): %s",
-        MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR,
-        DAY_STR "/" MONTH_STR "/" YEAR_STR,
-        __ReasonName(Reason));
-
-    return TRUE;
-}
diff --git a/src/coinst/xenvif_coinst.def b/src/coinst/xenvif_coinst.def
deleted file mode 100644
index 71d8f65..0000000
--- a/src/coinst/xenvif_coinst.def
+++ /dev/null
@@ -1,38 +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.
-
-LIBRARY  XENBUS_COINST
-
-EXPORTS   
-   Entry 
-   Version
-
-   DllMain PRIVATE
diff --git a/src/coinst/xenvif_coinst.rc b/src/coinst/xenvif_coinst.rc
deleted file mode 100644
index c1235ce..0000000
--- a/src/coinst/xenvif_coinst.rc
+++ /dev/null
@@ -1,57 +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 <windows.h>
-#include <ntverp.h>
-
-
-#undef VER_COMPANYNAME_STR
-#undef VER_PRODUCTNAME_STR
-#undef VER_PRODUCTVERSION
-#undef VER_PRODUCTVERSION_STR
-
-#include <version.h>
-
-#define VER_COMPANYNAME_STR         VENDOR_NAME_STR
-#define VER_LEGALCOPYRIGHT_STR      COPYRIGHT_STR
-
-#define VER_PRODUCTNAME_STR         "XENVIF_COINST"
-#define VER_PRODUCTVERSION          MAJOR_VERSION,MINOR_VERSION,MICRO_VERSION,BUILD_NUMBER
-#define VER_PRODUCTVERSION_STR      MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR
-
-#define VER_INTERNALNAME_STR        "XENVIF_COINST.DLL"
-#define VER_FILEDESCRIPTION_STR     "XENVIF_COINST"
-
-#define VER_FILETYPE                VFT_DRV
-#define VER_FILESUBTYPE             VFT2_DRV_SYSTEM
-
-#include <common.ver>
diff --git a/vs2015/package/package.vcxproj b/vs2015/package/package.vcxproj
index 3db0b5e..989cff6 100644
--- a/vs2015/package/package.vcxproj
+++ b/vs2015/package/package.vcxproj
@@ -41,9 +41,6 @@
     <ProjectReference Include="..\xenvif\xenvif.vcxproj">
       <Project>{C3F96D4C-E441-47F7-A44C-D2D0543C1D18}</Project>
     </ProjectReference>
-    <ProjectReference Include="..\xenvif_coinst\xenvif_coinst.vcxproj">
-      <Project>{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}</Project>
-    </ProjectReference>
     <FilesToPackage Include="..\xenvif.inf" />
   </ItemGroup>
   <ItemGroup Condition="Exists('$(DPINST_REDIST)')">
diff --git a/vs2015/xenvif.sln b/vs2015/xenvif.sln
index 8d808f0..44ed147 100644
--- a/vs2015/xenvif.sln
+++ b/vs2015/xenvif.sln
@@ -9,17 +9,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenvif", "xenvif\xenvif.vcx
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenvif_coinst", "xenvif_coinst\xenvif_coinst.vcxproj", "{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}"
-	ProjectSection(ProjectDependencies) = postProject
-		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
-		{C3F96D4C-E441-47F7-A44C-D2D0543C1D18} = {C3F96D4C-E441-47F7-A44C-D2D0543C1D18}
-	EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "package\package.vcxproj", "{73768CC9-DB26-4297-9EC8-1042F815EB15}"
 	ProjectSection(ProjectDependencies) = postProject
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
 		{C3F96D4C-E441-47F7-A44C-D2D0543C1D18} = {C3F96D4C-E441-47F7-A44C-D2D0543C1D18}
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44} = {2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}
 	EndProjectSection
 EndProject
 Global
@@ -50,26 +43,6 @@ Global
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|Win32.ActiveCfg = Windows 8 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|Win32.Build.0 = Windows 8 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|Win32.Deploy.0 = Windows 8 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|x64.ActiveCfg = Windows 8 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|x64.Build.0 = Windows 8 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|Win32.ActiveCfg = Windows 8 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|Win32.Deploy.0 = Windows 8 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|Win32.ActiveCfg = Windows 10 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|Win32.Build.0 = Windows 10 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|Win32.Deploy.0 = Windows 10 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|x64.ActiveCfg = Windows 10 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|x64.Build.0 = Windows 10 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|Win32.ActiveCfg = Windows 10 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|Win32.Build.0 = Windows 10 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|Win32.Deploy.0 = Windows 10 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|x64.ActiveCfg = Windows 10 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|x64.Build.0 = Windows 10 Release|x64
 		{73768CC9-DB26-4297-9EC8-1042F815EB15}.Windows 8 Debug|Win32.ActiveCfg = Windows 8 Debug|Win32
 		{73768CC9-DB26-4297-9EC8-1042F815EB15}.Windows 8 Debug|Win32.Build.0 = Windows 8 Debug|Win32
 		{73768CC9-DB26-4297-9EC8-1042F815EB15}.Windows 8 Debug|Win32.Deploy.0 = Windows 8 Debug|Win32
diff --git a/vs2015/xenvif_coinst/xenvif_coinst.vcxproj b/vs2015/xenvif_coinst/xenvif_coinst.vcxproj
deleted file mode 100644
index 18f6bdd..0000000
--- a/vs2015/xenvif_coinst/xenvif_coinst.vcxproj
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="..\configs.props" />
-  <PropertyGroup Label="PropertySheets">
-    <DriverType>WDM</DriverType>
-    <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="..\targets.props" />
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <PropertyGroup>
-    <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
-    <IncludePath>..\..\include;$(IncludePath)</IncludePath>
-    <RunCodeAnalysis>true</RunCodeAnalysis>
-    <EnableInf2cat>false</EnableInf2cat>
-    <IntDir>..\$(ProjectName)\$(ConfigurationName)\$(Platform)\</IntDir>
-    <OutDir>..\$(ConfigurationName)\$(Platform)\</OutDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <PreprocessorDefinitions>PROJECT=$(ProjectName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <WarningLevel>EnableAllWarnings</WarningLevel>
-      <DisableSpecificWarnings>4127;4548;4711;4820;4668;4255;6001;6054;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-      <EnablePREfast>true</EnablePREfast>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <ModuleDefinitionFile>../../src/coinst/xenvif_coinst.def</ModuleDefinitionFile>
-      <AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
-    <ClCompile>
-      <PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
-    <ClCompile>
-      <PreprocessorDefinitions>__x86_64__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <FilesToPackage Include="$(TargetPath)" />
-    <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\coinst\coinst.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\src\coinst\xenvif_coinst.def" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\src\coinst\xenvif_coinst.rc" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project>
diff --git a/vs2015/xenvif_coinst/xenvif_coinst.vcxproj.user b/vs2015/xenvif_coinst/xenvif_coinst.vcxproj.user
deleted file mode 100644
index ff14020..0000000
--- a/vs2015/xenvif_coinst/xenvif_coinst.vcxproj.user
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <SignMode>TestSign</SignMode>
-    <TestCertificate>..\..\src\xenvif.pfx</TestCertificate>
-    <TimeStampServer>http://timestamp.verisign.com/scripts/timstamp.dll</TimeStampServer>
-  </PropertyGroup>
-</Project>
diff --git a/vs2017/package/package.vcxproj b/vs2017/package/package.vcxproj
index 3aec237..af14958 100644
--- a/vs2017/package/package.vcxproj
+++ b/vs2017/package/package.vcxproj
@@ -41,9 +41,6 @@
     <ProjectReference Include="..\xenvif\xenvif.vcxproj">
       <Project>{C3F96D4C-E441-47F7-A44C-D2D0543C1D18}</Project>
     </ProjectReference>
-    <ProjectReference Include="..\xenvif_coinst\xenvif_coinst.vcxproj">
-      <Project>{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}</Project>
-    </ProjectReference>
     <FilesToPackage Include="..\xenvif.inf" />
   </ItemGroup>
   <ItemGroup Condition="Exists('$(DPINST_REDIST)')">
diff --git a/vs2017/xenvif.sln b/vs2017/xenvif.sln
index cf1d7db..1ef5eb8 100644
--- a/vs2017/xenvif.sln
+++ b/vs2017/xenvif.sln
@@ -6,17 +6,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenvif", "xenvif\xenvif.vcx
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenvif_coinst", "xenvif_coinst\xenvif_coinst.vcxproj", "{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}"
-	ProjectSection(ProjectDependencies) = postProject
-		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
-		{C3F96D4C-E441-47F7-A44C-D2D0543C1D18} = {C3F96D4C-E441-47F7-A44C-D2D0543C1D18}
-	EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "package\package.vcxproj", "{73768CC9-DB26-4297-9EC8-1042F815EB15}"
 	ProjectSection(ProjectDependencies) = postProject
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
 		{C3F96D4C-E441-47F7-A44C-D2D0543C1D18} = {C3F96D4C-E441-47F7-A44C-D2D0543C1D18}
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44} = {2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}
 	EndProjectSection
 EndProject
 Global
@@ -47,26 +40,6 @@ Global
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|Win32.ActiveCfg = Windows 8 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|Win32.Build.0 = Windows 8 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|Win32.Deploy.0 = Windows 8 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|x64.ActiveCfg = Windows 8 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|x64.Build.0 = Windows 8 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|Win32.ActiveCfg = Windows 8 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|Win32.Deploy.0 = Windows 8 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|Win32.ActiveCfg = Windows 10 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|Win32.Build.0 = Windows 10 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|Win32.Deploy.0 = Windows 10 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|x64.ActiveCfg = Windows 10 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|x64.Build.0 = Windows 10 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|Win32.ActiveCfg = Windows 10 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|Win32.Build.0 = Windows 10 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|Win32.Deploy.0 = Windows 10 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|x64.ActiveCfg = Windows 10 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|x64.Build.0 = Windows 10 Release|x64
 		{73768CC9-DB26-4297-9EC8-1042F815EB15}.Windows 8 Debug|Win32.ActiveCfg = Windows 8 Debug|Win32
 		{73768CC9-DB26-4297-9EC8-1042F815EB15}.Windows 8 Debug|Win32.Build.0 = Windows 8 Debug|Win32
 		{73768CC9-DB26-4297-9EC8-1042F815EB15}.Windows 8 Debug|Win32.Deploy.0 = Windows 8 Debug|Win32
diff --git a/vs2017/xenvif_coinst/xenvif_coinst.vcxproj b/vs2017/xenvif_coinst/xenvif_coinst.vcxproj
deleted file mode 100644
index 39a3a4f..0000000
--- a/vs2017/xenvif_coinst/xenvif_coinst.vcxproj
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="..\configs.props" />
-  <PropertyGroup Label="PropertySheets">
-    <DriverType>WDM</DriverType>
-    <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="..\targets.props" />
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <PropertyGroup>
-    <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
-    <IncludePath>..\..\include;$(IncludePath)</IncludePath>
-    <RunCodeAnalysis>true</RunCodeAnalysis>
-    <EnableInf2cat>false</EnableInf2cat>
-    <IntDir>..\$(ProjectName)\$(ConfigurationName)\$(Platform)\</IntDir>
-    <OutDir>..\$(ConfigurationName)\$(Platform)\</OutDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <PreprocessorDefinitions>PROJECT=$(ProjectName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <WarningLevel>EnableAllWarnings</WarningLevel>
-      <DisableSpecificWarnings>4127;4548;4711;4820;4668;4255;5045;6001;6054;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-      <EnablePREfast>true</EnablePREfast>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <ModuleDefinitionFile>../../src/coinst/xenvif_coinst.def</ModuleDefinitionFile>
-      <AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
-    <ClCompile>
-      <PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
-    <ClCompile>
-      <PreprocessorDefinitions>__x86_64__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <FilesToPackage Include="$(TargetPath)" />
-    <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\coinst\coinst.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\src\coinst\xenvif_coinst.def" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\src\coinst\xenvif_coinst.rc" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project>
diff --git a/vs2017/xenvif_coinst/xenvif_coinst.vcxproj.user b/vs2017/xenvif_coinst/xenvif_coinst.vcxproj.user
deleted file mode 100644
index ff14020..0000000
--- a/vs2017/xenvif_coinst/xenvif_coinst.vcxproj.user
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <SignMode>TestSign</SignMode>
-    <TestCertificate>..\..\src\xenvif.pfx</TestCertificate>
-    <TimeStampServer>http://timestamp.verisign.com/scripts/timstamp.dll</TimeStampServer>
-  </PropertyGroup>
-</Project>
diff --git a/vs2019/package/package.vcxproj b/vs2019/package/package.vcxproj
index 8987c1d..86e6354 100644
--- a/vs2019/package/package.vcxproj
+++ b/vs2019/package/package.vcxproj
@@ -46,9 +46,6 @@
     <ProjectReference Include="..\xenvif\xenvif.vcxproj">
       <Project>{C3F96D4C-E441-47F7-A44C-D2D0543C1D18}</Project>
     </ProjectReference>
-    <ProjectReference Include="..\xenvif_coinst\xenvif_coinst.vcxproj">
-      <Project>{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}</Project>
-    </ProjectReference>
     <FilesToPackage Include="..\xenvif.inf" />
   </ItemGroup>
   <ItemGroup Condition="Exists('$(DPINST_REDIST)')">
diff --git a/vs2019/xenvif.sln b/vs2019/xenvif.sln
index 33d0808..9c41ef5 100644
--- a/vs2019/xenvif.sln
+++ b/vs2019/xenvif.sln
@@ -8,17 +8,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenvif", "xenvif\xenvif.vcx
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenvif_coinst", "xenvif_coinst\xenvif_coinst.vcxproj", "{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}"
-	ProjectSection(ProjectDependencies) = postProject
-		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
-		{C3F96D4C-E441-47F7-A44C-D2D0543C1D18} = {C3F96D4C-E441-47F7-A44C-D2D0543C1D18}
-	EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "package\package.vcxproj", "{73768CC9-DB26-4297-9EC8-1042F815EB15}"
 	ProjectSection(ProjectDependencies) = postProject
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
 		{C3F96D4C-E441-47F7-A44C-D2D0543C1D18} = {C3F96D4C-E441-47F7-A44C-D2D0543C1D18}
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44} = {2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}
 	EndProjectSection
 EndProject
 Global
@@ -49,26 +42,6 @@ Global
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|Win32.ActiveCfg = Windows 8 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|Win32.Build.0 = Windows 8 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|Win32.Deploy.0 = Windows 8 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|x64.ActiveCfg = Windows 8 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|x64.Build.0 = Windows 8 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|Win32.ActiveCfg = Windows 8 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|Win32.Deploy.0 = Windows 8 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|Win32.ActiveCfg = Windows 10 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|Win32.Build.0 = Windows 10 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|Win32.Deploy.0 = Windows 10 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|x64.ActiveCfg = Windows 10 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|x64.Build.0 = Windows 10 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|Win32.ActiveCfg = Windows 10 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|Win32.Build.0 = Windows 10 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|Win32.Deploy.0 = Windows 10 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|x64.ActiveCfg = Windows 10 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|x64.Build.0 = Windows 10 Release|x64
 		{73768CC9-DB26-4297-9EC8-1042F815EB15}.Windows 8 Debug|Win32.ActiveCfg = Windows 8 Debug|Win32
 		{73768CC9-DB26-4297-9EC8-1042F815EB15}.Windows 8 Debug|Win32.Build.0 = Windows 8 Debug|Win32
 		{73768CC9-DB26-4297-9EC8-1042F815EB15}.Windows 8 Debug|Win32.Deploy.0 = Windows 8 Debug|Win32
diff --git a/vs2019/xenvif_coinst/xenvif_coinst.vcxproj b/vs2019/xenvif_coinst/xenvif_coinst.vcxproj
deleted file mode 100644
index 19914c6..0000000
--- a/vs2019/xenvif_coinst/xenvif_coinst.vcxproj
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="..\configs.props" />
-  <PropertyGroup Label="PropertySheets">
-    <DriverType>WDM</DriverType>
-    <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="..\targets.props" />
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <PropertyGroup>
-    <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
-    <IncludePath>..\..\include;$(IncludePath)</IncludePath>
-    <RunCodeAnalysis>true</RunCodeAnalysis>
-    <EnableInf2cat>false</EnableInf2cat>
-    <IntDir>..\$(ProjectName)\$(ConfigurationName)\$(Platform)\</IntDir>
-    <OutDir>..\$(ConfigurationName)\$(Platform)\</OutDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>PROJECT=$(ProjectName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <WarningLevel>EnableAllWarnings</WarningLevel>
-      <DisableSpecificWarnings>4127;4548;4711;4820;4668;4255;5045;6001;6054;26052;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-      <EnablePREfast>true</EnablePREfast>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <ModuleDefinitionFile>../../src/coinst/xenvif_coinst.def</ModuleDefinitionFile>
-      <AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <CETCompat>true</CETCompat>
-    </Link>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <DriverSign>
-      <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
-    </DriverSign>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
-    <ClCompile>
-      <PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
-    <ClCompile>
-      <PreprocessorDefinitions>__x86_64__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <FilesToPackage Include="$(TargetPath)" />
-    <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\coinst\coinst.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\src\coinst\xenvif_coinst.def" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\src\coinst\xenvif_coinst.rc" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project>
diff --git a/vs2019/xenvif_coinst/xenvif_coinst.vcxproj.user b/vs2019/xenvif_coinst/xenvif_coinst.vcxproj.user
deleted file mode 100644
index ff14020..0000000
--- a/vs2019/xenvif_coinst/xenvif_coinst.vcxproj.user
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <SignMode>TestSign</SignMode>
-    <TestCertificate>..\..\src\xenvif.pfx</TestCertificate>
-    <TimeStampServer>http://timestamp.verisign.com/scripts/timstamp.dll</TimeStampServer>
-  </PropertyGroup>
-</Project>
diff --git a/vs2022/package/package.vcxproj b/vs2022/package/package.vcxproj
index 016a1c0..0ea6508 100644
--- a/vs2022/package/package.vcxproj
+++ b/vs2022/package/package.vcxproj
@@ -46,9 +46,6 @@
     <ProjectReference Include="..\xenvif\xenvif.vcxproj">
       <Project>{C3F96D4C-E441-47F7-A44C-D2D0543C1D18}</Project>
     </ProjectReference>
-    <ProjectReference Include="..\xenvif_coinst\xenvif_coinst.vcxproj">
-      <Project>{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}</Project>
-    </ProjectReference>
     <FilesToPackage Include="..\xenvif.inf" />
   </ItemGroup>
   <ItemGroup Condition="Exists('$(DPINST_REDIST)')">
diff --git a/vs2022/xenvif.sln b/vs2022/xenvif.sln
index 33d0808..9c41ef5 100644
--- a/vs2022/xenvif.sln
+++ b/vs2022/xenvif.sln
@@ -8,17 +8,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenvif", "xenvif\xenvif.vcx
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xenvif_coinst", "xenvif_coinst\xenvif_coinst.vcxproj", "{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}"
-	ProjectSection(ProjectDependencies) = postProject
-		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
-		{C3F96D4C-E441-47F7-A44C-D2D0543C1D18} = {C3F96D4C-E441-47F7-A44C-D2D0543C1D18}
-	EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "package\package.vcxproj", "{73768CC9-DB26-4297-9EC8-1042F815EB15}"
 	ProjectSection(ProjectDependencies) = postProject
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7} = {65FA97EA-A569-4FC1-BFE7-D68E109143F7}
 		{C3F96D4C-E441-47F7-A44C-D2D0543C1D18} = {C3F96D4C-E441-47F7-A44C-D2D0543C1D18}
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44} = {2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}
 	EndProjectSection
 EndProject
 Global
@@ -49,26 +42,6 @@ Global
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
 		{65FA97EA-A569-4FC1-BFE7-D68E109143F7}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|Win32.ActiveCfg = Windows 8 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|Win32.Build.0 = Windows 8 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|Win32.Deploy.0 = Windows 8 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|x64.ActiveCfg = Windows 8 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Debug|x64.Build.0 = Windows 8 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|Win32.ActiveCfg = Windows 8 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|Win32.Build.0 = Windows 8 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|Win32.Deploy.0 = Windows 8 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|x64.ActiveCfg = Windows 8 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 8 Release|x64.Build.0 = Windows 8 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|Win32.ActiveCfg = Windows 10 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|Win32.Build.0 = Windows 10 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|Win32.Deploy.0 = Windows 10 Debug|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|x64.ActiveCfg = Windows 10 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Debug|x64.Build.0 = Windows 10 Debug|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|Win32.ActiveCfg = Windows 10 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|Win32.Build.0 = Windows 10 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|Win32.Deploy.0 = Windows 10 Release|Win32
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|x64.ActiveCfg = Windows 10 Release|x64
-		{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}.Windows 10 Release|x64.Build.0 = Windows 10 Release|x64
 		{73768CC9-DB26-4297-9EC8-1042F815EB15}.Windows 8 Debug|Win32.ActiveCfg = Windows 8 Debug|Win32
 		{73768CC9-DB26-4297-9EC8-1042F815EB15}.Windows 8 Debug|Win32.Build.0 = Windows 8 Debug|Win32
 		{73768CC9-DB26-4297-9EC8-1042F815EB15}.Windows 8 Debug|Win32.Deploy.0 = Windows 8 Debug|Win32
diff --git a/vs2022/xenvif_coinst/xenvif_coinst.vcxproj b/vs2022/xenvif_coinst/xenvif_coinst.vcxproj
deleted file mode 100644
index 19914c6..0000000
--- a/vs2022/xenvif_coinst/xenvif_coinst.vcxproj
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="..\configs.props" />
-  <PropertyGroup Label="PropertySheets">
-    <DriverType>WDM</DriverType>
-    <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{2BFAC7E6-3420-47A5-A092-BDC5C9D78A44}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="..\targets.props" />
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <PropertyGroup>
-    <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
-    <IncludePath>..\..\include;$(IncludePath)</IncludePath>
-    <RunCodeAnalysis>true</RunCodeAnalysis>
-    <EnableInf2cat>false</EnableInf2cat>
-    <IntDir>..\$(ProjectName)\$(ConfigurationName)\$(Platform)\</IntDir>
-    <OutDir>..\$(ConfigurationName)\$(Platform)\</OutDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>PROJECT=$(ProjectName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <WarningLevel>EnableAllWarnings</WarningLevel>
-      <DisableSpecificWarnings>4127;4548;4711;4820;4668;4255;5045;6001;6054;26052;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-      <EnablePREfast>true</EnablePREfast>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>
-      <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <ModuleDefinitionFile>../../src/coinst/xenvif_coinst.def</ModuleDefinitionFile>
-      <AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <CETCompat>true</CETCompat>
-    </Link>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-    <DriverSign>
-      <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
-    </DriverSign>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
-    <ClCompile>
-      <PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
-    <ClCompile>
-      <PreprocessorDefinitions>__x86_64__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <FilesToPackage Include="$(TargetPath)" />
-    <FilesToPackage Include="$(OutDir)$(TargetName).pdb" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\coinst\coinst.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\src\coinst\xenvif_coinst.def" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\src\coinst\xenvif_coinst.rc" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project>
diff --git a/vs2022/xenvif_coinst/xenvif_coinst.vcxproj.user b/vs2022/xenvif_coinst/xenvif_coinst.vcxproj.user
deleted file mode 100644
index ff14020..0000000
--- a/vs2022/xenvif_coinst/xenvif_coinst.vcxproj.user
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <SignMode>TestSign</SignMode>
-    <TestCertificate>..\..\src\xenvif.pfx</TestCertificate>
-    <TimeStampServer>http://timestamp.verisign.com/scripts/timstamp.dll</TimeStampServer>
-  </PropertyGroup>
-</Project>
-- 
2.41.0.windows.3



