From win-pv-devel-bounces@lists.xenproject.org Fri Oct 09 15:03:25 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 09 Oct 2020 15:03:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4789.12624 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kQtvW-00051J-Vj; Fri, 09 Oct 2020 15:03:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4789.12624; Fri, 09 Oct 2020 15:03:22 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kQtvW-00051B-SO; Fri, 09 Oct 2020 15:03:22 +0000
Received: by outflank-mailman (input) for mailman id 4789;
 Fri, 09 Oct 2020 15:03:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+BEm=DQ=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kQtvV-000516-Iu
 for win-pv-devel@lists.xenproject.org; Fri, 09 Oct 2020 15:03:21 +0000
Received: from mail-ej1-x62e.google.com (unknown [2a00:1450:4864:20::62e])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e7992ddc-4531-47ac-874f-76b9451ae262;
 Fri, 09 Oct 2020 15:03:20 +0000 (UTC)
Received: by mail-ej1-x62e.google.com with SMTP id e22so13556072ejr.4
 for <win-pv-devel@lists.xenproject.org>; Fri, 09 Oct 2020 08:03:20 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=+BEm=DQ=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kQtvV-000516-Iu
	for win-pv-devel@lists.xenproject.org; Fri, 09 Oct 2020 15:03:21 +0000
X-Inumbo-ID: e7992ddc-4531-47ac-874f-76b9451ae262
Received: from mail-ej1-x62e.google.com (unknown [2a00:1450:4864:20::62e])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e7992ddc-4531-47ac-874f-76b9451ae262;
	Fri, 09 Oct 2020 15:03:20 +0000 (UTC)
Received: by mail-ej1-x62e.google.com with SMTP id e22so13556072ejr.4
        for <win-pv-devel@lists.xenproject.org>; Fri, 09 Oct 2020 08:03:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:from:date:message-id:subject:to;
        bh=XsZH+Xj7uElphz028yQPvcaOGF9yuodDHYAaYl/DsEU=;
        b=jEnZmaYcJgO0l6wI+YD42r98NAD10H9T3rz8E0zkJGyILPYv12uTttt6j1oxUuoTN+
         fn0+dwNS2lVty+GMtAgK4gB5P9W54FdOJlGXRC73pPOS/+k03jZ5Jr3kkGbsN9f2nAmx
         QZe4v/YI5o/CELeTNg9CdU8OQj6QmDCjcaPaxoqTluTtYNuPoQexZSoI46DS6eSBanYB
         PXykxYT06UQGtew+Uxse2UmjcfaYo4fMhcT01DMiPfl8O8ju+JwGceQTOe0pcwNnCjf3
         YjaB746MGLhLmJxrT6LV/oStHTnkbO/gvVDSMDrC7Jyd0DdPWq6WbcBS5oeze79Kyfnc
         4NeQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
        bh=XsZH+Xj7uElphz028yQPvcaOGF9yuodDHYAaYl/DsEU=;
        b=TdcH48+1kMLromxGWHpo6zpu6lfY8n44c8valheNxNjC3kRkA9ZJfTsPgP+1m5MiD2
         rZMuSO+shMICF3I0LpylzLW1fBASseCc/ce/qR7xwPuIIRFdd42R9TVYbbLqnKKxnBA2
         pqWElu3/K8VjhHhBa1pj/WAC4cZJOiz7qimSkAKeuwazsW/yipz3haL74Z/24vrt6HoS
         hU/WwHV503HGt0t5N8i2v7yb3ljVkoBanUgv4aMHxL8peZjhZ7gDLpzbiidP3YBOl3ec
         AnYjGQX0NYCQELQOkW836R5tKhOQ6nfS5iiXn/5SRNY+7c64Juwf5ZN2GpknlkKnI9I5
         uOzQ==
X-Gm-Message-State: AOAM53225Kp43btnBirVcyS+xF+xjn3SRXq4N79nNjyjvewrlgxO2qY2
	CHHizKN2pTiNAeHyYvsJ4sKDOEkSqtwx1RtBYxtV9m2EuAk=
X-Google-Smtp-Source: ABdhPJzbUPj/A+LES6HbRmDza1at0hbxF3SV0scg3+CHecQhzvQKbrYa5U50bPCdVxkPuLwXCityHTU+KfARD/k7V8U=
X-Received: by 2002:a17:906:c095:: with SMTP id f21mr15319148ejz.108.1602255799150;
 Fri, 09 Oct 2020 08:03:19 -0700 (PDT)
MIME-Version: 1.0
From: Troy Crosley <troycrosley@gmail.com>
Date: Fri, 9 Oct 2020 11:03:08 -0400
Message-ID: <CAOBjErJ+-m0hw7txvRqDZnxjZCmpZQ-NHv8kh_=gW-xHa1Z-LQ@mail.gmail.com>
Subject: xenhid power state transitions
To: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000bf6cca05b13e3f0f"

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

Hi all. I noticed that xenhid doesn't have the same power state transition
boilerplate as the rest of the drivers. As a result, xenhid doesn't release
its interfaces when the system is entering S3, causing an error when xenbus
tries to enter D3 due to interfaces still being unexpectedly active. Should
xenhid have the same power state transition boilerplate as the other
drivers? Is there any consideration to be made due to its use of the hid
class driver?

Regards,
Troy Crosley

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

<div dir=3D"ltr">Hi all. I noticed that xenhid doesn&#39;t have the same po=
wer state transition boilerplate as the rest of the drivers. As a result, x=
enhid doesn&#39;t release its interfaces when the system is entering S3, ca=
using an error when xenbus tries to enter D3 due to interfaces still being =
unexpectedly active. Should xenhid have the same power state transition boi=
lerplate as the other drivers? Is there any consideration to be made due to=
 its use of the hid class driver?<br><br>Regards,<br>Troy Crosley<br></div>

--000000000000bf6cca05b13e3f0f--


From win-pv-devel-bounces@lists.xenproject.org Fri Oct 09 15:18:41 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 09 Oct 2020 15:18:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4796.12640 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kQuAK-0006Dj-Cw; Fri, 09 Oct 2020 15:18:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4796.12640; Fri, 09 Oct 2020 15:18:40 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kQuAK-0006Dc-9P; Fri, 09 Oct 2020 15:18:40 +0000
Received: by outflank-mailman (input) for mailman id 4796;
 Fri, 09 Oct 2020 15:18:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=qgFs=DQ=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
 id 1kQuAI-0006DX-T8
 for win-pv-devel@lists.xenproject.org; Fri, 09 Oct 2020 15:18:39 +0000
Received: from mail-wr1-x435.google.com (unknown [2a00:1450:4864:20::435])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e69dab7b-182c-4774-8f2a-2111aea4c722;
 Fri, 09 Oct 2020 15:18:37 +0000 (UTC)
Received: by mail-wr1-x435.google.com with SMTP id e18so10687994wrw.9
 for <win-pv-devel@lists.xenproject.org>; Fri, 09 Oct 2020 08:18:37 -0700 (PDT)
Received: from CBGR90WXYV0 (54-240-197-238.amazon.com. [54.240.197.238])
 by smtp.gmail.com with ESMTPSA id i11sm12318456wre.32.2020.10.09.08.18.35
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 09 Oct 2020 08:18:35 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=qgFs=DQ=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
	id 1kQuAI-0006DX-T8
	for win-pv-devel@lists.xenproject.org; Fri, 09 Oct 2020 15:18:39 +0000
X-Inumbo-ID: e69dab7b-182c-4774-8f2a-2111aea4c722
Received: from mail-wr1-x435.google.com (unknown [2a00:1450:4864:20::435])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e69dab7b-182c-4774-8f2a-2111aea4c722;
	Fri, 09 Oct 2020 15:18:37 +0000 (UTC)
Received: by mail-wr1-x435.google.com with SMTP id e18so10687994wrw.9
        for <win-pv-devel@lists.xenproject.org>; Fri, 09 Oct 2020 08:18:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:reply-to:to:references:in-reply-to:subject:date:message-id
         :mime-version:content-language:thread-index;
        bh=wzI6Lex2o9gmORQZzx1siJ0w0W7hyeCHBUKDOAEZIgw=;
        b=B2UPccviXt9uqFuFjDcxz9MCcm/ZmiKcP5aFEcLEC85i428wXwqemSinMMc0MpqOrn
         Y1focZZZfwng6Ja/aKxn+QroIvPBkv/FcVKo4SBq37ZRe9n7YF7y4lU6pPJfV0qZB+pw
         PmMMOsnBWfrQFv0g5rf7yrSFkjZlkgOXnLZNYtDs6KM+RFa3WXmTNoNnBX4Wr7qtWXMt
         qTzrBxWN40xrOLCYs/eIS1A68Q8DX7IzqoETMBVK5fCDu3ffnG4gN1G7bnGXQIfPWYEQ
         z4vvQVyENuiZzV5LTS7sC+JmAC9TeGQzeyo/TiYymP/5UJoong3/G90NIpnio+Jj5vr5
         e95g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:reply-to:to:references:in-reply-to:subject
         :date:message-id:mime-version:content-language:thread-index;
        bh=wzI6Lex2o9gmORQZzx1siJ0w0W7hyeCHBUKDOAEZIgw=;
        b=m0eO8u31jTT3sT8To1zAcWyRdxxxWm36yl4K0HHpUGucwErDlsRUoW/JaYse9jR58W
         bNMwQitXPZ1RUTBiw6+v/t7qro5EtAsPA7VteMF3Od1kYUL59zMujh+iP+p0n/uFyTSy
         POQCXS+oIsEeUCKCq7PDbl6tybXq4XwkCIKngufk5gPiepXxPvjHuR72BXG4Tm6F5Qyf
         esbkRGVZGGs8sJSu2ElmOZpzFjZ5tsYcVeSX+UwE7EST+Uv86zLfDTpW5nNnWpqWNKos
         /rzjiEWYhR9u14oCmsdJ99uPbvzdZroe82QHv1KrNl1RGc7zkHvNnbyYXgUSBPlPNgRj
         bOEg==
X-Gm-Message-State: AOAM533Swbcf1PqqgVbUmFs+HQKpIBEvdsMQ2znILoZ+7vwB+4LFbYZT
	sr4KCzTRTR/roRTOHxnXXuc=
X-Google-Smtp-Source: ABdhPJyBw+pLH9IhDu3UAHMtmfkjxlas7Px+2S/Z+afNGVi8OSExauAjBkmzYTOVuRbyJMKppQ0XrA==
X-Received: by 2002:adf:a3d8:: with SMTP id m24mr15310642wrb.418.1602256716499;
        Fri, 09 Oct 2020 08:18:36 -0700 (PDT)
Received: from CBGR90WXYV0 (54-240-197-238.amazon.com. [54.240.197.238])
        by smtp.gmail.com with ESMTPSA id i11sm12318456wre.32.2020.10.09.08.18.35
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 09 Oct 2020 08:18:35 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: "Paul Durrant" <paul@xen.org>
Reply-To: <paul@xen.org>
To: "'Troy Crosley'" <troycrosley@gmail.com>,
	<win-pv-devel@lists.xenproject.org>
References: <CAOBjErJ+-m0hw7txvRqDZnxjZCmpZQ-NHv8kh_=gW-xHa1Z-LQ@mail.gmail.com>
In-Reply-To: <CAOBjErJ+-m0hw7txvRqDZnxjZCmpZQ-NHv8kh_=gW-xHa1Z-LQ@mail.gmail.com>
Subject: RE: xenhid power state transitions
Date: Fri, 9 Oct 2020 16:18:34 +0100
Message-ID: <003401d69e4f$74cee750$5e6cb5f0$@xen.org>
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0035_01D69E57.D69487D0"
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-gb
Thread-Index: AQJ+9gQXsUKx8iZk/aVg3ilrYU3kZKg+r/UA

This is a multipart message in MIME format.

------=_NextPart_000_0035_01D69E57.D69487D0
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

I=E2=80=99m no hid expert but all the interfaces should be released on =
transition to D3. It may well be that power transitions are handled by =
the class driver. I don=E2=80=99t see handling of =
IOCTL_HID_ACTIVATE_DEVICE or IOCTL_HID_DEACTIVATE_DEVICE in =
FdoDispatchInternal() so that may be all that is necessary.
=20
  Paul
=20
From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> On Behalf =
Of Troy Crosley
Sent: 09 October 2020 16:03
To: win-pv-devel@lists.xenproject.org
Subject: xenhid power state transitions
=20
Hi all. I noticed that xenhid doesn't have the same power state =
transition boilerplate as the rest of the drivers. As a result, xenhid =
doesn't release its interfaces when the system is entering S3, causing =
an error when xenbus tries to enter D3 due to interfaces still being =
unexpectedly active. Should xenhid have the same power state transition =
boilerplate as the other drivers? Is there any consideration to be made =
due to its use of the hid class driver?

Regards,
Troy Crosley

------=_NextPart_000_0035_01D69E57.D69487D0
Content-Type: text/html;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta =
name=3DProgId content=3DWord.Document><meta name=3DGenerator =
content=3D"Microsoft Word 15"><meta name=3DOriginator =
content=3D"Microsoft Word 15"><link rel=3DFile-List =
href=3D"cid:filelist.xml@01D69E57.CC4EADA0"><!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:SpellingState>Clean</w:SpellingState>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:EnvelopeVis/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-GB</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:DoNotExpandShiftReturn/>
<w:BreakWrappedTables/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=3D"Cambria Math"/>
<m:brkBin m:val=3D"before"/>
<m:brkBinSub m:val=3D"&#45;-"/>
<m:smallFrac m:val=3D"off"/>
<m:dispDef/>
<m:lMargin m:val=3D"0"/>
<m:rMargin m:val=3D"0"/>
<m:defJc m:val=3D"centerGroup"/>
<m:wrapIndent m:val=3D"1440"/>
<m:intLim m:val=3D"subSup"/>
<m:naryLim m:val=3D"undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState=3D"false" DefUnhideWhenUsed=3D"false" =
DefSemiHidden=3D"false" DefQFormat=3D"false" DefPriority=3D"99" =
LatentStyleCount=3D"371">
<w:LsdException Locked=3D"false" Priority=3D"0" QFormat=3D"true" =
Name=3D"Normal"/>
<w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" =
Name=3D"heading 1"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 2"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 3"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 4"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 5"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 6"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 7"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 8"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 9"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 6"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 7"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 8"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 9"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 1"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 2"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 3"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 4"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 5"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 6"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 7"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 8"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 9"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Normal Indent"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"footnote text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"annotation text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"header"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"footer"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index heading"/>
<w:LsdException Locked=3D"false" Priority=3D"35" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"caption"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"table of figures"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"envelope address"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"envelope return"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"footnote reference"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"annotation reference"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"line number"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"page number"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"endnote reference"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"endnote text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"table of authorities"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"macro"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toa heading"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number 5"/>
<w:LsdException Locked=3D"false" Priority=3D"10" QFormat=3D"true" =
Name=3D"Title"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Closing"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Signature"/>
<w:LsdException Locked=3D"false" Priority=3D"1" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Default Paragraph Font"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text Indent"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Message Header"/>
<w:LsdException Locked=3D"false" Priority=3D"11" QFormat=3D"true" =
Name=3D"Subtitle"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Salutation"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Date"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text First Indent"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text First Indent 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Note Heading"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text Indent 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text Indent 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Block Text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Hyperlink"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"FollowedHyperlink"/>
<w:LsdException Locked=3D"false" Priority=3D"22" QFormat=3D"true" =
Name=3D"Strong"/>
<w:LsdException Locked=3D"false" Priority=3D"20" QFormat=3D"true" =
Name=3D"Emphasis"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Document Map"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Plain Text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"E-mail Signature"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Top of Form"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Bottom of Form"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Normal (Web)"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Acronym"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Address"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Cite"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Code"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Definition"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Keyboard"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Preformatted"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Sample"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Typewriter"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Variable"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Normal Table"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"annotation subject"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"No List"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Outline List 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Outline List 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Outline List 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Simple 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Simple 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Simple 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Classic 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Classic 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Classic 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Classic 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Colorful 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Colorful 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Colorful 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 6"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 7"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 8"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 6"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 7"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 8"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table 3D effects 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table 3D effects 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table 3D effects 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Contemporary"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Elegant"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Professional"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Subtle 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Subtle 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Web 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Web 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Web 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Balloon Text"/>
<w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"Table Grid"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Theme"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" Name=3D"Placeholder =
Text"/>
<w:LsdException Locked=3D"false" Priority=3D"1" QFormat=3D"true" =
Name=3D"No Spacing"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light =
Shading"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List =
1"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List =
2"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid =
1"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid =
2"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid =
3"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful =
List"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful =
Grid"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" Name=3D"Revision"/>
<w:LsdException Locked=3D"false" Priority=3D"34" QFormat=3D"true" =
Name=3D"List Paragraph"/>
<w:LsdException Locked=3D"false" Priority=3D"29" QFormat=3D"true" =
Name=3D"Quote"/>
<w:LsdException Locked=3D"false" Priority=3D"30" QFormat=3D"true" =
Name=3D"Intense Quote"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"19" QFormat=3D"true" =
Name=3D"Subtle Emphasis"/>
<w:LsdException Locked=3D"false" Priority=3D"21" QFormat=3D"true" =
Name=3D"Intense Emphasis"/>
<w:LsdException Locked=3D"false" Priority=3D"31" QFormat=3D"true" =
Name=3D"Subtle Reference"/>
<w:LsdException Locked=3D"false" Priority=3D"32" QFormat=3D"true" =
Name=3D"Intense Reference"/>
<w:LsdException Locked=3D"false" Priority=3D"33" QFormat=3D"true" =
Name=3D"Book Title"/>
<w:LsdException Locked=3D"false" Priority=3D"37" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Bibliography"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"TOC Heading"/>
<w:LsdException Locked=3D"false" Priority=3D"41" Name=3D"Plain Table =
1"/>
<w:LsdException Locked=3D"false" Priority=3D"42" Name=3D"Plain Table =
2"/>
<w:LsdException Locked=3D"false" Priority=3D"43" Name=3D"Plain Table =
3"/>
<w:LsdException Locked=3D"false" Priority=3D"44" Name=3D"Plain Table =
4"/>
<w:LsdException Locked=3D"false" Priority=3D"45" Name=3D"Plain Table =
5"/>
<w:LsdException Locked=3D"false" Priority=3D"40" Name=3D"Grid Table =
Light"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 6"/>
</w:LatentStyles>
</xml><![endif]--><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-536869121 1107305727 33554432 0 415 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-469750017 -1073732485 9 0 511 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman",serif;
	mso-fareast-font-family:Calibri;}
a:link, span.MsoHyperlink
	{mso-style-noshow:yes;
	mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-noshow:yes;
	mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;
	text-underline:single;}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-style-unhide:no;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman",serif;
	mso-fareast-font-family:Calibri;}
span.EmailStyle18
	{mso-style-type:personal-reply;
	mso-style-noshow:yes;
	mso-style-unhide:no;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:11.0pt;
	font-family:"Courier New";
	mso-ascii-font-family:"Courier New";
	mso-hansi-font-family:"Courier New";
	mso-bidi-font-family:"Times New Roman";
	color:#1F497D;}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-fareast-font-family:Calibri;
	mso-hansi-font-family:Calibri;
	mso-bidi-font-family:"Times New Roman";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 10]><style>/* Style Definitions */
table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-ascii-font-family:Calibri;
	mso-hansi-font-family:Calibri;
	mso-bidi-font-family:"Times New Roman";
	mso-fareast-language:EN-US;}
</style><![endif]--><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-GB =
link=3D"#0563C1" vlink=3D"#954F72" style=3D'tab-interval:36.0pt'><div =
class=3DWordSection1><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'>I=E2=80=99m no hid =
expert but all the interfaces should be released on transition to D3. It =
may well be that power transitions are handled by the class driver. I =
don=E2=80=99t see handling of IOCTL_HID_ACTIVATE_DEVICE or =
IOCTL_HID_DEACTIVATE_DEVICE in <span =
class=3DSpellE>FdoDispatchInternal</span>() so that may be all that is =
necessary.<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span>=
</p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><span =
style=3D'mso-spacerun:yes'>=C2=A0 </span>Paul<o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span>=
</p><div style=3D'border:none;border-left:solid blue 1.5pt;padding:0cm =
0cm 0cm 4.0pt'><div><div style=3D'border:none;border-top:solid #E1E1E1 =
1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=3DMsoNormal><b><span =
lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-fo=
nt-family:"Times New =
Roman";mso-ansi-language:EN-US'>From:</span></b><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-fo=
nt-family:"Times New Roman";mso-ansi-language:EN-US'> win-pv-devel =
&lt;win-pv-devel-bounces@lists.xenproject.org&gt; <b>On Behalf Of =
</b>Troy Crosley<br><b>Sent:</b> 09 October 2020 16:03<br><b>To:</b> =
win-pv-devel@lists.xenproject.org<br><b>Subject:</b> xenhid power state =
transitions<o:p></o:p></span></p></div></div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal>Hi all. =
I noticed that xenhid doesn't have the same power state transition =
boilerplate as the rest of the drivers. As a result, xenhid doesn't =
release its interfaces when the system is entering S3, causing an error =
when xenbus tries to enter D3 due to interfaces still being unexpectedly =
active. Should xenhid have the same power state transition boilerplate =
as the other drivers? Is there any consideration to be made due to its =
use of the hid class driver?<br><br>Regards,<br>Troy =
Crosley<o:p></o:p></p></div></div></div></body></html>
------=_NextPart_000_0035_01D69E57.D69487D0--



From win-pv-devel-bounces@lists.xenproject.org Tue Oct 13 17:57:44 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 13 Oct 2020 17:57:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6322.16868 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kSOYQ-0004qy-7h; Tue, 13 Oct 2020 17:57:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6322.16868; Tue, 13 Oct 2020 17:57:42 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kSOYQ-0004qr-4j; Tue, 13 Oct 2020 17:57:42 +0000
Received: by outflank-mailman (input) for mailman id 6322;
 Tue, 13 Oct 2020 17:57:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=58E9=DU=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kSOYO-0004qm-VX
 for win-pv-devel@lists.xenproject.org; Tue, 13 Oct 2020 17:57:41 +0000
Received: from mail-ed1-x52d.google.com (unknown [2a00:1450:4864:20::52d])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3649514a-c59a-4fb9-ac62-f0c152a41b3d;
 Tue, 13 Oct 2020 17:57:39 +0000 (UTC)
Received: by mail-ed1-x52d.google.com with SMTP id v19so374505edx.9
 for <win-pv-devel@lists.xenproject.org>; Tue, 13 Oct 2020 10:57:39 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=58E9=DU=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kSOYO-0004qm-VX
	for win-pv-devel@lists.xenproject.org; Tue, 13 Oct 2020 17:57:41 +0000
X-Inumbo-ID: 3649514a-c59a-4fb9-ac62-f0c152a41b3d
Received: from mail-ed1-x52d.google.com (unknown [2a00:1450:4864:20::52d])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3649514a-c59a-4fb9-ac62-f0c152a41b3d;
	Tue, 13 Oct 2020 17:57:39 +0000 (UTC)
Received: by mail-ed1-x52d.google.com with SMTP id v19so374505edx.9
        for <win-pv-devel@lists.xenproject.org>; Tue, 13 Oct 2020 10:57:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=rA7umX8M8AuCEV7LS86/+jNDAZ3YeN0ZUSV3KFQjELA=;
        b=Srv9pbxAwjniMrCcHdIVAniKrd2vV0S3VPGD78FEfNbWbTaCw9P9JE4aFzwE16hkau
         FI87F9+bJ1/TXs72FG0kzDYaNxCBhF1Yd11tWZHorFabMyyIzGxs5P7TDCn+WOYwRwsQ
         jEonJ3iz8YCdo706Jy5jaYB1C5bXL+tHKb9HZwUAW7jrTIFzbS5I2oAbh7gPcm/G0atL
         9IF3qIbhzNzO4L14X1sq3WFHlMuoty9kI5EXikr84dVceA1sV11ji3nRzmtzdOhwwbRR
         S5p9qHT0VvyUeERO4yArYmIRvidTkQ3ZHzbf8Jnt+XaMZSAdKAEl9GOr6jIiXuF8NZ8K
         7ySA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=rA7umX8M8AuCEV7LS86/+jNDAZ3YeN0ZUSV3KFQjELA=;
        b=XRyk/N2J6lrLk4YYNZt0ZaMD2+g8yC4S9ZGaGzMy0y+dfNqfaMjQLhkpATdtjVIAhv
         8n0OfRafqX/hpwQ1FG4kf6VIsBhCRWpDkwuN2poNdGgxXXuUS2s1Cx9CzcjAqD/taRtc
         NIBM+tZ8rS7FIqz+/0vyuHMQpkiMhQJMfEnmvb9zYwkzAy7TlZP9XgPXuyXct2NoIyHt
         aC5z4mY49Dyy5+auRxlZzVvtPUo3KW/ryDRzWK9/tl1FeadsTfPeuxndwMBwCCivZK/X
         MTXeCe9Yi87nhpqqsSjSdmIyHQnLCLbDuTC1Gdr7U9y8LfUQLd2+R6K5jQ/0a9qgKKo4
         V+sA==
X-Gm-Message-State: AOAM531THFMHnXM4qbqkOX0ZIctCwuOV9wu7a9eFSb8f80ZFx40gVioj
	ZuOXWvp84d7GmN93A3BiVdhBDPmFPsWxaHtdIjKINV381og=
X-Google-Smtp-Source: ABdhPJzgAc+xf+IQiAZFvXNQK3x3kjnuqDhzAZkavE8l5vIJL1WaHxXIiO9v5iVyiyxBLBiTMNP+OOHXbj1ysy9QyLw=
X-Received: by 2002:a50:c38c:: with SMTP id h12mr768474edf.185.1602611858592;
 Tue, 13 Oct 2020 10:57:38 -0700 (PDT)
MIME-Version: 1.0
References: <CAOBjErJ+-m0hw7txvRqDZnxjZCmpZQ-NHv8kh_=gW-xHa1Z-LQ@mail.gmail.com>
 <003401d69e4f$74cee750$5e6cb5f0$@xen.org>
In-Reply-To: <003401d69e4f$74cee750$5e6cb5f0$@xen.org>
From: Troy Crosley <troycrosley@gmail.com>
Date: Tue, 13 Oct 2020 13:57:26 -0400
Message-ID: <CAOBjEr+7XGLYAhgaFUqF1VbUwm4C_+z2y5kbGphsy0TN6_b0Nw@mail.gmail.com>
Subject: Re: xenhid power state transitions
To: paul@xen.org
Cc: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="0000000000008b596605b1912689"

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

I found that those ioctls weren't getting called in my testing. I
implemented the power state transition boilerplate found in the other
drivers to get xenhid to release and re-acquire its interfaces for S3. I'll
make a PR in case there's any interest.

On Fri, Oct 9, 2020 at 11:18 AM Paul Durrant <xadimgnik@gmail.com> wrote:

> I=E2=80=99m no hid expert but all the interfaces should be released on tr=
ansition
> to D3. It may well be that power transitions are handled by the class
> driver. I don=E2=80=99t see handling of IOCTL_HID_ACTIVATE_DEVICE or
> IOCTL_HID_DEACTIVATE_DEVICE in FdoDispatchInternal() so that may be all
> that is necessary.
>
>
>
>   Paul
>
>
>
> *From:* win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> *On
> Behalf Of *Troy Crosley
> *Sent:* 09 October 2020 16:03
> *To:* win-pv-devel@lists.xenproject.org
> *Subject:* xenhid power state transitions
>
>
>
> Hi all. I noticed that xenhid doesn't have the same power state transitio=
n
> boilerplate as the rest of the drivers. As a result, xenhid doesn't relea=
se
> its interfaces when the system is entering S3, causing an error when xenb=
us
> tries to enter D3 due to interfaces still being unexpectedly active. Shou=
ld
> xenhid have the same power state transition boilerplate as the other
> drivers? Is there any consideration to be made due to its use of the hid
> class driver?
>
> Regards,
> Troy Crosley
>

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

<div dir=3D"ltr">I found that those ioctls weren&#39;t getting called in my=
 testing. I implemented the power state transition boilerplate found in the=
 other drivers to get xenhid to release and re-acquire its interfaces for S=
3. I&#39;ll make a PR in case there&#39;s any interest.<br></div><br><div c=
lass=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Oct 9, 2=
020 at 11:18 AM Paul Durrant &lt;<a href=3D"mailto:xadimgnik@gmail.com">xad=
imgnik@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex"><div lang=3D"EN-GB"><div class=3D"gmail-m_-5272464895694654=
181WordSection1"><p class=3D"MsoNormal"><span style=3D"font-size:10pt;font-=
family:&quot;Courier New&quot;;color:rgb(31,73,125)">I=E2=80=99m no hid exp=
ert but all the interfaces should be released on transition to D3. It may w=
ell be that power transitions are handled by the class driver. I don=E2=80=
=99t see handling of IOCTL_HID_ACTIVATE_DEVICE or IOCTL_HID_DEACTIVATE_DEVI=
CE in <span class=3D"gmail-m_-5272464895694654181SpellE">FdoDispatchInterna=
l</span>() so that may be all that is necessary.<u></u><u></u></span></p><p=
 class=3D"MsoNormal"><span style=3D"font-size:10pt;font-family:&quot;Courie=
r New&quot;;color:rgb(31,73,125)"><u></u>=C2=A0<u></u></span></p><p class=
=3D"MsoNormal"><span style=3D"font-size:10pt;font-family:&quot;Courier New&=
quot;;color:rgb(31,73,125)"><span>=C2=A0 </span>Paul<u></u><u></u></span></=
p><p class=3D"MsoNormal"><span style=3D"font-size:10pt;font-family:&quot;Co=
urier New&quot;;color:rgb(31,73,125)"><u></u>=C2=A0<u></u></span></p><div s=
tyle=3D"border-top:none;border-right:none;border-bottom:none;border-left:1.=
5pt solid blue;padding:0cm 0cm 0cm 4pt"><div><div style=3D"border-right:non=
e;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225)=
;padding:3pt 0cm 0cm"><p class=3D"MsoNormal"><b><span lang=3D"EN-US" style=
=3D"font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span la=
ng=3D"EN-US" style=3D"font-size:11pt;font-family:Calibri,sans-serif"> win-p=
v-devel &lt;<a href=3D"mailto:win-pv-devel-bounces@lists.xenproject.org" ta=
rget=3D"_blank">win-pv-devel-bounces@lists.xenproject.org</a>&gt; <b>On Beh=
alf Of </b>Troy Crosley<br><b>Sent:</b> 09 October 2020 16:03<br><b>To:</b>=
 <a href=3D"mailto:win-pv-devel@lists.xenproject.org" target=3D"_blank">win=
-pv-devel@lists.xenproject.org</a><br><b>Subject:</b> xenhid power state tr=
ansitions<u></u><u></u></span></p></div></div><p class=3D"MsoNormal"><u></u=
>=C2=A0<u></u></p><div><p class=3D"MsoNormal">Hi all. I noticed that xenhid=
 doesn&#39;t have the same power state transition boilerplate as the rest o=
f the drivers. As a result, xenhid doesn&#39;t release its interfaces when =
the system is entering S3, causing an error when xenbus tries to enter D3 d=
ue to interfaces still being unexpectedly active. Should xenhid have the sa=
me power state transition boilerplate as the other drivers? Is there any co=
nsideration to be made due to its use of the hid class driver?<br><br>Regar=
ds,<br>Troy Crosley<u></u><u></u></p></div></div></div></div></blockquote><=
/div>

--0000000000008b596605b1912689--


From win-pv-devel-bounces@lists.xenproject.org Tue Oct 13 18:04:13 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 13 Oct 2020 18:04:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6329.16871 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kSOei-0005lU-OU; Tue, 13 Oct 2020 18:04:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6329.16871; Tue, 13 Oct 2020 18:04:12 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kSOei-0005lN-LX; Tue, 13 Oct 2020 18:04:12 +0000
Received: by outflank-mailman (input) for mailman id 6329;
 Tue, 13 Oct 2020 18:04:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=58E9=DU=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kSOeg-0005lH-QP
 for win-pv-devel@lists.xenproject.org; Tue, 13 Oct 2020 18:04:10 +0000
Received: from mail-io1-xd43.google.com (unknown [2607:f8b0:4864:20::d43])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f12d0d3f-6e46-4157-aad3-a6dc31c11c6a;
 Tue, 13 Oct 2020 18:04:09 +0000 (UTC)
Received: by mail-io1-xd43.google.com with SMTP id m17so501100ioo.1
 for <win-pv-devel@lists.xenproject.org>; Tue, 13 Oct 2020 11:04:09 -0700 (PDT)
Received: from localhost.localdomain (ool-18bc75a6.dyn.optonline.net.
 [24.188.117.166])
 by smtp.gmail.com with ESMTPSA id y6sm454674ili.36.2020.10.13.11.04.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 13 Oct 2020 11:04:04 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=58E9=DU=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kSOeg-0005lH-QP
	for win-pv-devel@lists.xenproject.org; Tue, 13 Oct 2020 18:04:10 +0000
X-Inumbo-ID: f12d0d3f-6e46-4157-aad3-a6dc31c11c6a
Received: from mail-io1-xd43.google.com (unknown [2607:f8b0:4864:20::d43])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f12d0d3f-6e46-4157-aad3-a6dc31c11c6a;
	Tue, 13 Oct 2020 18:04:09 +0000 (UTC)
Received: by mail-io1-xd43.google.com with SMTP id m17so501100ioo.1
        for <win-pv-devel@lists.xenproject.org>; Tue, 13 Oct 2020 11:04:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:to:cc:subject:date:message-id:mime-version
         :content-transfer-encoding;
        bh=+eUN8+yiLSJ2UOrmQymsQ8GhZVxFQ9j6avQySByNDHE=;
        b=jL6tOQFP9lpjh6G1oZFjpAw4/YSFztklo5z0AAE6/yueZGAs9DLN0rUCqovP9hch2F
         uXk13UoYv3k/2UxqxfcVOFqPqdximuTD7tAaVJr6Q8U+yigN125ghoRtMHenSAC11Lbb
         ufJkVq64a2mkkROuevLgoy0bOhIN6sQxhrQnlfa/KIUY1ewWsuWD8nXD1Y7UyprbdF3y
         glNfNweQS/lBsU1sEVdirsdXmEAOikaOcIV3utI3KCxe8ihJwDapTPmRLpyqZ6g4I398
         dze3hu2g+/2aY/IxdID7if1bsQarnqo/JlPwL5n7sR5zyHCpW68VJrDOAyQa+ezIzjG4
         gahA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
         :content-transfer-encoding;
        bh=+eUN8+yiLSJ2UOrmQymsQ8GhZVxFQ9j6avQySByNDHE=;
        b=OLcQP8OoBMyqC6/mWPdOSEI6UPzui2dCGMtcEUpjjzQ3hxgsexVZ9wHejNAjvSvMgK
         LD0N3LAv8QRla7oNxF0qSUwrqZX9duj+q/QK+YHKjRjl7mq2igAg8laWKk/XA0KhVkl0
         4DJ2CuSBaKHh2G9lPc7H0PYUk7utbISWF7orzUb6XmOyPdB7O+zBKIFLFTEPZyDmrqa/
         VH/V1Wd1Ea/a9KwKAT60erRYGMd/aI6myj8rU/uvdbdt7PWzvmjrag5K1sI/UzueDQ1l
         TAgCnSTqJcorHSzZQ3S4XrbFNe8r+nGRw/M8JyiQWRsIkvEgAKmOwdlWXgrLRHSAR5zI
         KriA==
X-Gm-Message-State: AOAM530Q8GDorcXLvoooPDW4SLdj8hV9RRw1C0EYBZv5LW1210dbP/0S
	7IwHCPy8f/fqHzhmkLpItcSeNCnHmmY=
X-Google-Smtp-Source: ABdhPJxly1KjMhKwzNCa1F94U7JnCNYEVQrXQi6K8llgFGMpQkVLLpN/6N2lnAi97314ijZkKjU0JA==
X-Received: by 2002:a05:6638:d0c:: with SMTP id q12mr33341jaj.95.1602612245588;
        Tue, 13 Oct 2020 11:04:05 -0700 (PDT)
Received: from localhost.localdomain (ool-18bc75a6.dyn.optonline.net. [24.188.117.166])
        by smtp.gmail.com with ESMTPSA id y6sm454674ili.36.2020.10.13.11.04.03
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 13 Oct 2020 11:04:04 -0700 (PDT)
From: Troy Crosley <troycrosley@gmail.com>
To: win-pv-devel@lists.xenproject.org
Cc: paul@xen.org,
	ben.chalmers@citrix.com,
	owen.smith@citrix.com,
	Troy Crosley <troycrosley@gmail.com>
Subject: [PATCH] Implement device power state transitions.
Date: Tue, 13 Oct 2020 14:03:43 -0400
Message-Id: <a7ebc1503d2de6a683262d48b77cae5ca494594b.1602611090.git.troycrosley@gmail.com>
X-Mailer: git-send-email 2.20.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Implement device power state transition boilerplate so that xenhid can
release its interfaces before the system enters S3. Let hidclass handle
other power IRP types.

Signed-off-by: Troy Crosley <troycrosley@gmail.com>
---
 src/xenhid/fdo.c             | 290 +++++++++++++++++++++++++++++++++--
 vs2015/xenhid/xenhid.vcxproj |   1 +
 vs2017/xenhid/xenhid.vcxproj |   1 +
 vs2019/xenhid/xenhid.vcxproj |   1 +
 4 files changed, 281 insertions(+), 12 deletions(-)

diff --git a/src/xenhid/fdo.c b/src/xenhid/fdo.c
index 860c7bc..706fa33 100644
--- a/src/xenhid/fdo.c
+++ b/src/xenhid/fdo.c
@@ -41,10 +41,12 @@
 #include <suspend_interface.h>
 
 #include "fdo.h"
+#include "thread.h"
 #include "driver.h"
 #include "dbg_print.h"
 #include "assert.h"
 #include "util.h"
+#include "names.h"
 #include "string.h"
 
 #define MAXNAMELEN  128
@@ -52,6 +54,9 @@
 struct _XENHID_FDO {
     PDEVICE_OBJECT              DeviceObject;
     PDEVICE_OBJECT              LowerDeviceObject;
+    PXENHID_THREAD              DevicePowerThread;
+    PIRP                        DevicePowerIrp;
+    DEVICE_POWER_STATE          DevicePowerState;
     BOOLEAN                     Enabled;
     XENHID_HID_INTERFACE        HidInterface;
     XENBUS_STORE_INTERFACE      StoreInterface;
@@ -220,6 +225,23 @@ __FdoFree(
     ExFreePoolWithTag(Buffer, FDO_POOL_TAG);
 }
 
+static FORCEINLINE VOID
+__FdoSetDevicePowerState(
+    IN  PXENHID_FDO         Fdo,
+    IN  DEVICE_POWER_STATE  State
+)
+{
+    Fdo->DevicePowerState = State;
+}
+
+static FORCEINLINE DEVICE_POWER_STATE
+__FdoGetDevicePowerState(
+    IN  PXENHID_FDO     Fdo
+)
+{
+    return Fdo->DevicePowerState;
+}
+
 static FORCEINLINE PANSI_STRING
 __FdoMultiSzToUpcaseAnsi(
     IN  PCHAR       Buffer
@@ -588,6 +610,8 @@ FdoD3ToD0(
 {
     NTSTATUS        status;
 
+    ASSERT3U(__FdoGetDevicePowerState(Fdo), ==, PowerDeviceD3);
+
     Trace("=====>\n");
 
     if (Fdo->Enabled)
@@ -621,6 +645,7 @@ FdoD3ToD0(
 
     Fdo->Enabled = TRUE;
 done:
+    __FdoSetDevicePowerState(Fdo, PowerDeviceD0);
     Trace("<=====\n");
     return STATUS_SUCCESS;
 
@@ -659,6 +684,8 @@ FdoD0ToD3(
 {
     Trace("=====>\n");
 
+    __FdoSetDevicePowerState(Fdo, PowerDeviceD3);
+
     if (!Fdo->Enabled)
         goto done;
 
@@ -868,6 +895,222 @@ FdoDispatchPnp(
     return status;
 }
 
+static FORCEINLINE NTSTATUS
+__FdoSetDevicePowerUp(
+    IN  PXENHID_FDO     Fdo,
+    IN  PIRP            Irp
+)
+{
+    PIO_STACK_LOCATION  StackLocation;
+    DEVICE_POWER_STATE  DeviceState;
+    NTSTATUS            status;
+
+    Trace("====>\n");
+
+    StackLocation = IoGetCurrentIrpStackLocation(Irp);
+    DeviceState = StackLocation->Parameters.Power.State.DeviceState;
+
+    ASSERT3U(DeviceState, < , __FdoGetDevicePowerState(Fdo));
+
+    status = FdoForwardIrpSynchronously(Fdo, Irp);
+    if (!NT_SUCCESS(status))
+        goto done;
+
+    Info("%s -> %s\n",
+        PowerDeviceStateName(__FdoGetDevicePowerState(Fdo)),
+        PowerDeviceStateName(DeviceState));
+
+    ASSERT3U(DeviceState, ==, PowerDeviceD0);
+    status = FdoD3ToD0(Fdo);
+    ASSERT(NT_SUCCESS(status));
+
+done:
+    Irp->IoStatus.Status = status;
+    IoCompleteRequest(Irp, IO_NO_INCREMENT);
+
+    Trace("<==== (%08x)\n", status);
+    return status;
+}
+
+static FORCEINLINE NTSTATUS
+__FdoSetDevicePowerDown(
+    IN  PXENHID_FDO     Fdo,
+    IN  PIRP            Irp
+)
+{
+    PIO_STACK_LOCATION  StackLocation;
+    DEVICE_POWER_STATE  DeviceState;
+    NTSTATUS            status;
+
+    StackLocation = IoGetCurrentIrpStackLocation(Irp);
+    DeviceState = StackLocation->Parameters.Power.State.DeviceState;
+
+    ASSERT3U(DeviceState, > , __FdoGetDevicePowerState(Fdo));
+
+    Info("%s -> %s\n",
+        PowerDeviceStateName(__FdoGetDevicePowerState(Fdo)),
+        PowerDeviceStateName(DeviceState));
+
+    ASSERT3U(DeviceState, ==, PowerDeviceD3);
+
+    if (__FdoGetDevicePowerState(Fdo) == PowerDeviceD0)
+        FdoD0ToD3(Fdo);
+
+    IoSkipCurrentIrpStackLocation(Irp);
+    status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
+
+    return status;
+}
+
+static FORCEINLINE NTSTATUS
+__FdoSetDevicePower(
+    IN  PXENHID_FDO     Fdo,
+    IN  PIRP            Irp
+)
+{
+    PIO_STACK_LOCATION  StackLocation;
+    DEVICE_POWER_STATE  DeviceState;
+    POWER_ACTION        PowerAction;
+    NTSTATUS            status;
+
+    StackLocation = IoGetCurrentIrpStackLocation(Irp);
+    DeviceState = StackLocation->Parameters.Power.State.DeviceState;
+    PowerAction = StackLocation->Parameters.Power.ShutdownType;
+
+    Trace("====> (%s:%s)\n",
+        PowerDeviceStateName(DeviceState),
+        PowerActionName(PowerAction));
+
+    ASSERT3U(PowerAction, < , PowerActionShutdown);
+
+    if (DeviceState == __FdoGetDevicePowerState(Fdo)) {
+        IoSkipCurrentIrpStackLocation(Irp);
+        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
+
+        goto done;
+    }
+
+    status = (DeviceState < __FdoGetDevicePowerState(Fdo)) ?
+        __FdoSetDevicePowerUp(Fdo, Irp) :
+        __FdoSetDevicePowerDown(Fdo, Irp);
+
+done:
+    Trace("<==== (%s:%s)(%08x)\n",
+        PowerDeviceStateName(DeviceState),
+        PowerActionName(PowerAction),
+        status);
+    return status;
+}
+
+static NTSTATUS
+FdoDevicePower(
+    IN  PXENHID_THREAD  Self,
+    IN  PVOID           Context
+)
+{
+    PXENHID_FDO         Fdo = (PXENHID_FDO)Context;
+    PKEVENT             Event;
+
+    Event = ThreadGetEvent(Self);
+
+    for (;;) {
+        PIRP                Irp;
+        PIO_STACK_LOCATION  StackLocation;
+        UCHAR               MinorFunction;
+
+        if (Fdo->DevicePowerIrp == NULL) {
+            (VOID)KeWaitForSingleObject(Event,
+                Executive,
+                KernelMode,
+                FALSE,
+                NULL);
+            KeClearEvent(Event);
+        }
+
+        if (ThreadIsAlerted(Self))
+            break;
+
+        Irp = Fdo->DevicePowerIrp;
+
+        if (Irp == NULL)
+            continue;
+
+        Fdo->DevicePowerIrp = NULL;
+        KeMemoryBarrier();
+
+        StackLocation = IoGetCurrentIrpStackLocation(Irp);
+        MinorFunction = StackLocation->MinorFunction;
+
+        switch (StackLocation->MinorFunction) {
+        case IRP_MN_SET_POWER:
+            (VOID)__FdoSetDevicePower(Fdo, Irp);
+            break;
+
+        default:
+            ASSERT(FALSE);
+            break;
+        }
+    }
+
+    return STATUS_SUCCESS;
+}
+
+static DECLSPEC_NOINLINE NTSTATUS
+FdoDispatchPower(
+    IN  PXENHID_FDO     Fdo,
+    IN  PIRP            Irp
+)
+{
+    PIO_STACK_LOCATION  StackLocation;
+    UCHAR               MinorFunction;
+    POWER_STATE_TYPE    PowerType;
+    POWER_ACTION        PowerAction;
+    NTSTATUS            status;
+
+    StackLocation = IoGetCurrentIrpStackLocation(Irp);
+    MinorFunction = StackLocation->MinorFunction;
+
+    if (MinorFunction != IRP_MN_SET_POWER) {
+        IoSkipCurrentIrpStackLocation(Irp);
+        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
+
+        goto done;
+    }
+
+    PowerType = StackLocation->Parameters.Power.Type;
+    PowerAction = StackLocation->Parameters.Power.ShutdownType;
+
+    if (PowerAction >= PowerActionShutdown) {
+        IoSkipCurrentIrpStackLocation(Irp);
+        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
+
+        goto done;
+    }
+
+    switch (PowerType) {
+    case DevicePowerState:
+        IoMarkIrpPending(Irp);
+
+        ASSERT3P(Fdo->DevicePowerIrp, ==, NULL);
+        Fdo->DevicePowerIrp = Irp;
+        KeMemoryBarrier();
+
+        ThreadWake(Fdo->DevicePowerThread);
+
+        status = STATUS_PENDING;
+        break;
+
+    case SystemPowerState:
+    default:
+        IoSkipCurrentIrpStackLocation(Irp);
+        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
+        break;
+    }
+
+done:
+    return status;
+}
+
 static DECLSPEC_NOINLINE NTSTATUS
 FdoDispatchInternal(
     IN  PXENHID_FDO Fdo,
@@ -1031,6 +1274,10 @@ FdoDispatch(
         status = FdoDispatchPnp(Fdo, Irp);
         break;
 
+    case IRP_MJ_POWER:
+        status = FdoDispatchPower(Fdo, Irp);
+        break;
+
     default:
         status = FdoDispatchDefault(Fdo, Irp);
         break;
@@ -1118,6 +1365,11 @@ FdoCreate(
 
     Fdo->DeviceObject = DeviceObject;
     Fdo->LowerDeviceObject = LowerDeviceObject;
+    Fdo->DevicePowerState = PowerDeviceD3;
+
+    status = ThreadCreate(FdoDevicePower, Fdo, &Fdo->DevicePowerThread);
+    if (!NT_SUCCESS(status))
+        goto fail1;
 
     InitializeListHead(&Fdo->List);
     KeInitializeSpinLock(&Fdo->Lock);
@@ -1130,7 +1382,7 @@ FdoCreate(
                              FdoCsqReleaseLock,
                              FdoCsqCompleteCanceledIrp);
     if (!NT_SUCCESS(status))
-        goto fail1;
+        goto fail2;
 
     status = FdoQueryInterface(Fdo,
                                &GUID_XENBUS_SUSPEND_INTERFACE,
@@ -1138,7 +1390,7 @@ FdoCreate(
                                (PINTERFACE)&Fdo->SuspendInterface,
                                sizeof(XENBUS_SUSPEND_INTERFACE));
     if (!NT_SUCCESS(status))
-        goto fail2;
+        goto fail3;
 
     status = FdoQueryInterface(Fdo,
                                &GUID_XENBUS_STORE_INTERFACE,
@@ -1146,7 +1398,7 @@ FdoCreate(
                                (PINTERFACE)&Fdo->StoreInterface,
                                sizeof(XENBUS_STORE_INTERFACE));
     if (!NT_SUCCESS(status))
-        goto fail3;
+        goto fail4;
 
     status = FdoQueryInterface(Fdo,
                                &GUID_XENHID_HID_INTERFACE,
@@ -1154,34 +1406,41 @@ FdoCreate(
                                (PINTERFACE)&Fdo->HidInterface,
                                sizeof(XENHID_HID_INTERFACE));
     if (!NT_SUCCESS(status))
-        goto fail4;
+        goto fail5;
 
     Trace("<=====\n");
     return STATUS_SUCCESS;
 
-fail4:
-    Error("fail4\n");
+fail5:
+    Error("fail5\n");
 
     RtlZeroMemory(&Fdo->StoreInterface,
                   sizeof(XENBUS_STORE_INTERFACE));
 
-fail3:
-    Error("fail3\n");
+fail4:
+    Error("fail4\n");
 
     RtlZeroMemory(&Fdo->SuspendInterface,
                   sizeof(XENBUS_SUSPEND_INTERFACE));
 
-fail2:
-    Error("fail2\n");
+fail3:
+    Error("fail3\n");
 
     RtlZeroMemory(&Fdo->Queue, sizeof(IO_CSQ));
 
-fail1:
-    Error("fail1 %08x\n", status);
+fail2:
+    Error("fail2 %08x\n", status);
+
+    ThreadAlert(Fdo->DevicePowerThread);
+    ThreadJoin(Fdo->DevicePowerThread);
+    Fdo->DevicePowerThread = NULL;
 
     RtlZeroMemory(&Fdo->List, sizeof(LIST_ENTRY));
     RtlZeroMemory(&Fdo->Lock, sizeof(KSPIN_LOCK));
 
+fail1:
+    Error("fail1 %08x\n", status);
+
     Fdo->DeviceObject = NULL;
     Fdo->LowerDeviceObject = NULL;
 
@@ -1202,6 +1461,13 @@ FdoDestroy(
                   sizeof(XENBUS_SUSPEND_INTERFACE));
     RtlZeroMemory(&Fdo->StoreInterface,
                   sizeof(XENBUS_STORE_INTERFACE));
+
+    ThreadAlert(Fdo->DevicePowerThread);
+    ThreadJoin(Fdo->DevicePowerThread);
+    Fdo->DevicePowerThread = NULL;
+    Fdo->DevicePowerIrp = NULL;
+    Fdo->DevicePowerState = 0;
+
     RtlZeroMemory(&Fdo->Queue, sizeof(IO_CSQ));
     RtlZeroMemory(&Fdo->List, sizeof(LIST_ENTRY));
     RtlZeroMemory(&Fdo->Lock, sizeof(KSPIN_LOCK));
diff --git a/vs2015/xenhid/xenhid.vcxproj b/vs2015/xenhid/xenhid.vcxproj
index 35ba30f..e15b581 100644
--- a/vs2015/xenhid/xenhid.vcxproj
+++ b/vs2015/xenhid/xenhid.vcxproj
@@ -53,6 +53,7 @@
   <ItemGroup>
     <ClCompile Include="../../src/xenhid/driver.c" />
     <ClCompile Include="../../src/xenhid/fdo.c" />
+    <ClCompile Include="../../src/xenhid/thread.c" />
     <ClCompile Include="../../src/xenhid/string.c" />
   </ItemGroup>
   <ItemGroup>
diff --git a/vs2017/xenhid/xenhid.vcxproj b/vs2017/xenhid/xenhid.vcxproj
index a113120..3ecd8d9 100644
--- a/vs2017/xenhid/xenhid.vcxproj
+++ b/vs2017/xenhid/xenhid.vcxproj
@@ -61,6 +61,7 @@
   <ItemGroup>
     <ClCompile Include="../../src/xenhid/driver.c" />
     <ClCompile Include="../../src/xenhid/fdo.c" />
+    <ClCompile Include="../../src/xenhid/thread.c" />
     <ClCompile Include="../../src/xenhid/string.c" />
   </ItemGroup>
   <ItemGroup>
diff --git a/vs2019/xenhid/xenhid.vcxproj b/vs2019/xenhid/xenhid.vcxproj
index 996df2c..4573a59 100644
--- a/vs2019/xenhid/xenhid.vcxproj
+++ b/vs2019/xenhid/xenhid.vcxproj
@@ -61,6 +61,7 @@
   <ItemGroup>
     <ClCompile Include="../../src/xenhid/driver.c" />
     <ClCompile Include="../../src/xenhid/fdo.c" />
+    <ClCompile Include="../../src/xenhid/thread.c" />
     <ClCompile Include="../../src/xenhid/string.c" />
   </ItemGroup>
   <ItemGroup>
-- 
2.20.1



From win-pv-devel-bounces@lists.xenproject.org Tue Oct 13 18:05:07 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 13 Oct 2020 18:05:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6332.16875 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kSOfb-0005nT-SQ; Tue, 13 Oct 2020 18:05:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6332.16875; Tue, 13 Oct 2020 18:05:07 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kSOfb-0005nM-PD; Tue, 13 Oct 2020 18:05:07 +0000
Received: by outflank-mailman (input) for mailman id 6332;
 Tue, 13 Oct 2020 18:05:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=58E9=DU=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kSOfZ-0005nH-Vc
 for win-pv-devel@lists.xenproject.org; Tue, 13 Oct 2020 18:05:06 +0000
Received: from mail-ed1-x544.google.com (unknown [2a00:1450:4864:20::544])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 67579d14-c5a4-44b4-8a60-2605751996c0;
 Tue, 13 Oct 2020 18:05:03 +0000 (UTC)
Received: by mail-ed1-x544.google.com with SMTP id dn5so394526edb.10
 for <win-pv-devel@lists.xenproject.org>; Tue, 13 Oct 2020 11:05:03 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=58E9=DU=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kSOfZ-0005nH-Vc
	for win-pv-devel@lists.xenproject.org; Tue, 13 Oct 2020 18:05:06 +0000
X-Inumbo-ID: 67579d14-c5a4-44b4-8a60-2605751996c0
Received: from mail-ed1-x544.google.com (unknown [2a00:1450:4864:20::544])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 67579d14-c5a4-44b4-8a60-2605751996c0;
	Tue, 13 Oct 2020 18:05:03 +0000 (UTC)
Received: by mail-ed1-x544.google.com with SMTP id dn5so394526edb.10
        for <win-pv-devel@lists.xenproject.org>; Tue, 13 Oct 2020 11:05:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
        bh=m5lAo0jmzjmmlLGjEYlKKh9B9RsaEGxMUC8YZHkxLUI=;
        b=PQLP63QEUSfWzuAhWJN5qeKV0Sj769+3t7K50MnWF5JgfYaqaxMMEpzvwb+GUnp74A
         uBBTbc9iiMBb4bWQ2W82663neHHBHwESeQYiY9DJdmPyP8XjrjWlu1EK3LpajkyYRt98
         U4dPVyonY7QPgJRXn7lyOErAcid81PGKse3qDkb7GyubiRs83hR/1+i8BbkJWLviMC0P
         +l9ZZQFADCDS4GvWzDoKmkYNRoR3XoPvCC2XGCylpXTQv+9nN7CxKC9bGgNFP1kKGygn
         kHWnAW+GnN8WQ2KFK9ie/N/bxs48MIDs/O8u2LydISYBc2MTCld4xEn7VA4sSo4d4yok
         3TVA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to;
        bh=m5lAo0jmzjmmlLGjEYlKKh9B9RsaEGxMUC8YZHkxLUI=;
        b=pxR5u05h29s8l4ZvYH3rcteipRm0e2ilZsIwOjciNtpzk+utCpl5n9d44KugLVkzhO
         4JXU5D3PmqDNMK9z9Ybf97pegyLzK084q6+/29Bg/S8fcnUdjlDV06Okt1dPu1gEjMCC
         rK781TkhjaXmzaa6o1hKvqA9F0vaA313VVsCz23x80HSja4CBfrrvZTrQiCCEMGsmVcE
         hX9nVc20CX0UprxuIoLk3Gc0t24OR7Kk06+Oa1f6wHZzglNjjU0psfgMMYe1VUTxB+ES
         3Niy80L/vntAYmDPNQr1rcXTaNgefN1QU9PJn8VFoGnITr9/ONjHp0L5MqXWMdoNFssm
         SDKg==
X-Gm-Message-State: AOAM533QvyiJfpHAb4N6cMl/AP/f5LNX4mMrej95vUBdn3z6YTGejd30
	olHt3rGLSXPGrWGGA91upvYeo7N1npJYvEDkFvi0PW2LHH8=
X-Google-Smtp-Source: ABdhPJzeS31d9A6xjmKzTsvwrDo0miDq33UH/NrzeZRmPWx/RcJZE0v596uruakJomSROJi5CULBrTYLpvUQuTrbupo=
X-Received: by 2002:a50:c38c:: with SMTP id h12mr806691edf.185.1602612302295;
 Tue, 13 Oct 2020 11:05:02 -0700 (PDT)
MIME-Version: 1.0
References: <a7ebc1503d2de6a683262d48b77cae5ca494594b.1602611090.git.troycrosley@gmail.com>
In-Reply-To: <a7ebc1503d2de6a683262d48b77cae5ca494594b.1602611090.git.troycrosley@gmail.com>
From: Troy Crosley <troycrosley@gmail.com>
Date: Tue, 13 Oct 2020 14:04:50 -0400
Message-ID: <CAOBjErLCUUwB+o1WhpXNX6Xqj8Mv84+Y3uJWQ8cr0A2CTnmsJQ@mail.gmail.com>
Subject: Re: [PATCH] Implement device power state transitions.
To: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000fdbfdf05b19140da"

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

I'm not sure to what extent hidclass handles power transitions, so this
patch addresses only set power IRPs and passes down query and system power
IRPs.

On Tue, Oct 13, 2020 at 2:04 PM Troy Crosley <troycrosley@gmail.com> wrote:

> Implement device power state transition boilerplate so that xenhid can
> release its interfaces before the system enters S3. Let hidclass handle
> other power IRP types.
>
> Signed-off-by: Troy Crosley <troycrosley@gmail.com>
> ---
>  src/xenhid/fdo.c             | 290 +++++++++++++++++++++++++++++++++--
>  vs2015/xenhid/xenhid.vcxproj |   1 +
>  vs2017/xenhid/xenhid.vcxproj |   1 +
>  vs2019/xenhid/xenhid.vcxproj |   1 +
>  4 files changed, 281 insertions(+), 12 deletions(-)
>
> diff --git a/src/xenhid/fdo.c b/src/xenhid/fdo.c
> index 860c7bc..706fa33 100644
> --- a/src/xenhid/fdo.c
> +++ b/src/xenhid/fdo.c
> @@ -41,10 +41,12 @@
>  #include <suspend_interface.h>
>
>  #include "fdo.h"
> +#include "thread.h"
>  #include "driver.h"
>  #include "dbg_print.h"
>  #include "assert.h"
>  #include "util.h"
> +#include "names.h"
>  #include "string.h"
>
>  #define MAXNAMELEN  128
> @@ -52,6 +54,9 @@
>  struct _XENHID_FDO {
>      PDEVICE_OBJECT              DeviceObject;
>      PDEVICE_OBJECT              LowerDeviceObject;
> +    PXENHID_THREAD              DevicePowerThread;
> +    PIRP                        DevicePowerIrp;
> +    DEVICE_POWER_STATE          DevicePowerState;
>      BOOLEAN                     Enabled;
>      XENHID_HID_INTERFACE        HidInterface;
>      XENBUS_STORE_INTERFACE      StoreInterface;
> @@ -220,6 +225,23 @@ __FdoFree(
>      ExFreePoolWithTag(Buffer, FDO_POOL_TAG);
>  }
>
> +static FORCEINLINE VOID
> +__FdoSetDevicePowerState(
> +    IN  PXENHID_FDO         Fdo,
> +    IN  DEVICE_POWER_STATE  State
> +)
> +{
> +    Fdo->DevicePowerState = State;
> +}
> +
> +static FORCEINLINE DEVICE_POWER_STATE
> +__FdoGetDevicePowerState(
> +    IN  PXENHID_FDO     Fdo
> +)
> +{
> +    return Fdo->DevicePowerState;
> +}
> +
>  static FORCEINLINE PANSI_STRING
>  __FdoMultiSzToUpcaseAnsi(
>      IN  PCHAR       Buffer
> @@ -588,6 +610,8 @@ FdoD3ToD0(
>  {
>      NTSTATUS        status;
>
> +    ASSERT3U(__FdoGetDevicePowerState(Fdo), ==, PowerDeviceD3);
> +
>      Trace("=====>\n");
>
>      if (Fdo->Enabled)
> @@ -621,6 +645,7 @@ FdoD3ToD0(
>
>      Fdo->Enabled = TRUE;
>  done:
> +    __FdoSetDevicePowerState(Fdo, PowerDeviceD0);
>      Trace("<=====\n");
>      return STATUS_SUCCESS;
>
> @@ -659,6 +684,8 @@ FdoD0ToD3(
>  {
>      Trace("=====>\n");
>
> +    __FdoSetDevicePowerState(Fdo, PowerDeviceD3);
> +
>      if (!Fdo->Enabled)
>          goto done;
>
> @@ -868,6 +895,222 @@ FdoDispatchPnp(
>      return status;
>  }
>
> +static FORCEINLINE NTSTATUS
> +__FdoSetDevicePowerUp(
> +    IN  PXENHID_FDO     Fdo,
> +    IN  PIRP            Irp
> +)
> +{
> +    PIO_STACK_LOCATION  StackLocation;
> +    DEVICE_POWER_STATE  DeviceState;
> +    NTSTATUS            status;
> +
> +    Trace("====>\n");
> +
> +    StackLocation = IoGetCurrentIrpStackLocation(Irp);
> +    DeviceState = StackLocation->Parameters.Power.State.DeviceState;
> +
> +    ASSERT3U(DeviceState, < , __FdoGetDevicePowerState(Fdo));
> +
> +    status = FdoForwardIrpSynchronously(Fdo, Irp);
> +    if (!NT_SUCCESS(status))
> +        goto done;
> +
> +    Info("%s -> %s\n",
> +        PowerDeviceStateName(__FdoGetDevicePowerState(Fdo)),
> +        PowerDeviceStateName(DeviceState));
> +
> +    ASSERT3U(DeviceState, ==, PowerDeviceD0);
> +    status = FdoD3ToD0(Fdo);
> +    ASSERT(NT_SUCCESS(status));
> +
> +done:
> +    Irp->IoStatus.Status = status;
> +    IoCompleteRequest(Irp, IO_NO_INCREMENT);
> +
> +    Trace("<==== (%08x)\n", status);
> +    return status;
> +}
> +
> +static FORCEINLINE NTSTATUS
> +__FdoSetDevicePowerDown(
> +    IN  PXENHID_FDO     Fdo,
> +    IN  PIRP            Irp
> +)
> +{
> +    PIO_STACK_LOCATION  StackLocation;
> +    DEVICE_POWER_STATE  DeviceState;
> +    NTSTATUS            status;
> +
> +    StackLocation = IoGetCurrentIrpStackLocation(Irp);
> +    DeviceState = StackLocation->Parameters.Power.State.DeviceState;
> +
> +    ASSERT3U(DeviceState, > , __FdoGetDevicePowerState(Fdo));
> +
> +    Info("%s -> %s\n",
> +        PowerDeviceStateName(__FdoGetDevicePowerState(Fdo)),
> +        PowerDeviceStateName(DeviceState));
> +
> +    ASSERT3U(DeviceState, ==, PowerDeviceD3);
> +
> +    if (__FdoGetDevicePowerState(Fdo) == PowerDeviceD0)
> +        FdoD0ToD3(Fdo);
> +
> +    IoSkipCurrentIrpStackLocation(Irp);
> +    status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
> +
> +    return status;
> +}
> +
> +static FORCEINLINE NTSTATUS
> +__FdoSetDevicePower(
> +    IN  PXENHID_FDO     Fdo,
> +    IN  PIRP            Irp
> +)
> +{
> +    PIO_STACK_LOCATION  StackLocation;
> +    DEVICE_POWER_STATE  DeviceState;
> +    POWER_ACTION        PowerAction;
> +    NTSTATUS            status;
> +
> +    StackLocation = IoGetCurrentIrpStackLocation(Irp);
> +    DeviceState = StackLocation->Parameters.Power.State.DeviceState;
> +    PowerAction = StackLocation->Parameters.Power.ShutdownType;
> +
> +    Trace("====> (%s:%s)\n",
> +        PowerDeviceStateName(DeviceState),
> +        PowerActionName(PowerAction));
> +
> +    ASSERT3U(PowerAction, < , PowerActionShutdown);
> +
> +    if (DeviceState == __FdoGetDevicePowerState(Fdo)) {
> +        IoSkipCurrentIrpStackLocation(Irp);
> +        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
> +
> +        goto done;
> +    }
> +
> +    status = (DeviceState < __FdoGetDevicePowerState(Fdo)) ?
> +        __FdoSetDevicePowerUp(Fdo, Irp) :
> +        __FdoSetDevicePowerDown(Fdo, Irp);
> +
> +done:
> +    Trace("<==== (%s:%s)(%08x)\n",
> +        PowerDeviceStateName(DeviceState),
> +        PowerActionName(PowerAction),
> +        status);
> +    return status;
> +}
> +
> +static NTSTATUS
> +FdoDevicePower(
> +    IN  PXENHID_THREAD  Self,
> +    IN  PVOID           Context
> +)
> +{
> +    PXENHID_FDO         Fdo = (PXENHID_FDO)Context;
> +    PKEVENT             Event;
> +
> +    Event = ThreadGetEvent(Self);
> +
> +    for (;;) {
> +        PIRP                Irp;
> +        PIO_STACK_LOCATION  StackLocation;
> +        UCHAR               MinorFunction;
> +
> +        if (Fdo->DevicePowerIrp == NULL) {
> +            (VOID)KeWaitForSingleObject(Event,
> +                Executive,
> +                KernelMode,
> +                FALSE,
> +                NULL);
> +            KeClearEvent(Event);
> +        }
> +
> +        if (ThreadIsAlerted(Self))
> +            break;
> +
> +        Irp = Fdo->DevicePowerIrp;
> +
> +        if (Irp == NULL)
> +            continue;
> +
> +        Fdo->DevicePowerIrp = NULL;
> +        KeMemoryBarrier();
> +
> +        StackLocation = IoGetCurrentIrpStackLocation(Irp);
> +        MinorFunction = StackLocation->MinorFunction;
> +
> +        switch (StackLocation->MinorFunction) {
> +        case IRP_MN_SET_POWER:
> +            (VOID)__FdoSetDevicePower(Fdo, Irp);
> +            break;
> +
> +        default:
> +            ASSERT(FALSE);
> +            break;
> +        }
> +    }
> +
> +    return STATUS_SUCCESS;
> +}
> +
> +static DECLSPEC_NOINLINE NTSTATUS
> +FdoDispatchPower(
> +    IN  PXENHID_FDO     Fdo,
> +    IN  PIRP            Irp
> +)
> +{
> +    PIO_STACK_LOCATION  StackLocation;
> +    UCHAR               MinorFunction;
> +    POWER_STATE_TYPE    PowerType;
> +    POWER_ACTION        PowerAction;
> +    NTSTATUS            status;
> +
> +    StackLocation = IoGetCurrentIrpStackLocation(Irp);
> +    MinorFunction = StackLocation->MinorFunction;
> +
> +    if (MinorFunction != IRP_MN_SET_POWER) {
> +        IoSkipCurrentIrpStackLocation(Irp);
> +        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
> +
> +        goto done;
> +    }
> +
> +    PowerType = StackLocation->Parameters.Power.Type;
> +    PowerAction = StackLocation->Parameters.Power.ShutdownType;
> +
> +    if (PowerAction >= PowerActionShutdown) {
> +        IoSkipCurrentIrpStackLocation(Irp);
> +        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
> +
> +        goto done;
> +    }
> +
> +    switch (PowerType) {
> +    case DevicePowerState:
> +        IoMarkIrpPending(Irp);
> +
> +        ASSERT3P(Fdo->DevicePowerIrp, ==, NULL);
> +        Fdo->DevicePowerIrp = Irp;
> +        KeMemoryBarrier();
> +
> +        ThreadWake(Fdo->DevicePowerThread);
> +
> +        status = STATUS_PENDING;
> +        break;
> +
> +    case SystemPowerState:
> +    default:
> +        IoSkipCurrentIrpStackLocation(Irp);
> +        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
> +        break;
> +    }
> +
> +done:
> +    return status;
> +}
> +
>  static DECLSPEC_NOINLINE NTSTATUS
>  FdoDispatchInternal(
>      IN  PXENHID_FDO Fdo,
> @@ -1031,6 +1274,10 @@ FdoDispatch(
>          status = FdoDispatchPnp(Fdo, Irp);
>          break;
>
> +    case IRP_MJ_POWER:
> +        status = FdoDispatchPower(Fdo, Irp);
> +        break;
> +
>      default:
>          status = FdoDispatchDefault(Fdo, Irp);
>          break;
> @@ -1118,6 +1365,11 @@ FdoCreate(
>
>      Fdo->DeviceObject = DeviceObject;
>      Fdo->LowerDeviceObject = LowerDeviceObject;
> +    Fdo->DevicePowerState = PowerDeviceD3;
> +
> +    status = ThreadCreate(FdoDevicePower, Fdo, &Fdo->DevicePowerThread);
> +    if (!NT_SUCCESS(status))
> +        goto fail1;
>
>      InitializeListHead(&Fdo->List);
>      KeInitializeSpinLock(&Fdo->Lock);
> @@ -1130,7 +1382,7 @@ FdoCreate(
>                               FdoCsqReleaseLock,
>                               FdoCsqCompleteCanceledIrp);
>      if (!NT_SUCCESS(status))
> -        goto fail1;
> +        goto fail2;
>
>      status = FdoQueryInterface(Fdo,
>                                 &GUID_XENBUS_SUSPEND_INTERFACE,
> @@ -1138,7 +1390,7 @@ FdoCreate(
>                                 (PINTERFACE)&Fdo->SuspendInterface,
>                                 sizeof(XENBUS_SUSPEND_INTERFACE));
>      if (!NT_SUCCESS(status))
> -        goto fail2;
> +        goto fail3;
>
>      status = FdoQueryInterface(Fdo,
>                                 &GUID_XENBUS_STORE_INTERFACE,
> @@ -1146,7 +1398,7 @@ FdoCreate(
>                                 (PINTERFACE)&Fdo->StoreInterface,
>                                 sizeof(XENBUS_STORE_INTERFACE));
>      if (!NT_SUCCESS(status))
> -        goto fail3;
> +        goto fail4;
>
>      status = FdoQueryInterface(Fdo,
>                                 &GUID_XENHID_HID_INTERFACE,
> @@ -1154,34 +1406,41 @@ FdoCreate(
>                                 (PINTERFACE)&Fdo->HidInterface,
>                                 sizeof(XENHID_HID_INTERFACE));
>      if (!NT_SUCCESS(status))
> -        goto fail4;
> +        goto fail5;
>
>      Trace("<=====\n");
>      return STATUS_SUCCESS;
>
> -fail4:
> -    Error("fail4\n");
> +fail5:
> +    Error("fail5\n");
>
>      RtlZeroMemory(&Fdo->StoreInterface,
>                    sizeof(XENBUS_STORE_INTERFACE));
>
> -fail3:
> -    Error("fail3\n");
> +fail4:
> +    Error("fail4\n");
>
>      RtlZeroMemory(&Fdo->SuspendInterface,
>                    sizeof(XENBUS_SUSPEND_INTERFACE));
>
> -fail2:
> -    Error("fail2\n");
> +fail3:
> +    Error("fail3\n");
>
>      RtlZeroMemory(&Fdo->Queue, sizeof(IO_CSQ));
>
> -fail1:
> -    Error("fail1 %08x\n", status);
> +fail2:
> +    Error("fail2 %08x\n", status);
> +
> +    ThreadAlert(Fdo->DevicePowerThread);
> +    ThreadJoin(Fdo->DevicePowerThread);
> +    Fdo->DevicePowerThread = NULL;
>
>      RtlZeroMemory(&Fdo->List, sizeof(LIST_ENTRY));
>      RtlZeroMemory(&Fdo->Lock, sizeof(KSPIN_LOCK));
>
> +fail1:
> +    Error("fail1 %08x\n", status);
> +
>      Fdo->DeviceObject = NULL;
>      Fdo->LowerDeviceObject = NULL;
>
> @@ -1202,6 +1461,13 @@ FdoDestroy(
>                    sizeof(XENBUS_SUSPEND_INTERFACE));
>      RtlZeroMemory(&Fdo->StoreInterface,
>                    sizeof(XENBUS_STORE_INTERFACE));
> +
> +    ThreadAlert(Fdo->DevicePowerThread);
> +    ThreadJoin(Fdo->DevicePowerThread);
> +    Fdo->DevicePowerThread = NULL;
> +    Fdo->DevicePowerIrp = NULL;
> +    Fdo->DevicePowerState = 0;
> +
>      RtlZeroMemory(&Fdo->Queue, sizeof(IO_CSQ));
>      RtlZeroMemory(&Fdo->List, sizeof(LIST_ENTRY));
>      RtlZeroMemory(&Fdo->Lock, sizeof(KSPIN_LOCK));
> diff --git a/vs2015/xenhid/xenhid.vcxproj b/vs2015/xenhid/xenhid.vcxproj
> index 35ba30f..e15b581 100644
> --- a/vs2015/xenhid/xenhid.vcxproj
> +++ b/vs2015/xenhid/xenhid.vcxproj
> @@ -53,6 +53,7 @@
>    <ItemGroup>
>      <ClCompile Include="../../src/xenhid/driver.c" />
>      <ClCompile Include="../../src/xenhid/fdo.c" />
> +    <ClCompile Include="../../src/xenhid/thread.c" />
>      <ClCompile Include="../../src/xenhid/string.c" />
>    </ItemGroup>
>    <ItemGroup>
> diff --git a/vs2017/xenhid/xenhid.vcxproj b/vs2017/xenhid/xenhid.vcxproj
> index a113120..3ecd8d9 100644
> --- a/vs2017/xenhid/xenhid.vcxproj
> +++ b/vs2017/xenhid/xenhid.vcxproj
> @@ -61,6 +61,7 @@
>    <ItemGroup>
>      <ClCompile Include="../../src/xenhid/driver.c" />
>      <ClCompile Include="../../src/xenhid/fdo.c" />
> +    <ClCompile Include="../../src/xenhid/thread.c" />
>      <ClCompile Include="../../src/xenhid/string.c" />
>    </ItemGroup>
>    <ItemGroup>
> diff --git a/vs2019/xenhid/xenhid.vcxproj b/vs2019/xenhid/xenhid.vcxproj
> index 996df2c..4573a59 100644
> --- a/vs2019/xenhid/xenhid.vcxproj
> +++ b/vs2019/xenhid/xenhid.vcxproj
> @@ -61,6 +61,7 @@
>    <ItemGroup>
>      <ClCompile Include="../../src/xenhid/driver.c" />
>      <ClCompile Include="../../src/xenhid/fdo.c" />
> +    <ClCompile Include="../../src/xenhid/thread.c" />
>      <ClCompile Include="../../src/xenhid/string.c" />
>    </ItemGroup>
>    <ItemGroup>
> --
> 2.20.1
>
>

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

<div dir=3D"ltr">I&#39;m not sure to what extent hidclass handles power tra=
nsitions, so this patch addresses only set power IRPs and passes down query=
 and system power IRPs.<br></div><br><div class=3D"gmail_quote"><div dir=3D=
"ltr" class=3D"gmail_attr">On Tue, Oct 13, 2020 at 2:04 PM Troy Crosley &lt=
;<a href=3D"mailto:troycrosley@gmail.com">troycrosley@gmail.com</a>&gt; wro=
te:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px =
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Implement de=
vice power state transition boilerplate so that xenhid can<br>
release its interfaces before the system enters S3. Let hidclass handle<br>
other power IRP types.<br>
<br>
Signed-off-by: Troy Crosley &lt;<a href=3D"mailto:troycrosley@gmail.com" ta=
rget=3D"_blank">troycrosley@gmail.com</a>&gt;<br>
---<br>
=C2=A0src/xenhid/fdo.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 290=
 +++++++++++++++++++++++++++++++++--<br>
=C2=A0vs2015/xenhid/xenhid.vcxproj |=C2=A0 =C2=A01 +<br>
=C2=A0vs2017/xenhid/xenhid.vcxproj |=C2=A0 =C2=A01 +<br>
=C2=A0vs2019/xenhid/xenhid.vcxproj |=C2=A0 =C2=A01 +<br>
=C2=A04 files changed, 281 insertions(+), 12 deletions(-)<br>
<br>
diff --git a/src/xenhid/fdo.c b/src/xenhid/fdo.c<br>
index 860c7bc..706fa33 100644<br>
--- a/src/xenhid/fdo.c<br>
+++ b/src/xenhid/fdo.c<br>
@@ -41,10 +41,12 @@<br>
=C2=A0#include &lt;suspend_interface.h&gt;<br>
<br>
=C2=A0#include &quot;fdo.h&quot;<br>
+#include &quot;thread.h&quot;<br>
=C2=A0#include &quot;driver.h&quot;<br>
=C2=A0#include &quot;dbg_print.h&quot;<br>
=C2=A0#include &quot;assert.h&quot;<br>
=C2=A0#include &quot;util.h&quot;<br>
+#include &quot;names.h&quot;<br>
=C2=A0#include &quot;string.h&quot;<br>
<br>
=C2=A0#define MAXNAMELEN=C2=A0 128<br>
@@ -52,6 +54,9 @@<br>
=C2=A0struct _XENHID_FDO {<br>
=C2=A0 =C2=A0 =C2=A0PDEVICE_OBJECT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 DeviceObject;<br>
=C2=A0 =C2=A0 =C2=A0PDEVICE_OBJECT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 LowerDeviceObject;<br>
+=C2=A0 =C2=A0 PXENHID_THREAD=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 DevicePowerThread;<br>
+=C2=A0 =C2=A0 PIRP=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 DevicePowerIrp;<br>
+=C2=A0 =C2=A0 DEVICE_POWER_STATE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DeviceP=
owerState;<br>
=C2=A0 =C2=A0 =C2=A0BOOLEAN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0Enabled;<br>
=C2=A0 =C2=A0 =C2=A0XENHID_HID_INTERFACE=C2=A0 =C2=A0 =C2=A0 =C2=A0 HidInte=
rface;<br>
=C2=A0 =C2=A0 =C2=A0XENBUS_STORE_INTERFACE=C2=A0 =C2=A0 =C2=A0 StoreInterfa=
ce;<br>
@@ -220,6 +225,23 @@ __FdoFree(<br>
=C2=A0 =C2=A0 =C2=A0ExFreePoolWithTag(Buffer, FDO_POOL_TAG);<br>
=C2=A0}<br>
<br>
+static FORCEINLINE VOID<br>
+__FdoSetDevicePowerState(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Fdo,<b=
r>
+=C2=A0 =C2=A0 IN=C2=A0 DEVICE_POWER_STATE=C2=A0 State<br>
+)<br>
+{<br>
+=C2=A0 =C2=A0 Fdo-&gt;DevicePowerState =3D State;<br>
+}<br>
+<br>
+static FORCEINLINE DEVICE_POWER_STATE<br>
+__FdoGetDevicePowerState(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0Fdo<br>
+)<br>
+{<br>
+=C2=A0 =C2=A0 return Fdo-&gt;DevicePowerState;<br>
+}<br>
+<br>
=C2=A0static FORCEINLINE PANSI_STRING<br>
=C2=A0__FdoMultiSzToUpcaseAnsi(<br>
=C2=A0 =C2=A0 =C2=A0IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0Buffer<br>
@@ -588,6 +610,8 @@ FdoD3ToD0(<br>
=C2=A0{<br>
=C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br>
<br>
+=C2=A0 =C2=A0 ASSERT3U(__FdoGetDevicePowerState(Fdo), =3D=3D, PowerDeviceD=
3);<br>
+<br>
=C2=A0 =C2=A0 =C2=A0Trace(&quot;=3D=3D=3D=3D=3D&gt;\n&quot;);<br>
<br>
=C2=A0 =C2=A0 =C2=A0if (Fdo-&gt;Enabled)<br>
@@ -621,6 +645,7 @@ FdoD3ToD0(<br>
<br>
=C2=A0 =C2=A0 =C2=A0Fdo-&gt;Enabled =3D TRUE;<br>
=C2=A0done:<br>
+=C2=A0 =C2=A0 __FdoSetDevicePowerState(Fdo, PowerDeviceD0);<br>
=C2=A0 =C2=A0 =C2=A0Trace(&quot;&lt;=3D=3D=3D=3D=3D\n&quot;);<br>
=C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
<br>
@@ -659,6 +684,8 @@ FdoD0ToD3(<br>
=C2=A0{<br>
=C2=A0 =C2=A0 =C2=A0Trace(&quot;=3D=3D=3D=3D=3D&gt;\n&quot;);<br>
<br>
+=C2=A0 =C2=A0 __FdoSetDevicePowerState(Fdo, PowerDeviceD3);<br>
+<br>
=C2=A0 =C2=A0 =C2=A0if (!Fdo-&gt;Enabled)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto done;<br>
<br>
@@ -868,6 +895,222 @@ FdoDispatchPnp(<br>
=C2=A0 =C2=A0 =C2=A0return status;<br>
=C2=A0}<br>
<br>
+static FORCEINLINE NTSTATUS<br>
+__FdoSetDevicePowerUp(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0Fdo,<br>
+=C2=A0 =C2=A0 IN=C2=A0 PIRP=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Irp<b=
r>
+)<br>
+{<br>
+=C2=A0 =C2=A0 PIO_STACK_LOCATION=C2=A0 StackLocation;<br>
+=C2=A0 =C2=A0 DEVICE_POWER_STATE=C2=A0 DeviceState;<br>
+=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br=
>
+<br>
+=C2=A0 =C2=A0 Trace(&quot;=3D=3D=3D=3D&gt;\n&quot;);<br>
+<br>
+=C2=A0 =C2=A0 StackLocation =3D IoGetCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 DeviceState =3D StackLocation-&gt;Parameters.Power.State.Dev=
iceState;<br>
+<br>
+=C2=A0 =C2=A0 ASSERT3U(DeviceState, &lt; , __FdoGetDevicePowerState(Fdo));=
<br>
+<br>
+=C2=A0 =C2=A0 status =3D FdoForwardIrpSynchronously(Fdo, Irp);<br>
+=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
+<br>
+=C2=A0 =C2=A0 Info(&quot;%s -&gt; %s\n&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerDeviceStateName(__FdoGetDevicePowerState(=
Fdo)),<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerDeviceStateName(DeviceState));<br>
+<br>
+=C2=A0 =C2=A0 ASSERT3U(DeviceState, =3D=3D, PowerDeviceD0);<br>
+=C2=A0 =C2=A0 status =3D FdoD3ToD0(Fdo);<br>
+=C2=A0 =C2=A0 ASSERT(NT_SUCCESS(status));<br>
+<br>
+done:<br>
+=C2=A0 =C2=A0 Irp-&gt;IoStatus.Status =3D status;<br>
+=C2=A0 =C2=A0 IoCompleteRequest(Irp, IO_NO_INCREMENT);<br>
+<br>
+=C2=A0 =C2=A0 Trace(&quot;&lt;=3D=3D=3D=3D (%08x)\n&quot;, status);<br>
+=C2=A0 =C2=A0 return status;<br>
+}<br>
+<br>
+static FORCEINLINE NTSTATUS<br>
+__FdoSetDevicePowerDown(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0Fdo,<br>
+=C2=A0 =C2=A0 IN=C2=A0 PIRP=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Irp<b=
r>
+)<br>
+{<br>
+=C2=A0 =C2=A0 PIO_STACK_LOCATION=C2=A0 StackLocation;<br>
+=C2=A0 =C2=A0 DEVICE_POWER_STATE=C2=A0 DeviceState;<br>
+=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br=
>
+<br>
+=C2=A0 =C2=A0 StackLocation =3D IoGetCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 DeviceState =3D StackLocation-&gt;Parameters.Power.State.Dev=
iceState;<br>
+<br>
+=C2=A0 =C2=A0 ASSERT3U(DeviceState, &gt; , __FdoGetDevicePowerState(Fdo));=
<br>
+<br>
+=C2=A0 =C2=A0 Info(&quot;%s -&gt; %s\n&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerDeviceStateName(__FdoGetDevicePowerState(=
Fdo)),<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerDeviceStateName(DeviceState));<br>
+<br>
+=C2=A0 =C2=A0 ASSERT3U(DeviceState, =3D=3D, PowerDeviceD3);<br>
+<br>
+=C2=A0 =C2=A0 if (__FdoGetDevicePowerState(Fdo) =3D=3D PowerDeviceD0)<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 FdoD0ToD3(Fdo);<br>
+<br>
+=C2=A0 =C2=A0 IoSkipCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 status =3D IoCallDriver(Fdo-&gt;LowerDeviceObject, Irp);<br>
+<br>
+=C2=A0 =C2=A0 return status;<br>
+}<br>
+<br>
+static FORCEINLINE NTSTATUS<br>
+__FdoSetDevicePower(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0Fdo,<br>
+=C2=A0 =C2=A0 IN=C2=A0 PIRP=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Irp<b=
r>
+)<br>
+{<br>
+=C2=A0 =C2=A0 PIO_STACK_LOCATION=C2=A0 StackLocation;<br>
+=C2=A0 =C2=A0 DEVICE_POWER_STATE=C2=A0 DeviceState;<br>
+=C2=A0 =C2=A0 POWER_ACTION=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerAction;<br>
+=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br=
>
+<br>
+=C2=A0 =C2=A0 StackLocation =3D IoGetCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 DeviceState =3D StackLocation-&gt;Parameters.Power.State.Dev=
iceState;<br>
+=C2=A0 =C2=A0 PowerAction =3D StackLocation-&gt;Parameters.Power.ShutdownT=
ype;<br>
+<br>
+=C2=A0 =C2=A0 Trace(&quot;=3D=3D=3D=3D&gt; (%s:%s)\n&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerDeviceStateName(DeviceState),<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerActionName(PowerAction));<br>
+<br>
+=C2=A0 =C2=A0 ASSERT3U(PowerAction, &lt; , PowerActionShutdown);<br>
+<br>
+=C2=A0 =C2=A0 if (DeviceState =3D=3D __FdoGetDevicePowerState(Fdo)) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 IoSkipCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D IoCallDriver(Fdo-&gt;LowerDeviceObj=
ect, Irp);<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
+=C2=A0 =C2=A0 }<br>
+<br>
+=C2=A0 =C2=A0 status =3D (DeviceState &lt; __FdoGetDevicePowerState(Fdo)) =
?<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 __FdoSetDevicePowerUp(Fdo, Irp) :<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 __FdoSetDevicePowerDown(Fdo, Irp);<br>
+<br>
+done:<br>
+=C2=A0 =C2=A0 Trace(&quot;&lt;=3D=3D=3D=3D (%s:%s)(%08x)\n&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerDeviceStateName(DeviceState),<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerActionName(PowerAction),<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status);<br>
+=C2=A0 =C2=A0 return status;<br>
+}<br>
+<br>
+static NTSTATUS<br>
+FdoDevicePower(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_THREAD=C2=A0 Self,<br>
+=C2=A0 =C2=A0 IN=C2=A0 PVOID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Conte=
xt<br>
+)<br>
+{<br>
+=C2=A0 =C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Fdo =3D (PXENHI=
D_FDO)Context;<br>
+=C2=A0 =C2=A0 PKEVENT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Event=
;<br>
+<br>
+=C2=A0 =C2=A0 Event =3D ThreadGetEvent(Self);<br>
+<br>
+=C2=A0 =C2=A0 for (;;) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PIRP=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 Irp;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PIO_STACK_LOCATION=C2=A0 StackLocation;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 UCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0MinorFunction;<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (Fdo-&gt;DevicePowerIrp =3D=3D NULL) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID)KeWaitForSingleObject(Even=
t,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Executive,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KernelMode,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FALSE,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KeClearEvent(Event);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ThreadIsAlerted(Self))<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Irp =3D Fdo-&gt;DevicePowerIrp;<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (Irp =3D=3D NULL)<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue;<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Fdo-&gt;DevicePowerIrp =3D NULL;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 KeMemoryBarrier();<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 StackLocation =3D IoGetCurrentIrpStackLocation=
(Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 MinorFunction =3D StackLocation-&gt;MinorFunct=
ion;<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 switch (StackLocation-&gt;MinorFunction) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 case IRP_MN_SET_POWER:<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID)__FdoSetDevicePower(Fdo, I=
rp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 default:<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ASSERT(FALSE);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
+=C2=A0 =C2=A0 }<br>
+<br>
+=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
+}<br>
+<br>
+static DECLSPEC_NOINLINE NTSTATUS<br>
+FdoDispatchPower(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0Fdo,<br>
+=C2=A0 =C2=A0 IN=C2=A0 PIRP=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Irp<b=
r>
+)<br>
+{<br>
+=C2=A0 =C2=A0 PIO_STACK_LOCATION=C2=A0 StackLocation;<br>
+=C2=A0 =C2=A0 UCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
MinorFunction;<br>
+=C2=A0 =C2=A0 POWER_STATE_TYPE=C2=A0 =C2=A0 PowerType;<br>
+=C2=A0 =C2=A0 POWER_ACTION=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerAction;<br>
+=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br=
>
+<br>
+=C2=A0 =C2=A0 StackLocation =3D IoGetCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 MinorFunction =3D StackLocation-&gt;MinorFunction;<br>
+<br>
+=C2=A0 =C2=A0 if (MinorFunction !=3D IRP_MN_SET_POWER) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 IoSkipCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D IoCallDriver(Fdo-&gt;LowerDeviceObj=
ect, Irp);<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
+=C2=A0 =C2=A0 }<br>
+<br>
+=C2=A0 =C2=A0 PowerType =3D StackLocation-&gt;Parameters.Power.Type;<br>
+=C2=A0 =C2=A0 PowerAction =3D StackLocation-&gt;Parameters.Power.ShutdownT=
ype;<br>
+<br>
+=C2=A0 =C2=A0 if (PowerAction &gt;=3D PowerActionShutdown) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 IoSkipCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D IoCallDriver(Fdo-&gt;LowerDeviceObj=
ect, Irp);<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
+=C2=A0 =C2=A0 }<br>
+<br>
+=C2=A0 =C2=A0 switch (PowerType) {<br>
+=C2=A0 =C2=A0 case DevicePowerState:<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 IoMarkIrpPending(Irp);<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 ASSERT3P(Fdo-&gt;DevicePowerIrp, =3D=3D, NULL)=
;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Fdo-&gt;DevicePowerIrp =3D Irp;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 KeMemoryBarrier();<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 ThreadWake(Fdo-&gt;DevicePowerThread);<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D STATUS_PENDING;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
+<br>
+=C2=A0 =C2=A0 case SystemPowerState:<br>
+=C2=A0 =C2=A0 default:<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 IoSkipCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D IoCallDriver(Fdo-&gt;LowerDeviceObj=
ect, Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
+=C2=A0 =C2=A0 }<br>
+<br>
+done:<br>
+=C2=A0 =C2=A0 return status;<br>
+}<br>
+<br>
=C2=A0static DECLSPEC_NOINLINE NTSTATUS<br>
=C2=A0FdoDispatchInternal(<br>
=C2=A0 =C2=A0 =C2=A0IN=C2=A0 PXENHID_FDO Fdo,<br>
@@ -1031,6 +1274,10 @@ FdoDispatch(<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D FdoDispatchPnp(Fdo, Irp);<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;<br>
<br>
+=C2=A0 =C2=A0 case IRP_MJ_POWER:<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D FdoDispatchPower(Fdo, Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
+<br>
=C2=A0 =C2=A0 =C2=A0default:<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D FdoDispatchDefault(Fdo, Irp);<=
br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;<br>
@@ -1118,6 +1365,11 @@ FdoCreate(<br>
<br>
=C2=A0 =C2=A0 =C2=A0Fdo-&gt;DeviceObject =3D DeviceObject;<br>
=C2=A0 =C2=A0 =C2=A0Fdo-&gt;LowerDeviceObject =3D LowerDeviceObject;<br>
+=C2=A0 =C2=A0 Fdo-&gt;DevicePowerState =3D PowerDeviceD3;<br>
+<br>
+=C2=A0 =C2=A0 status =3D ThreadCreate(FdoDevicePower, Fdo, &amp;Fdo-&gt;De=
vicePowerThread);<br>
+=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
<br>
=C2=A0 =C2=A0 =C2=A0InitializeListHead(&amp;Fdo-&gt;List);<br>
=C2=A0 =C2=A0 =C2=A0KeInitializeSpinLock(&amp;Fdo-&gt;Lock);<br>
@@ -1130,7 +1382,7 @@ FdoCreate(<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FdoCsqReleaseLock,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FdoCsqCompleteCanceledIrp);<br>
=C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
<br>
=C2=A0 =C2=A0 =C2=A0status =3D FdoQueryInterface(Fdo,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;GUID_XENBUS_SUSPEND_INTERFACE,<=
br>
@@ -1138,7 +1390,7 @@ FdoCreate(<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (PINTERFACE)&amp;Fdo-&gt;SuspendInte=
rface,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeof(XENBUS_SUSPEND_INTERFACE));<b=
r>
=C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
<br>
=C2=A0 =C2=A0 =C2=A0status =3D FdoQueryInterface(Fdo,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;GUID_XENBUS_STORE_INTERFACE,<br=
>
@@ -1146,7 +1398,7 @@ FdoCreate(<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (PINTERFACE)&amp;Fdo-&gt;StoreInterf=
ace,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeof(XENBUS_STORE_INTERFACE));<br>
=C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
<br>
=C2=A0 =C2=A0 =C2=A0status =3D FdoQueryInterface(Fdo,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;GUID_XENHID_HID_INTERFACE,<br>
@@ -1154,34 +1406,41 @@ FdoCreate(<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (PINTERFACE)&amp;Fdo-&gt;HidInterfac=
e,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeof(XENHID_HID_INTERFACE));<br>
=C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail5;<br>
<br>
=C2=A0 =C2=A0 =C2=A0Trace(&quot;&lt;=3D=3D=3D=3D=3D\n&quot;);<br>
=C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
<br>
-fail4:<br>
-=C2=A0 =C2=A0 Error(&quot;fail4\n&quot;);<br>
+fail5:<br>
+=C2=A0 =C2=A0 Error(&quot;fail5\n&quot;);<br>
<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;StoreInterface,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof=
(XENBUS_STORE_INTERFACE));<br>
<br>
-fail3:<br>
-=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
+fail4:<br>
+=C2=A0 =C2=A0 Error(&quot;fail4\n&quot;);<br>
<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;SuspendInterface,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof=
(XENBUS_SUSPEND_INTERFACE));<br>
<br>
-fail2:<br>
-=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
+fail3:<br>
+=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;Queue, sizeof(IO_CSQ));<br>
<br>
-fail1:<br>
-=C2=A0 =C2=A0 Error(&quot;fail1 %08x\n&quot;, status);<br>
+fail2:<br>
+=C2=A0 =C2=A0 Error(&quot;fail2 %08x\n&quot;, status);<br>
+<br>
+=C2=A0 =C2=A0 ThreadAlert(Fdo-&gt;DevicePowerThread);<br>
+=C2=A0 =C2=A0 ThreadJoin(Fdo-&gt;DevicePowerThread);<br>
+=C2=A0 =C2=A0 Fdo-&gt;DevicePowerThread =3D NULL;<br>
<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;List, sizeof(LIST_ENTRY));<b=
r>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;Lock, sizeof(KSPIN_LOCK));<b=
r>
<br>
+fail1:<br>
+=C2=A0 =C2=A0 Error(&quot;fail1 %08x\n&quot;, status);<br>
+<br>
=C2=A0 =C2=A0 =C2=A0Fdo-&gt;DeviceObject =3D NULL;<br>
=C2=A0 =C2=A0 =C2=A0Fdo-&gt;LowerDeviceObject =3D NULL;<br>
<br>
@@ -1202,6 +1461,13 @@ FdoDestroy(<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof=
(XENBUS_SUSPEND_INTERFACE));<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;StoreInterface,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof=
(XENBUS_STORE_INTERFACE));<br>
+<br>
+=C2=A0 =C2=A0 ThreadAlert(Fdo-&gt;DevicePowerThread);<br>
+=C2=A0 =C2=A0 ThreadJoin(Fdo-&gt;DevicePowerThread);<br>
+=C2=A0 =C2=A0 Fdo-&gt;DevicePowerThread =3D NULL;<br>
+=C2=A0 =C2=A0 Fdo-&gt;DevicePowerIrp =3D NULL;<br>
+=C2=A0 =C2=A0 Fdo-&gt;DevicePowerState =3D 0;<br>
+<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;Queue, sizeof(IO_CSQ));<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;List, sizeof(LIST_ENTRY));<b=
r>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;Lock, sizeof(KSPIN_LOCK));<b=
r>
diff --git a/vs2015/xenhid/xenhid.vcxproj b/vs2015/xenhid/xenhid.vcxproj<br=
>
index 35ba30f..e15b581 100644<br>
--- a/vs2015/xenhid/xenhid.vcxproj<br>
+++ b/vs2015/xenhid/xenhid.vcxproj<br>
@@ -53,6 +53,7 @@<br>
=C2=A0 =C2=A0&lt;ItemGroup&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/driver.c=
&quot; /&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/fdo.c&qu=
ot; /&gt;<br>
+=C2=A0 =C2=A0 &lt;ClCompile Include=3D&quot;../../src/xenhid/thread.c&quot=
; /&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/string.c=
&quot; /&gt;<br>
=C2=A0 =C2=A0&lt;/ItemGroup&gt;<br>
=C2=A0 =C2=A0&lt;ItemGroup&gt;<br>
diff --git a/vs2017/xenhid/xenhid.vcxproj b/vs2017/xenhid/xenhid.vcxproj<br=
>
index a113120..3ecd8d9 100644<br>
--- a/vs2017/xenhid/xenhid.vcxproj<br>
+++ b/vs2017/xenhid/xenhid.vcxproj<br>
@@ -61,6 +61,7 @@<br>
=C2=A0 =C2=A0&lt;ItemGroup&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/driver.c=
&quot; /&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/fdo.c&qu=
ot; /&gt;<br>
+=C2=A0 =C2=A0 &lt;ClCompile Include=3D&quot;../../src/xenhid/thread.c&quot=
; /&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/string.c=
&quot; /&gt;<br>
=C2=A0 =C2=A0&lt;/ItemGroup&gt;<br>
=C2=A0 =C2=A0&lt;ItemGroup&gt;<br>
diff --git a/vs2019/xenhid/xenhid.vcxproj b/vs2019/xenhid/xenhid.vcxproj<br=
>
index 996df2c..4573a59 100644<br>
--- a/vs2019/xenhid/xenhid.vcxproj<br>
+++ b/vs2019/xenhid/xenhid.vcxproj<br>
@@ -61,6 +61,7 @@<br>
=C2=A0 =C2=A0&lt;ItemGroup&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/driver.c=
&quot; /&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/fdo.c&qu=
ot; /&gt;<br>
+=C2=A0 =C2=A0 &lt;ClCompile Include=3D&quot;../../src/xenhid/thread.c&quot=
; /&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/string.c=
&quot; /&gt;<br>
=C2=A0 =C2=A0&lt;/ItemGroup&gt;<br>
=C2=A0 =C2=A0&lt;ItemGroup&gt;<br>
-- <br>
2.20.1<br>
<br>
</blockquote></div>

--000000000000fdbfdf05b19140da--


From win-pv-devel-bounces@lists.xenproject.org Tue Oct 13 18:12:20 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 13 Oct 2020 18:12:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6345.16894 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kSOmZ-0006d9-Pa; Tue, 13 Oct 2020 18:12:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6345.16894; Tue, 13 Oct 2020 18:12:19 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kSOmZ-0006d2-MG; Tue, 13 Oct 2020 18:12:19 +0000
Received: by outflank-mailman (input) for mailman id 6345;
 Tue, 13 Oct 2020 18:12:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=58E9=DU=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kSOmY-0006cI-BK
 for win-pv-devel@lists.xenproject.org; Tue, 13 Oct 2020 18:12:18 +0000
Received: from mail-ed1-x544.google.com (unknown [2a00:1450:4864:20::544])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6ce558c1-c56c-42f5-b104-8a3f2b8c7008;
 Tue, 13 Oct 2020 18:12:15 +0000 (UTC)
Received: by mail-ed1-x544.google.com with SMTP id cq12so464574edb.2
 for <win-pv-devel@lists.xenproject.org>; Tue, 13 Oct 2020 11:12:15 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=58E9=DU=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kSOmY-0006cI-BK
	for win-pv-devel@lists.xenproject.org; Tue, 13 Oct 2020 18:12:18 +0000
X-Inumbo-ID: 6ce558c1-c56c-42f5-b104-8a3f2b8c7008
Received: from mail-ed1-x544.google.com (unknown [2a00:1450:4864:20::544])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6ce558c1-c56c-42f5-b104-8a3f2b8c7008;
	Tue, 13 Oct 2020 18:12:15 +0000 (UTC)
Received: by mail-ed1-x544.google.com with SMTP id cq12so464574edb.2
        for <win-pv-devel@lists.xenproject.org>; Tue, 13 Oct 2020 11:12:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
        bh=kAUE+6t/KXjRmhrWQghbVAUgt17TN6ZEhvY9+FnXLPg=;
        b=TIUWy/1Zo8csHH5TneTkw0K+C1f6GPmyt/TlIeIxKUVKdwKi2zDMkm7zZN6KUktj7e
         GQ/XC4qf6d36Lo9vq/QpbXG+iKU7YqvCs2TLJo7T/PWOIylXcs82xI4K4lENvCmZJHx1
         zFMbJh0gk8QAJ2ZH/FurB8iCgLC4mlsBc8vhefduLSftYFV+3FpsTh6oVaChYRoyiNgJ
         BfgX4RhhWKUrrNS1hfz2CRh504GtZxTXAL95n7/3ky5cK5ibVXrrjSZk7+c7AOVXZvgo
         6AGx9KSi69tqqHmjFgArD4u5Nfia6MGBu0m6GzgV0UVyXOgEelQ3KPerghG4PsNbzd1X
         7osQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to;
        bh=kAUE+6t/KXjRmhrWQghbVAUgt17TN6ZEhvY9+FnXLPg=;
        b=SoyigtgzfVQ4+2uTTs4Nzwbax2gQdFH0KtCeNkXqKxzh9NilL52Xaya/qPfMjVq7qt
         fyekYIr3UPAQswwuBnU08FGBur+MOfC7wIjTC/rFcdpq0XsjqOXfTyve2THNkojiJBqe
         zP6Diuvoe4KDr381E+uXyKdtTKBfKp5UhzkKeGjWIa246kmGBhruA6TSXzC+6cmQa8S1
         BLY3fhSAh4MrgAg5k7p8dwnywP/yPJaXliKG4prLGsbV6PjjBsCSHzPv3NYOB8EATpJN
         nxYpvpx6asrv7WeIQNyDwYDP3b385zuzb/b8XgmUCJnNSMjb/mPMEnM0t2J8/SQWCKkT
         5+yg==
X-Gm-Message-State: AOAM5328yFg7HrD8tfOhYsyBX6vvOFDUK2rWXHn4y3ICb9wV+ZwpkhyF
	sAgBY+Q07WAKKqfLziiqeXxAFgpaADxHpZCk6TZAowev
X-Google-Smtp-Source: ABdhPJwgOacBXz3mpkGAa7kwYpT7Wm7wMc5V8E5b8LiFNJOFvbaZRT7e3qkiPXmGdOQ85BaU1EmmdExrWL5gWSoeqzg=
X-Received: by 2002:a05:6402:1c8f:: with SMTP id cy15mr800986edb.335.1602612734572;
 Tue, 13 Oct 2020 11:12:14 -0700 (PDT)
MIME-Version: 1.0
References: <a7ebc1503d2de6a683262d48b77cae5ca494594b.1602611090.git.troycrosley@gmail.com>
 <CAOBjErLCUUwB+o1WhpXNX6Xqj8Mv84+Y3uJWQ8cr0A2CTnmsJQ@mail.gmail.com>
In-Reply-To: <CAOBjErLCUUwB+o1WhpXNX6Xqj8Mv84+Y3uJWQ8cr0A2CTnmsJQ@mail.gmail.com>
From: Troy Crosley <troycrosley@gmail.com>
Date: Tue, 13 Oct 2020 14:12:03 -0400
Message-ID: <CAOBjEr+tt8enMBz3pDK7mCR4EpiV3kSuKByQUojez7Q_isg+1A@mail.gmail.com>
Subject: Re: [PATCH] Implement device power state transitions.
To: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000c1bb4605b1915a59"

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

ah, I forgot to include some files that were copied over. re-submitting

On Tue, Oct 13, 2020 at 2:04 PM Troy Crosley <troycrosley@gmail.com> wrote:

> I'm not sure to what extent hidclass handles power transitions, so this
> patch addresses only set power IRPs and passes down query and system power
> IRPs.
>
> On Tue, Oct 13, 2020 at 2:04 PM Troy Crosley <troycrosley@gmail.com>
> wrote:
>
>> Implement device power state transition boilerplate so that xenhid can
>> release its interfaces before the system enters S3. Let hidclass handle
>> other power IRP types.
>>
>> Signed-off-by: Troy Crosley <troycrosley@gmail.com>
>> ---
>>  src/xenhid/fdo.c             | 290 +++++++++++++++++++++++++++++++++--
>>  vs2015/xenhid/xenhid.vcxproj |   1 +
>>  vs2017/xenhid/xenhid.vcxproj |   1 +
>>  vs2019/xenhid/xenhid.vcxproj |   1 +
>>  4 files changed, 281 insertions(+), 12 deletions(-)
>>
>> diff --git a/src/xenhid/fdo.c b/src/xenhid/fdo.c
>> index 860c7bc..706fa33 100644
>> --- a/src/xenhid/fdo.c
>> +++ b/src/xenhid/fdo.c
>> @@ -41,10 +41,12 @@
>>  #include <suspend_interface.h>
>>
>>  #include "fdo.h"
>> +#include "thread.h"
>>  #include "driver.h"
>>  #include "dbg_print.h"
>>  #include "assert.h"
>>  #include "util.h"
>> +#include "names.h"
>>  #include "string.h"
>>
>>  #define MAXNAMELEN  128
>> @@ -52,6 +54,9 @@
>>  struct _XENHID_FDO {
>>      PDEVICE_OBJECT              DeviceObject;
>>      PDEVICE_OBJECT              LowerDeviceObject;
>> +    PXENHID_THREAD              DevicePowerThread;
>> +    PIRP                        DevicePowerIrp;
>> +    DEVICE_POWER_STATE          DevicePowerState;
>>      BOOLEAN                     Enabled;
>>      XENHID_HID_INTERFACE        HidInterface;
>>      XENBUS_STORE_INTERFACE      StoreInterface;
>> @@ -220,6 +225,23 @@ __FdoFree(
>>      ExFreePoolWithTag(Buffer, FDO_POOL_TAG);
>>  }
>>
>> +static FORCEINLINE VOID
>> +__FdoSetDevicePowerState(
>> +    IN  PXENHID_FDO         Fdo,
>> +    IN  DEVICE_POWER_STATE  State
>> +)
>> +{
>> +    Fdo->DevicePowerState = State;
>> +}
>> +
>> +static FORCEINLINE DEVICE_POWER_STATE
>> +__FdoGetDevicePowerState(
>> +    IN  PXENHID_FDO     Fdo
>> +)
>> +{
>> +    return Fdo->DevicePowerState;
>> +}
>> +
>>  static FORCEINLINE PANSI_STRING
>>  __FdoMultiSzToUpcaseAnsi(
>>      IN  PCHAR       Buffer
>> @@ -588,6 +610,8 @@ FdoD3ToD0(
>>  {
>>      NTSTATUS        status;
>>
>> +    ASSERT3U(__FdoGetDevicePowerState(Fdo), ==, PowerDeviceD3);
>> +
>>      Trace("=====>\n");
>>
>>      if (Fdo->Enabled)
>> @@ -621,6 +645,7 @@ FdoD3ToD0(
>>
>>      Fdo->Enabled = TRUE;
>>  done:
>> +    __FdoSetDevicePowerState(Fdo, PowerDeviceD0);
>>      Trace("<=====\n");
>>      return STATUS_SUCCESS;
>>
>> @@ -659,6 +684,8 @@ FdoD0ToD3(
>>  {
>>      Trace("=====>\n");
>>
>> +    __FdoSetDevicePowerState(Fdo, PowerDeviceD3);
>> +
>>      if (!Fdo->Enabled)
>>          goto done;
>>
>> @@ -868,6 +895,222 @@ FdoDispatchPnp(
>>      return status;
>>  }
>>
>> +static FORCEINLINE NTSTATUS
>> +__FdoSetDevicePowerUp(
>> +    IN  PXENHID_FDO     Fdo,
>> +    IN  PIRP            Irp
>> +)
>> +{
>> +    PIO_STACK_LOCATION  StackLocation;
>> +    DEVICE_POWER_STATE  DeviceState;
>> +    NTSTATUS            status;
>> +
>> +    Trace("====>\n");
>> +
>> +    StackLocation = IoGetCurrentIrpStackLocation(Irp);
>> +    DeviceState = StackLocation->Parameters.Power.State.DeviceState;
>> +
>> +    ASSERT3U(DeviceState, < , __FdoGetDevicePowerState(Fdo));
>> +
>> +    status = FdoForwardIrpSynchronously(Fdo, Irp);
>> +    if (!NT_SUCCESS(status))
>> +        goto done;
>> +
>> +    Info("%s -> %s\n",
>> +        PowerDeviceStateName(__FdoGetDevicePowerState(Fdo)),
>> +        PowerDeviceStateName(DeviceState));
>> +
>> +    ASSERT3U(DeviceState, ==, PowerDeviceD0);
>> +    status = FdoD3ToD0(Fdo);
>> +    ASSERT(NT_SUCCESS(status));
>> +
>> +done:
>> +    Irp->IoStatus.Status = status;
>> +    IoCompleteRequest(Irp, IO_NO_INCREMENT);
>> +
>> +    Trace("<==== (%08x)\n", status);
>> +    return status;
>> +}
>> +
>> +static FORCEINLINE NTSTATUS
>> +__FdoSetDevicePowerDown(
>> +    IN  PXENHID_FDO     Fdo,
>> +    IN  PIRP            Irp
>> +)
>> +{
>> +    PIO_STACK_LOCATION  StackLocation;
>> +    DEVICE_POWER_STATE  DeviceState;
>> +    NTSTATUS            status;
>> +
>> +    StackLocation = IoGetCurrentIrpStackLocation(Irp);
>> +    DeviceState = StackLocation->Parameters.Power.State.DeviceState;
>> +
>> +    ASSERT3U(DeviceState, > , __FdoGetDevicePowerState(Fdo));
>> +
>> +    Info("%s -> %s\n",
>> +        PowerDeviceStateName(__FdoGetDevicePowerState(Fdo)),
>> +        PowerDeviceStateName(DeviceState));
>> +
>> +    ASSERT3U(DeviceState, ==, PowerDeviceD3);
>> +
>> +    if (__FdoGetDevicePowerState(Fdo) == PowerDeviceD0)
>> +        FdoD0ToD3(Fdo);
>> +
>> +    IoSkipCurrentIrpStackLocation(Irp);
>> +    status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
>> +
>> +    return status;
>> +}
>> +
>> +static FORCEINLINE NTSTATUS
>> +__FdoSetDevicePower(
>> +    IN  PXENHID_FDO     Fdo,
>> +    IN  PIRP            Irp
>> +)
>> +{
>> +    PIO_STACK_LOCATION  StackLocation;
>> +    DEVICE_POWER_STATE  DeviceState;
>> +    POWER_ACTION        PowerAction;
>> +    NTSTATUS            status;
>> +
>> +    StackLocation = IoGetCurrentIrpStackLocation(Irp);
>> +    DeviceState = StackLocation->Parameters.Power.State.DeviceState;
>> +    PowerAction = StackLocation->Parameters.Power.ShutdownType;
>> +
>> +    Trace("====> (%s:%s)\n",
>> +        PowerDeviceStateName(DeviceState),
>> +        PowerActionName(PowerAction));
>> +
>> +    ASSERT3U(PowerAction, < , PowerActionShutdown);
>> +
>> +    if (DeviceState == __FdoGetDevicePowerState(Fdo)) {
>> +        IoSkipCurrentIrpStackLocation(Irp);
>> +        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
>> +
>> +        goto done;
>> +    }
>> +
>> +    status = (DeviceState < __FdoGetDevicePowerState(Fdo)) ?
>> +        __FdoSetDevicePowerUp(Fdo, Irp) :
>> +        __FdoSetDevicePowerDown(Fdo, Irp);
>> +
>> +done:
>> +    Trace("<==== (%s:%s)(%08x)\n",
>> +        PowerDeviceStateName(DeviceState),
>> +        PowerActionName(PowerAction),
>> +        status);
>> +    return status;
>> +}
>> +
>> +static NTSTATUS
>> +FdoDevicePower(
>> +    IN  PXENHID_THREAD  Self,
>> +    IN  PVOID           Context
>> +)
>> +{
>> +    PXENHID_FDO         Fdo = (PXENHID_FDO)Context;
>> +    PKEVENT             Event;
>> +
>> +    Event = ThreadGetEvent(Self);
>> +
>> +    for (;;) {
>> +        PIRP                Irp;
>> +        PIO_STACK_LOCATION  StackLocation;
>> +        UCHAR               MinorFunction;
>> +
>> +        if (Fdo->DevicePowerIrp == NULL) {
>> +            (VOID)KeWaitForSingleObject(Event,
>> +                Executive,
>> +                KernelMode,
>> +                FALSE,
>> +                NULL);
>> +            KeClearEvent(Event);
>> +        }
>> +
>> +        if (ThreadIsAlerted(Self))
>> +            break;
>> +
>> +        Irp = Fdo->DevicePowerIrp;
>> +
>> +        if (Irp == NULL)
>> +            continue;
>> +
>> +        Fdo->DevicePowerIrp = NULL;
>> +        KeMemoryBarrier();
>> +
>> +        StackLocation = IoGetCurrentIrpStackLocation(Irp);
>> +        MinorFunction = StackLocation->MinorFunction;
>> +
>> +        switch (StackLocation->MinorFunction) {
>> +        case IRP_MN_SET_POWER:
>> +            (VOID)__FdoSetDevicePower(Fdo, Irp);
>> +            break;
>> +
>> +        default:
>> +            ASSERT(FALSE);
>> +            break;
>> +        }
>> +    }
>> +
>> +    return STATUS_SUCCESS;
>> +}
>> +
>> +static DECLSPEC_NOINLINE NTSTATUS
>> +FdoDispatchPower(
>> +    IN  PXENHID_FDO     Fdo,
>> +    IN  PIRP            Irp
>> +)
>> +{
>> +    PIO_STACK_LOCATION  StackLocation;
>> +    UCHAR               MinorFunction;
>> +    POWER_STATE_TYPE    PowerType;
>> +    POWER_ACTION        PowerAction;
>> +    NTSTATUS            status;
>> +
>> +    StackLocation = IoGetCurrentIrpStackLocation(Irp);
>> +    MinorFunction = StackLocation->MinorFunction;
>> +
>> +    if (MinorFunction != IRP_MN_SET_POWER) {
>> +        IoSkipCurrentIrpStackLocation(Irp);
>> +        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
>> +
>> +        goto done;
>> +    }
>> +
>> +    PowerType = StackLocation->Parameters.Power.Type;
>> +    PowerAction = StackLocation->Parameters.Power.ShutdownType;
>> +
>> +    if (PowerAction >= PowerActionShutdown) {
>> +        IoSkipCurrentIrpStackLocation(Irp);
>> +        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
>> +
>> +        goto done;
>> +    }
>> +
>> +    switch (PowerType) {
>> +    case DevicePowerState:
>> +        IoMarkIrpPending(Irp);
>> +
>> +        ASSERT3P(Fdo->DevicePowerIrp, ==, NULL);
>> +        Fdo->DevicePowerIrp = Irp;
>> +        KeMemoryBarrier();
>> +
>> +        ThreadWake(Fdo->DevicePowerThread);
>> +
>> +        status = STATUS_PENDING;
>> +        break;
>> +
>> +    case SystemPowerState:
>> +    default:
>> +        IoSkipCurrentIrpStackLocation(Irp);
>> +        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
>> +        break;
>> +    }
>> +
>> +done:
>> +    return status;
>> +}
>> +
>>  static DECLSPEC_NOINLINE NTSTATUS
>>  FdoDispatchInternal(
>>      IN  PXENHID_FDO Fdo,
>> @@ -1031,6 +1274,10 @@ FdoDispatch(
>>          status = FdoDispatchPnp(Fdo, Irp);
>>          break;
>>
>> +    case IRP_MJ_POWER:
>> +        status = FdoDispatchPower(Fdo, Irp);
>> +        break;
>> +
>>      default:
>>          status = FdoDispatchDefault(Fdo, Irp);
>>          break;
>> @@ -1118,6 +1365,11 @@ FdoCreate(
>>
>>      Fdo->DeviceObject = DeviceObject;
>>      Fdo->LowerDeviceObject = LowerDeviceObject;
>> +    Fdo->DevicePowerState = PowerDeviceD3;
>> +
>> +    status = ThreadCreate(FdoDevicePower, Fdo, &Fdo->DevicePowerThread);
>> +    if (!NT_SUCCESS(status))
>> +        goto fail1;
>>
>>      InitializeListHead(&Fdo->List);
>>      KeInitializeSpinLock(&Fdo->Lock);
>> @@ -1130,7 +1382,7 @@ FdoCreate(
>>                               FdoCsqReleaseLock,
>>                               FdoCsqCompleteCanceledIrp);
>>      if (!NT_SUCCESS(status))
>> -        goto fail1;
>> +        goto fail2;
>>
>>      status = FdoQueryInterface(Fdo,
>>                                 &GUID_XENBUS_SUSPEND_INTERFACE,
>> @@ -1138,7 +1390,7 @@ FdoCreate(
>>                                 (PINTERFACE)&Fdo->SuspendInterface,
>>                                 sizeof(XENBUS_SUSPEND_INTERFACE));
>>      if (!NT_SUCCESS(status))
>> -        goto fail2;
>> +        goto fail3;
>>
>>      status = FdoQueryInterface(Fdo,
>>                                 &GUID_XENBUS_STORE_INTERFACE,
>> @@ -1146,7 +1398,7 @@ FdoCreate(
>>                                 (PINTERFACE)&Fdo->StoreInterface,
>>                                 sizeof(XENBUS_STORE_INTERFACE));
>>      if (!NT_SUCCESS(status))
>> -        goto fail3;
>> +        goto fail4;
>>
>>      status = FdoQueryInterface(Fdo,
>>                                 &GUID_XENHID_HID_INTERFACE,
>> @@ -1154,34 +1406,41 @@ FdoCreate(
>>                                 (PINTERFACE)&Fdo->HidInterface,
>>                                 sizeof(XENHID_HID_INTERFACE));
>>      if (!NT_SUCCESS(status))
>> -        goto fail4;
>> +        goto fail5;
>>
>>      Trace("<=====\n");
>>      return STATUS_SUCCESS;
>>
>> -fail4:
>> -    Error("fail4\n");
>> +fail5:
>> +    Error("fail5\n");
>>
>>      RtlZeroMemory(&Fdo->StoreInterface,
>>                    sizeof(XENBUS_STORE_INTERFACE));
>>
>> -fail3:
>> -    Error("fail3\n");
>> +fail4:
>> +    Error("fail4\n");
>>
>>      RtlZeroMemory(&Fdo->SuspendInterface,
>>                    sizeof(XENBUS_SUSPEND_INTERFACE));
>>
>> -fail2:
>> -    Error("fail2\n");
>> +fail3:
>> +    Error("fail3\n");
>>
>>      RtlZeroMemory(&Fdo->Queue, sizeof(IO_CSQ));
>>
>> -fail1:
>> -    Error("fail1 %08x\n", status);
>> +fail2:
>> +    Error("fail2 %08x\n", status);
>> +
>> +    ThreadAlert(Fdo->DevicePowerThread);
>> +    ThreadJoin(Fdo->DevicePowerThread);
>> +    Fdo->DevicePowerThread = NULL;
>>
>>      RtlZeroMemory(&Fdo->List, sizeof(LIST_ENTRY));
>>      RtlZeroMemory(&Fdo->Lock, sizeof(KSPIN_LOCK));
>>
>> +fail1:
>> +    Error("fail1 %08x\n", status);
>> +
>>      Fdo->DeviceObject = NULL;
>>      Fdo->LowerDeviceObject = NULL;
>>
>> @@ -1202,6 +1461,13 @@ FdoDestroy(
>>                    sizeof(XENBUS_SUSPEND_INTERFACE));
>>      RtlZeroMemory(&Fdo->StoreInterface,
>>                    sizeof(XENBUS_STORE_INTERFACE));
>> +
>> +    ThreadAlert(Fdo->DevicePowerThread);
>> +    ThreadJoin(Fdo->DevicePowerThread);
>> +    Fdo->DevicePowerThread = NULL;
>> +    Fdo->DevicePowerIrp = NULL;
>> +    Fdo->DevicePowerState = 0;
>> +
>>      RtlZeroMemory(&Fdo->Queue, sizeof(IO_CSQ));
>>      RtlZeroMemory(&Fdo->List, sizeof(LIST_ENTRY));
>>      RtlZeroMemory(&Fdo->Lock, sizeof(KSPIN_LOCK));
>> diff --git a/vs2015/xenhid/xenhid.vcxproj b/vs2015/xenhid/xenhid.vcxproj
>> index 35ba30f..e15b581 100644
>> --- a/vs2015/xenhid/xenhid.vcxproj
>> +++ b/vs2015/xenhid/xenhid.vcxproj
>> @@ -53,6 +53,7 @@
>>    <ItemGroup>
>>      <ClCompile Include="../../src/xenhid/driver.c" />
>>      <ClCompile Include="../../src/xenhid/fdo.c" />
>> +    <ClCompile Include="../../src/xenhid/thread.c" />
>>      <ClCompile Include="../../src/xenhid/string.c" />
>>    </ItemGroup>
>>    <ItemGroup>
>> diff --git a/vs2017/xenhid/xenhid.vcxproj b/vs2017/xenhid/xenhid.vcxproj
>> index a113120..3ecd8d9 100644
>> --- a/vs2017/xenhid/xenhid.vcxproj
>> +++ b/vs2017/xenhid/xenhid.vcxproj
>> @@ -61,6 +61,7 @@
>>    <ItemGroup>
>>      <ClCompile Include="../../src/xenhid/driver.c" />
>>      <ClCompile Include="../../src/xenhid/fdo.c" />
>> +    <ClCompile Include="../../src/xenhid/thread.c" />
>>      <ClCompile Include="../../src/xenhid/string.c" />
>>    </ItemGroup>
>>    <ItemGroup>
>> diff --git a/vs2019/xenhid/xenhid.vcxproj b/vs2019/xenhid/xenhid.vcxproj
>> index 996df2c..4573a59 100644
>> --- a/vs2019/xenhid/xenhid.vcxproj
>> +++ b/vs2019/xenhid/xenhid.vcxproj
>> @@ -61,6 +61,7 @@
>>    <ItemGroup>
>>      <ClCompile Include="../../src/xenhid/driver.c" />
>>      <ClCompile Include="../../src/xenhid/fdo.c" />
>> +    <ClCompile Include="../../src/xenhid/thread.c" />
>>      <ClCompile Include="../../src/xenhid/string.c" />
>>    </ItemGroup>
>>    <ItemGroup>
>> --
>> 2.20.1
>>
>>

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

<div dir=3D"ltr">ah, I forgot to include some files that were copied over. =
re-submitting</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D=
"gmail_attr">On Tue, Oct 13, 2020 at 2:04 PM Troy Crosley &lt;<a href=3D"ma=
ilto:troycrosley@gmail.com">troycrosley@gmail.com</a>&gt; wrote:<br></div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">I&#39;m n=
ot sure to what extent hidclass handles power transitions, so this patch ad=
dresses only set power IRPs and passes down query and system power IRPs.<br=
></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr"=
>On Tue, Oct 13, 2020 at 2:04 PM Troy Crosley &lt;<a href=3D"mailto:troycro=
sley@gmail.com" target=3D"_blank">troycrosley@gmail.com</a>&gt; wrote:<br><=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo=
rder-left:1px solid rgb(204,204,204);padding-left:1ex">Implement device pow=
er state transition boilerplate so that xenhid can<br>
release its interfaces before the system enters S3. Let hidclass handle<br>
other power IRP types.<br>
<br>
Signed-off-by: Troy Crosley &lt;<a href=3D"mailto:troycrosley@gmail.com" ta=
rget=3D"_blank">troycrosley@gmail.com</a>&gt;<br>
---<br>
=C2=A0src/xenhid/fdo.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 290=
 +++++++++++++++++++++++++++++++++--<br>
=C2=A0vs2015/xenhid/xenhid.vcxproj |=C2=A0 =C2=A01 +<br>
=C2=A0vs2017/xenhid/xenhid.vcxproj |=C2=A0 =C2=A01 +<br>
=C2=A0vs2019/xenhid/xenhid.vcxproj |=C2=A0 =C2=A01 +<br>
=C2=A04 files changed, 281 insertions(+), 12 deletions(-)<br>
<br>
diff --git a/src/xenhid/fdo.c b/src/xenhid/fdo.c<br>
index 860c7bc..706fa33 100644<br>
--- a/src/xenhid/fdo.c<br>
+++ b/src/xenhid/fdo.c<br>
@@ -41,10 +41,12 @@<br>
=C2=A0#include &lt;suspend_interface.h&gt;<br>
<br>
=C2=A0#include &quot;fdo.h&quot;<br>
+#include &quot;thread.h&quot;<br>
=C2=A0#include &quot;driver.h&quot;<br>
=C2=A0#include &quot;dbg_print.h&quot;<br>
=C2=A0#include &quot;assert.h&quot;<br>
=C2=A0#include &quot;util.h&quot;<br>
+#include &quot;names.h&quot;<br>
=C2=A0#include &quot;string.h&quot;<br>
<br>
=C2=A0#define MAXNAMELEN=C2=A0 128<br>
@@ -52,6 +54,9 @@<br>
=C2=A0struct _XENHID_FDO {<br>
=C2=A0 =C2=A0 =C2=A0PDEVICE_OBJECT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 DeviceObject;<br>
=C2=A0 =C2=A0 =C2=A0PDEVICE_OBJECT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 LowerDeviceObject;<br>
+=C2=A0 =C2=A0 PXENHID_THREAD=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 DevicePowerThread;<br>
+=C2=A0 =C2=A0 PIRP=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 DevicePowerIrp;<br>
+=C2=A0 =C2=A0 DEVICE_POWER_STATE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DeviceP=
owerState;<br>
=C2=A0 =C2=A0 =C2=A0BOOLEAN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0Enabled;<br>
=C2=A0 =C2=A0 =C2=A0XENHID_HID_INTERFACE=C2=A0 =C2=A0 =C2=A0 =C2=A0 HidInte=
rface;<br>
=C2=A0 =C2=A0 =C2=A0XENBUS_STORE_INTERFACE=C2=A0 =C2=A0 =C2=A0 StoreInterfa=
ce;<br>
@@ -220,6 +225,23 @@ __FdoFree(<br>
=C2=A0 =C2=A0 =C2=A0ExFreePoolWithTag(Buffer, FDO_POOL_TAG);<br>
=C2=A0}<br>
<br>
+static FORCEINLINE VOID<br>
+__FdoSetDevicePowerState(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Fdo,<b=
r>
+=C2=A0 =C2=A0 IN=C2=A0 DEVICE_POWER_STATE=C2=A0 State<br>
+)<br>
+{<br>
+=C2=A0 =C2=A0 Fdo-&gt;DevicePowerState =3D State;<br>
+}<br>
+<br>
+static FORCEINLINE DEVICE_POWER_STATE<br>
+__FdoGetDevicePowerState(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0Fdo<br>
+)<br>
+{<br>
+=C2=A0 =C2=A0 return Fdo-&gt;DevicePowerState;<br>
+}<br>
+<br>
=C2=A0static FORCEINLINE PANSI_STRING<br>
=C2=A0__FdoMultiSzToUpcaseAnsi(<br>
=C2=A0 =C2=A0 =C2=A0IN=C2=A0 PCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0Buffer<br>
@@ -588,6 +610,8 @@ FdoD3ToD0(<br>
=C2=A0{<br>
=C2=A0 =C2=A0 =C2=A0NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br>
<br>
+=C2=A0 =C2=A0 ASSERT3U(__FdoGetDevicePowerState(Fdo), =3D=3D, PowerDeviceD=
3);<br>
+<br>
=C2=A0 =C2=A0 =C2=A0Trace(&quot;=3D=3D=3D=3D=3D&gt;\n&quot;);<br>
<br>
=C2=A0 =C2=A0 =C2=A0if (Fdo-&gt;Enabled)<br>
@@ -621,6 +645,7 @@ FdoD3ToD0(<br>
<br>
=C2=A0 =C2=A0 =C2=A0Fdo-&gt;Enabled =3D TRUE;<br>
=C2=A0done:<br>
+=C2=A0 =C2=A0 __FdoSetDevicePowerState(Fdo, PowerDeviceD0);<br>
=C2=A0 =C2=A0 =C2=A0Trace(&quot;&lt;=3D=3D=3D=3D=3D\n&quot;);<br>
=C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
<br>
@@ -659,6 +684,8 @@ FdoD0ToD3(<br>
=C2=A0{<br>
=C2=A0 =C2=A0 =C2=A0Trace(&quot;=3D=3D=3D=3D=3D&gt;\n&quot;);<br>
<br>
+=C2=A0 =C2=A0 __FdoSetDevicePowerState(Fdo, PowerDeviceD3);<br>
+<br>
=C2=A0 =C2=A0 =C2=A0if (!Fdo-&gt;Enabled)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto done;<br>
<br>
@@ -868,6 +895,222 @@ FdoDispatchPnp(<br>
=C2=A0 =C2=A0 =C2=A0return status;<br>
=C2=A0}<br>
<br>
+static FORCEINLINE NTSTATUS<br>
+__FdoSetDevicePowerUp(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0Fdo,<br>
+=C2=A0 =C2=A0 IN=C2=A0 PIRP=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Irp<b=
r>
+)<br>
+{<br>
+=C2=A0 =C2=A0 PIO_STACK_LOCATION=C2=A0 StackLocation;<br>
+=C2=A0 =C2=A0 DEVICE_POWER_STATE=C2=A0 DeviceState;<br>
+=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br=
>
+<br>
+=C2=A0 =C2=A0 Trace(&quot;=3D=3D=3D=3D&gt;\n&quot;);<br>
+<br>
+=C2=A0 =C2=A0 StackLocation =3D IoGetCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 DeviceState =3D StackLocation-&gt;Parameters.Power.State.Dev=
iceState;<br>
+<br>
+=C2=A0 =C2=A0 ASSERT3U(DeviceState, &lt; , __FdoGetDevicePowerState(Fdo));=
<br>
+<br>
+=C2=A0 =C2=A0 status =3D FdoForwardIrpSynchronously(Fdo, Irp);<br>
+=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
+<br>
+=C2=A0 =C2=A0 Info(&quot;%s -&gt; %s\n&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerDeviceStateName(__FdoGetDevicePowerState(=
Fdo)),<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerDeviceStateName(DeviceState));<br>
+<br>
+=C2=A0 =C2=A0 ASSERT3U(DeviceState, =3D=3D, PowerDeviceD0);<br>
+=C2=A0 =C2=A0 status =3D FdoD3ToD0(Fdo);<br>
+=C2=A0 =C2=A0 ASSERT(NT_SUCCESS(status));<br>
+<br>
+done:<br>
+=C2=A0 =C2=A0 Irp-&gt;IoStatus.Status =3D status;<br>
+=C2=A0 =C2=A0 IoCompleteRequest(Irp, IO_NO_INCREMENT);<br>
+<br>
+=C2=A0 =C2=A0 Trace(&quot;&lt;=3D=3D=3D=3D (%08x)\n&quot;, status);<br>
+=C2=A0 =C2=A0 return status;<br>
+}<br>
+<br>
+static FORCEINLINE NTSTATUS<br>
+__FdoSetDevicePowerDown(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0Fdo,<br>
+=C2=A0 =C2=A0 IN=C2=A0 PIRP=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Irp<b=
r>
+)<br>
+{<br>
+=C2=A0 =C2=A0 PIO_STACK_LOCATION=C2=A0 StackLocation;<br>
+=C2=A0 =C2=A0 DEVICE_POWER_STATE=C2=A0 DeviceState;<br>
+=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br=
>
+<br>
+=C2=A0 =C2=A0 StackLocation =3D IoGetCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 DeviceState =3D StackLocation-&gt;Parameters.Power.State.Dev=
iceState;<br>
+<br>
+=C2=A0 =C2=A0 ASSERT3U(DeviceState, &gt; , __FdoGetDevicePowerState(Fdo));=
<br>
+<br>
+=C2=A0 =C2=A0 Info(&quot;%s -&gt; %s\n&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerDeviceStateName(__FdoGetDevicePowerState(=
Fdo)),<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerDeviceStateName(DeviceState));<br>
+<br>
+=C2=A0 =C2=A0 ASSERT3U(DeviceState, =3D=3D, PowerDeviceD3);<br>
+<br>
+=C2=A0 =C2=A0 if (__FdoGetDevicePowerState(Fdo) =3D=3D PowerDeviceD0)<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 FdoD0ToD3(Fdo);<br>
+<br>
+=C2=A0 =C2=A0 IoSkipCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 status =3D IoCallDriver(Fdo-&gt;LowerDeviceObject, Irp);<br>
+<br>
+=C2=A0 =C2=A0 return status;<br>
+}<br>
+<br>
+static FORCEINLINE NTSTATUS<br>
+__FdoSetDevicePower(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0Fdo,<br>
+=C2=A0 =C2=A0 IN=C2=A0 PIRP=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Irp<b=
r>
+)<br>
+{<br>
+=C2=A0 =C2=A0 PIO_STACK_LOCATION=C2=A0 StackLocation;<br>
+=C2=A0 =C2=A0 DEVICE_POWER_STATE=C2=A0 DeviceState;<br>
+=C2=A0 =C2=A0 POWER_ACTION=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerAction;<br>
+=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br=
>
+<br>
+=C2=A0 =C2=A0 StackLocation =3D IoGetCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 DeviceState =3D StackLocation-&gt;Parameters.Power.State.Dev=
iceState;<br>
+=C2=A0 =C2=A0 PowerAction =3D StackLocation-&gt;Parameters.Power.ShutdownT=
ype;<br>
+<br>
+=C2=A0 =C2=A0 Trace(&quot;=3D=3D=3D=3D&gt; (%s:%s)\n&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerDeviceStateName(DeviceState),<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerActionName(PowerAction));<br>
+<br>
+=C2=A0 =C2=A0 ASSERT3U(PowerAction, &lt; , PowerActionShutdown);<br>
+<br>
+=C2=A0 =C2=A0 if (DeviceState =3D=3D __FdoGetDevicePowerState(Fdo)) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 IoSkipCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D IoCallDriver(Fdo-&gt;LowerDeviceObj=
ect, Irp);<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
+=C2=A0 =C2=A0 }<br>
+<br>
+=C2=A0 =C2=A0 status =3D (DeviceState &lt; __FdoGetDevicePowerState(Fdo)) =
?<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 __FdoSetDevicePowerUp(Fdo, Irp) :<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 __FdoSetDevicePowerDown(Fdo, Irp);<br>
+<br>
+done:<br>
+=C2=A0 =C2=A0 Trace(&quot;&lt;=3D=3D=3D=3D (%s:%s)(%08x)\n&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerDeviceStateName(DeviceState),<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerActionName(PowerAction),<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status);<br>
+=C2=A0 =C2=A0 return status;<br>
+}<br>
+<br>
+static NTSTATUS<br>
+FdoDevicePower(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_THREAD=C2=A0 Self,<br>
+=C2=A0 =C2=A0 IN=C2=A0 PVOID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Conte=
xt<br>
+)<br>
+{<br>
+=C2=A0 =C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Fdo =3D (PXENHI=
D_FDO)Context;<br>
+=C2=A0 =C2=A0 PKEVENT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Event=
;<br>
+<br>
+=C2=A0 =C2=A0 Event =3D ThreadGetEvent(Self);<br>
+<br>
+=C2=A0 =C2=A0 for (;;) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PIRP=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 Irp;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 PIO_STACK_LOCATION=C2=A0 StackLocation;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 UCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0MinorFunction;<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (Fdo-&gt;DevicePowerIrp =3D=3D NULL) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID)KeWaitForSingleObject(Even=
t,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Executive,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KernelMode,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FALSE,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KeClearEvent(Event);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ThreadIsAlerted(Self))<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Irp =3D Fdo-&gt;DevicePowerIrp;<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (Irp =3D=3D NULL)<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue;<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Fdo-&gt;DevicePowerIrp =3D NULL;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 KeMemoryBarrier();<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 StackLocation =3D IoGetCurrentIrpStackLocation=
(Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 MinorFunction =3D StackLocation-&gt;MinorFunct=
ion;<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 switch (StackLocation-&gt;MinorFunction) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 case IRP_MN_SET_POWER:<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID)__FdoSetDevicePower(Fdo, I=
rp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 default:<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ASSERT(FALSE);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
+=C2=A0 =C2=A0 }<br>
+<br>
+=C2=A0 =C2=A0 return STATUS_SUCCESS;<br>
+}<br>
+<br>
+static DECLSPEC_NOINLINE NTSTATUS<br>
+FdoDispatchPower(<br>
+=C2=A0 =C2=A0 IN=C2=A0 PXENHID_FDO=C2=A0 =C2=A0 =C2=A0Fdo,<br>
+=C2=A0 =C2=A0 IN=C2=A0 PIRP=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Irp<b=
r>
+)<br>
+{<br>
+=C2=A0 =C2=A0 PIO_STACK_LOCATION=C2=A0 StackLocation;<br>
+=C2=A0 =C2=A0 UCHAR=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
MinorFunction;<br>
+=C2=A0 =C2=A0 POWER_STATE_TYPE=C2=A0 =C2=A0 PowerType;<br>
+=C2=A0 =C2=A0 POWER_ACTION=C2=A0 =C2=A0 =C2=A0 =C2=A0 PowerAction;<br>
+=C2=A0 =C2=A0 NTSTATUS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 status;<br=
>
+<br>
+=C2=A0 =C2=A0 StackLocation =3D IoGetCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 MinorFunction =3D StackLocation-&gt;MinorFunction;<br>
+<br>
+=C2=A0 =C2=A0 if (MinorFunction !=3D IRP_MN_SET_POWER) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 IoSkipCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D IoCallDriver(Fdo-&gt;LowerDeviceObj=
ect, Irp);<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
+=C2=A0 =C2=A0 }<br>
+<br>
+=C2=A0 =C2=A0 PowerType =3D StackLocation-&gt;Parameters.Power.Type;<br>
+=C2=A0 =C2=A0 PowerAction =3D StackLocation-&gt;Parameters.Power.ShutdownT=
ype;<br>
+<br>
+=C2=A0 =C2=A0 if (PowerAction &gt;=3D PowerActionShutdown) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 IoSkipCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D IoCallDriver(Fdo-&gt;LowerDeviceObj=
ect, Irp);<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto done;<br>
+=C2=A0 =C2=A0 }<br>
+<br>
+=C2=A0 =C2=A0 switch (PowerType) {<br>
+=C2=A0 =C2=A0 case DevicePowerState:<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 IoMarkIrpPending(Irp);<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 ASSERT3P(Fdo-&gt;DevicePowerIrp, =3D=3D, NULL)=
;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Fdo-&gt;DevicePowerIrp =3D Irp;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 KeMemoryBarrier();<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 ThreadWake(Fdo-&gt;DevicePowerThread);<br>
+<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D STATUS_PENDING;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
+<br>
+=C2=A0 =C2=A0 case SystemPowerState:<br>
+=C2=A0 =C2=A0 default:<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 IoSkipCurrentIrpStackLocation(Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D IoCallDriver(Fdo-&gt;LowerDeviceObj=
ect, Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
+=C2=A0 =C2=A0 }<br>
+<br>
+done:<br>
+=C2=A0 =C2=A0 return status;<br>
+}<br>
+<br>
=C2=A0static DECLSPEC_NOINLINE NTSTATUS<br>
=C2=A0FdoDispatchInternal(<br>
=C2=A0 =C2=A0 =C2=A0IN=C2=A0 PXENHID_FDO Fdo,<br>
@@ -1031,6 +1274,10 @@ FdoDispatch(<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D FdoDispatchPnp(Fdo, Irp);<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;<br>
<br>
+=C2=A0 =C2=A0 case IRP_MJ_POWER:<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 status =3D FdoDispatchPower(Fdo, Irp);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
+<br>
=C2=A0 =C2=A0 =C2=A0default:<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D FdoDispatchDefault(Fdo, Irp);<=
br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;<br>
@@ -1118,6 +1365,11 @@ FdoCreate(<br>
<br>
=C2=A0 =C2=A0 =C2=A0Fdo-&gt;DeviceObject =3D DeviceObject;<br>
=C2=A0 =C2=A0 =C2=A0Fdo-&gt;LowerDeviceObject =3D LowerDeviceObject;<br>
+=C2=A0 =C2=A0 Fdo-&gt;DevicePowerState =3D PowerDeviceD3;<br>
+<br>
+=C2=A0 =C2=A0 status =3D ThreadCreate(FdoDevicePower, Fdo, &amp;Fdo-&gt;De=
vicePowerThread);<br>
+=C2=A0 =C2=A0 if (!NT_SUCCESS(status))<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
<br>
=C2=A0 =C2=A0 =C2=A0InitializeListHead(&amp;Fdo-&gt;List);<br>
=C2=A0 =C2=A0 =C2=A0KeInitializeSpinLock(&amp;Fdo-&gt;Lock);<br>
@@ -1130,7 +1382,7 @@ FdoCreate(<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FdoCsqReleaseLock,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FdoCsqCompleteCanceledIrp);<br>
=C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail1;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
<br>
=C2=A0 =C2=A0 =C2=A0status =3D FdoQueryInterface(Fdo,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;GUID_XENBUS_SUSPEND_INTERFACE,<=
br>
@@ -1138,7 +1390,7 @@ FdoCreate(<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (PINTERFACE)&amp;Fdo-&gt;SuspendInte=
rface,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeof(XENBUS_SUSPEND_INTERFACE));<b=
r>
=C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail2;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
<br>
=C2=A0 =C2=A0 =C2=A0status =3D FdoQueryInterface(Fdo,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;GUID_XENBUS_STORE_INTERFACE,<br=
>
@@ -1146,7 +1398,7 @@ FdoCreate(<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (PINTERFACE)&amp;Fdo-&gt;StoreInterf=
ace,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeof(XENBUS_STORE_INTERFACE));<br>
=C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail3;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
<br>
=C2=A0 =C2=A0 =C2=A0status =3D FdoQueryInterface(Fdo,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &amp;GUID_XENHID_HID_INTERFACE,<br>
@@ -1154,34 +1406,41 @@ FdoCreate(<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (PINTERFACE)&amp;Fdo-&gt;HidInterfac=
e,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeof(XENHID_HID_INTERFACE));<br>
=C2=A0 =C2=A0 =C2=A0if (!NT_SUCCESS(status))<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail4;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto fail5;<br>
<br>
=C2=A0 =C2=A0 =C2=A0Trace(&quot;&lt;=3D=3D=3D=3D=3D\n&quot;);<br>
=C2=A0 =C2=A0 =C2=A0return STATUS_SUCCESS;<br>
<br>
-fail4:<br>
-=C2=A0 =C2=A0 Error(&quot;fail4\n&quot;);<br>
+fail5:<br>
+=C2=A0 =C2=A0 Error(&quot;fail5\n&quot;);<br>
<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;StoreInterface,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof=
(XENBUS_STORE_INTERFACE));<br>
<br>
-fail3:<br>
-=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
+fail4:<br>
+=C2=A0 =C2=A0 Error(&quot;fail4\n&quot;);<br>
<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;SuspendInterface,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof=
(XENBUS_SUSPEND_INTERFACE));<br>
<br>
-fail2:<br>
-=C2=A0 =C2=A0 Error(&quot;fail2\n&quot;);<br>
+fail3:<br>
+=C2=A0 =C2=A0 Error(&quot;fail3\n&quot;);<br>
<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;Queue, sizeof(IO_CSQ));<br>
<br>
-fail1:<br>
-=C2=A0 =C2=A0 Error(&quot;fail1 %08x\n&quot;, status);<br>
+fail2:<br>
+=C2=A0 =C2=A0 Error(&quot;fail2 %08x\n&quot;, status);<br>
+<br>
+=C2=A0 =C2=A0 ThreadAlert(Fdo-&gt;DevicePowerThread);<br>
+=C2=A0 =C2=A0 ThreadJoin(Fdo-&gt;DevicePowerThread);<br>
+=C2=A0 =C2=A0 Fdo-&gt;DevicePowerThread =3D NULL;<br>
<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;List, sizeof(LIST_ENTRY));<b=
r>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;Lock, sizeof(KSPIN_LOCK));<b=
r>
<br>
+fail1:<br>
+=C2=A0 =C2=A0 Error(&quot;fail1 %08x\n&quot;, status);<br>
+<br>
=C2=A0 =C2=A0 =C2=A0Fdo-&gt;DeviceObject =3D NULL;<br>
=C2=A0 =C2=A0 =C2=A0Fdo-&gt;LowerDeviceObject =3D NULL;<br>
<br>
@@ -1202,6 +1461,13 @@ FdoDestroy(<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof=
(XENBUS_SUSPEND_INTERFACE));<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;StoreInterface,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof=
(XENBUS_STORE_INTERFACE));<br>
+<br>
+=C2=A0 =C2=A0 ThreadAlert(Fdo-&gt;DevicePowerThread);<br>
+=C2=A0 =C2=A0 ThreadJoin(Fdo-&gt;DevicePowerThread);<br>
+=C2=A0 =C2=A0 Fdo-&gt;DevicePowerThread =3D NULL;<br>
+=C2=A0 =C2=A0 Fdo-&gt;DevicePowerIrp =3D NULL;<br>
+=C2=A0 =C2=A0 Fdo-&gt;DevicePowerState =3D 0;<br>
+<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;Queue, sizeof(IO_CSQ));<br>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;List, sizeof(LIST_ENTRY));<b=
r>
=C2=A0 =C2=A0 =C2=A0RtlZeroMemory(&amp;Fdo-&gt;Lock, sizeof(KSPIN_LOCK));<b=
r>
diff --git a/vs2015/xenhid/xenhid.vcxproj b/vs2015/xenhid/xenhid.vcxproj<br=
>
index 35ba30f..e15b581 100644<br>
--- a/vs2015/xenhid/xenhid.vcxproj<br>
+++ b/vs2015/xenhid/xenhid.vcxproj<br>
@@ -53,6 +53,7 @@<br>
=C2=A0 =C2=A0&lt;ItemGroup&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/driver.c=
&quot; /&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/fdo.c&qu=
ot; /&gt;<br>
+=C2=A0 =C2=A0 &lt;ClCompile Include=3D&quot;../../src/xenhid/thread.c&quot=
; /&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/string.c=
&quot; /&gt;<br>
=C2=A0 =C2=A0&lt;/ItemGroup&gt;<br>
=C2=A0 =C2=A0&lt;ItemGroup&gt;<br>
diff --git a/vs2017/xenhid/xenhid.vcxproj b/vs2017/xenhid/xenhid.vcxproj<br=
>
index a113120..3ecd8d9 100644<br>
--- a/vs2017/xenhid/xenhid.vcxproj<br>
+++ b/vs2017/xenhid/xenhid.vcxproj<br>
@@ -61,6 +61,7 @@<br>
=C2=A0 =C2=A0&lt;ItemGroup&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/driver.c=
&quot; /&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/fdo.c&qu=
ot; /&gt;<br>
+=C2=A0 =C2=A0 &lt;ClCompile Include=3D&quot;../../src/xenhid/thread.c&quot=
; /&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/string.c=
&quot; /&gt;<br>
=C2=A0 =C2=A0&lt;/ItemGroup&gt;<br>
=C2=A0 =C2=A0&lt;ItemGroup&gt;<br>
diff --git a/vs2019/xenhid/xenhid.vcxproj b/vs2019/xenhid/xenhid.vcxproj<br=
>
index 996df2c..4573a59 100644<br>
--- a/vs2019/xenhid/xenhid.vcxproj<br>
+++ b/vs2019/xenhid/xenhid.vcxproj<br>
@@ -61,6 +61,7 @@<br>
=C2=A0 =C2=A0&lt;ItemGroup&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/driver.c=
&quot; /&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/fdo.c&qu=
ot; /&gt;<br>
+=C2=A0 =C2=A0 &lt;ClCompile Include=3D&quot;../../src/xenhid/thread.c&quot=
; /&gt;<br>
=C2=A0 =C2=A0 =C2=A0&lt;ClCompile Include=3D&quot;../../src/xenhid/string.c=
&quot; /&gt;<br>
=C2=A0 =C2=A0&lt;/ItemGroup&gt;<br>
=C2=A0 =C2=A0&lt;ItemGroup&gt;<br>
-- <br>
2.20.1<br>
<br>
</blockquote></div>
</blockquote></div>

--000000000000c1bb4605b1915a59--


From win-pv-devel-bounces@lists.xenproject.org Tue Oct 13 19:57:30 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 13 Oct 2020 19:57:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6377.16989 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kSQQK-0007Ze-61; Tue, 13 Oct 2020 19:57:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6377.16989; Tue, 13 Oct 2020 19:57:28 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kSQQK-0007ZX-30; Tue, 13 Oct 2020 19:57:28 +0000
Received: by outflank-mailman (input) for mailman id 6377;
 Tue, 13 Oct 2020 19:57:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=58E9=DU=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kSQQI-0007ZS-Q1
 for win-pv-devel@lists.xenproject.org; Tue, 13 Oct 2020 19:57:26 +0000
Received: from mail-io1-xd41.google.com (unknown [2607:f8b0:4864:20::d41])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 62df865e-bc53-4b68-aa68-674072bc1553;
 Tue, 13 Oct 2020 19:57:24 +0000 (UTC)
Received: by mail-io1-xd41.google.com with SMTP id q9so1290668iow.6
 for <win-pv-devel@lists.xenproject.org>; Tue, 13 Oct 2020 12:57:24 -0700 (PDT)
Received: from localhost.localdomain (ool-18bc75a6.dyn.optonline.net.
 [24.188.117.166])
 by smtp.gmail.com with ESMTPSA id f85sm778299ilh.68.2020.10.13.12.57.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 13 Oct 2020 12:57:22 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=58E9=DU=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kSQQI-0007ZS-Q1
	for win-pv-devel@lists.xenproject.org; Tue, 13 Oct 2020 19:57:26 +0000
X-Inumbo-ID: 62df865e-bc53-4b68-aa68-674072bc1553
Received: from mail-io1-xd41.google.com (unknown [2607:f8b0:4864:20::d41])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 62df865e-bc53-4b68-aa68-674072bc1553;
	Tue, 13 Oct 2020 19:57:24 +0000 (UTC)
Received: by mail-io1-xd41.google.com with SMTP id q9so1290668iow.6
        for <win-pv-devel@lists.xenproject.org>; Tue, 13 Oct 2020 12:57:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:to:cc:subject:date:message-id:mime-version
         :content-transfer-encoding;
        bh=HqAHp+Gtqn5hUE7yCkoVFviog1uSQjG51RPgyFgz91E=;
        b=P+e57FsIJ0eCcq2fI2sKne2Y2gxjTjm6BHMM7UwToYFAur5bI67cnz/c+h970KHaJE
         Z39kUvR6wggcL6XtbxeefZ24iwxBGsW1X2K25+gpGISwYo547PtnsvV9GF9NYq8onEc2
         Z9xrQ1PqKCmLqXeIBPfeizkbkli0D9P147GUyqf3iSz2TUgpR+6/iic9ZnMLKoJHx+EP
         kugSIC2NvaUBxLn+9TkBBsWIOpd0eJqNRvkoo+QEHTF+XSK6pJkj1ME7+Eb64J1hRqPV
         Y+I/h5rWh/WSKcuYqb6kJo+bD+9SudJHp2qqk6PuJMEnTCuxanCwrcGNzX+PlDbNjs6o
         wA9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
         :content-transfer-encoding;
        bh=HqAHp+Gtqn5hUE7yCkoVFviog1uSQjG51RPgyFgz91E=;
        b=DUz2E3HC0zI+Oh97+B0QaB9lxzktozQXE0dMMKqP5pGfVjQnW3Z9Ib3XSLzG+BzyiV
         iUYmYlExHNbYhlavohgj1PYd2+Lg3ig0sEQc4rz7UX9YtOGMfDj9KYz2dRsbA8kVtzcY
         hI5dxzrJQSMZUqkCDhcbTWUvKyFgCDuH4jg3NFHOfuX318By9qoZ2ryIxjjKpVjNI/iK
         5nf8fwhsrtH5ols1i4P+V9hFAdyzBjsb68n9MybF95Sm0dvX6JgCy9uSy5DpSY/GMjHG
         qupGVfCXK4AirSmb6vaJZXA8xIi4xJq8OKF+s7/s5bBvZVce9FCATkqxknHe+tAGZKQd
         qOpQ==
X-Gm-Message-State: AOAM530MzeJc6OXxhk8oCH/Aj4l38HVoMIkN9/IqdgZXAEsKwQuKZo6q
	h28rUpyPZPZsAtiwyaykrLrWbpCE/RA=
X-Google-Smtp-Source: ABdhPJxyWCCZa7VvUIRgXXOgQmWYN5E5dc16Z3vZ7i2iqRgebLOmfStPjGNaK/IRS1oOKrKlnqijpQ==
X-Received: by 2002:a05:6638:d92:: with SMTP id l18mr451339jaj.12.1602619043021;
        Tue, 13 Oct 2020 12:57:23 -0700 (PDT)
Received: from localhost.localdomain (ool-18bc75a6.dyn.optonline.net. [24.188.117.166])
        by smtp.gmail.com with ESMTPSA id f85sm778299ilh.68.2020.10.13.12.57.21
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 13 Oct 2020 12:57:22 -0700 (PDT)
From: Troy Crosley <troycrosley@gmail.com>
To: win-pv-devel@lists.xenproject.org
Cc: paul@xen.org,
	ben.chalmers@citrix.com,
	owen.smith@citrix.com,
	Troy Crosley <troycrosley@gmail.com>
Subject: [PATCH v2] Implement device power state transitions.
Date: Tue, 13 Oct 2020 15:57:11 -0400
Message-Id: <345f9cca4f0b9dd5dc46f92e5b2ad49a0b002f80.1602618877.git.troycrosley@gmail.com>
X-Mailer: git-send-email 2.20.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Implement device power state transition boilerplate so that xenhid can
release its interfaces before the system enters S3. Let hidclass handle
other power types.

Signed-off-by: Troy Crosley <troycrosley@gmail.com>
---
 src/xenhid/fdo.c             | 290 +++++++++++++++++++++++++++++++++--
 src/xenhid/names.h           | 278 +++++++++++++++++++++++++++++++++
 src/xenhid/thread.c          | 228 +++++++++++++++++++++++++++
 src/xenhid/thread.h          |  75 +++++++++
 vs2015/xenhid/xenhid.vcxproj |   1 +
 vs2017/xenhid/xenhid.vcxproj |   1 +
 vs2019/xenhid/xenhid.vcxproj |   1 +
 7 files changed, 862 insertions(+), 12 deletions(-)
 create mode 100644 src/xenhid/names.h
 create mode 100644 src/xenhid/thread.c
 create mode 100644 src/xenhid/thread.h

diff --git a/src/xenhid/fdo.c b/src/xenhid/fdo.c
index 860c7bc..706fa33 100644
--- a/src/xenhid/fdo.c
+++ b/src/xenhid/fdo.c
@@ -41,10 +41,12 @@
 #include <suspend_interface.h>
 
 #include "fdo.h"
+#include "thread.h"
 #include "driver.h"
 #include "dbg_print.h"
 #include "assert.h"
 #include "util.h"
+#include "names.h"
 #include "string.h"
 
 #define MAXNAMELEN  128
@@ -52,6 +54,9 @@
 struct _XENHID_FDO {
     PDEVICE_OBJECT              DeviceObject;
     PDEVICE_OBJECT              LowerDeviceObject;
+    PXENHID_THREAD              DevicePowerThread;
+    PIRP                        DevicePowerIrp;
+    DEVICE_POWER_STATE          DevicePowerState;
     BOOLEAN                     Enabled;
     XENHID_HID_INTERFACE        HidInterface;
     XENBUS_STORE_INTERFACE      StoreInterface;
@@ -220,6 +225,23 @@ __FdoFree(
     ExFreePoolWithTag(Buffer, FDO_POOL_TAG);
 }
 
+static FORCEINLINE VOID
+__FdoSetDevicePowerState(
+    IN  PXENHID_FDO         Fdo,
+    IN  DEVICE_POWER_STATE  State
+)
+{
+    Fdo->DevicePowerState = State;
+}
+
+static FORCEINLINE DEVICE_POWER_STATE
+__FdoGetDevicePowerState(
+    IN  PXENHID_FDO     Fdo
+)
+{
+    return Fdo->DevicePowerState;
+}
+
 static FORCEINLINE PANSI_STRING
 __FdoMultiSzToUpcaseAnsi(
     IN  PCHAR       Buffer
@@ -588,6 +610,8 @@ FdoD3ToD0(
 {
     NTSTATUS        status;
 
+    ASSERT3U(__FdoGetDevicePowerState(Fdo), ==, PowerDeviceD3);
+
     Trace("=====>\n");
 
     if (Fdo->Enabled)
@@ -621,6 +645,7 @@ FdoD3ToD0(
 
     Fdo->Enabled = TRUE;
 done:
+    __FdoSetDevicePowerState(Fdo, PowerDeviceD0);
     Trace("<=====\n");
     return STATUS_SUCCESS;
 
@@ -659,6 +684,8 @@ FdoD0ToD3(
 {
     Trace("=====>\n");
 
+    __FdoSetDevicePowerState(Fdo, PowerDeviceD3);
+
     if (!Fdo->Enabled)
         goto done;
 
@@ -868,6 +895,222 @@ FdoDispatchPnp(
     return status;
 }
 
+static FORCEINLINE NTSTATUS
+__FdoSetDevicePowerUp(
+    IN  PXENHID_FDO     Fdo,
+    IN  PIRP            Irp
+)
+{
+    PIO_STACK_LOCATION  StackLocation;
+    DEVICE_POWER_STATE  DeviceState;
+    NTSTATUS            status;
+
+    Trace("====>\n");
+
+    StackLocation = IoGetCurrentIrpStackLocation(Irp);
+    DeviceState = StackLocation->Parameters.Power.State.DeviceState;
+
+    ASSERT3U(DeviceState, < , __FdoGetDevicePowerState(Fdo));
+
+    status = FdoForwardIrpSynchronously(Fdo, Irp);
+    if (!NT_SUCCESS(status))
+        goto done;
+
+    Info("%s -> %s\n",
+        PowerDeviceStateName(__FdoGetDevicePowerState(Fdo)),
+        PowerDeviceStateName(DeviceState));
+
+    ASSERT3U(DeviceState, ==, PowerDeviceD0);
+    status = FdoD3ToD0(Fdo);
+    ASSERT(NT_SUCCESS(status));
+
+done:
+    Irp->IoStatus.Status = status;
+    IoCompleteRequest(Irp, IO_NO_INCREMENT);
+
+    Trace("<==== (%08x)\n", status);
+    return status;
+}
+
+static FORCEINLINE NTSTATUS
+__FdoSetDevicePowerDown(
+    IN  PXENHID_FDO     Fdo,
+    IN  PIRP            Irp
+)
+{
+    PIO_STACK_LOCATION  StackLocation;
+    DEVICE_POWER_STATE  DeviceState;
+    NTSTATUS            status;
+
+    StackLocation = IoGetCurrentIrpStackLocation(Irp);
+    DeviceState = StackLocation->Parameters.Power.State.DeviceState;
+
+    ASSERT3U(DeviceState, > , __FdoGetDevicePowerState(Fdo));
+
+    Info("%s -> %s\n",
+        PowerDeviceStateName(__FdoGetDevicePowerState(Fdo)),
+        PowerDeviceStateName(DeviceState));
+
+    ASSERT3U(DeviceState, ==, PowerDeviceD3);
+
+    if (__FdoGetDevicePowerState(Fdo) == PowerDeviceD0)
+        FdoD0ToD3(Fdo);
+
+    IoSkipCurrentIrpStackLocation(Irp);
+    status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
+
+    return status;
+}
+
+static FORCEINLINE NTSTATUS
+__FdoSetDevicePower(
+    IN  PXENHID_FDO     Fdo,
+    IN  PIRP            Irp
+)
+{
+    PIO_STACK_LOCATION  StackLocation;
+    DEVICE_POWER_STATE  DeviceState;
+    POWER_ACTION        PowerAction;
+    NTSTATUS            status;
+
+    StackLocation = IoGetCurrentIrpStackLocation(Irp);
+    DeviceState = StackLocation->Parameters.Power.State.DeviceState;
+    PowerAction = StackLocation->Parameters.Power.ShutdownType;
+
+    Trace("====> (%s:%s)\n",
+        PowerDeviceStateName(DeviceState),
+        PowerActionName(PowerAction));
+
+    ASSERT3U(PowerAction, < , PowerActionShutdown);
+
+    if (DeviceState == __FdoGetDevicePowerState(Fdo)) {
+        IoSkipCurrentIrpStackLocation(Irp);
+        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
+
+        goto done;
+    }
+
+    status = (DeviceState < __FdoGetDevicePowerState(Fdo)) ?
+        __FdoSetDevicePowerUp(Fdo, Irp) :
+        __FdoSetDevicePowerDown(Fdo, Irp);
+
+done:
+    Trace("<==== (%s:%s)(%08x)\n",
+        PowerDeviceStateName(DeviceState),
+        PowerActionName(PowerAction),
+        status);
+    return status;
+}
+
+static NTSTATUS
+FdoDevicePower(
+    IN  PXENHID_THREAD  Self,
+    IN  PVOID           Context
+)
+{
+    PXENHID_FDO         Fdo = (PXENHID_FDO)Context;
+    PKEVENT             Event;
+
+    Event = ThreadGetEvent(Self);
+
+    for (;;) {
+        PIRP                Irp;
+        PIO_STACK_LOCATION  StackLocation;
+        UCHAR               MinorFunction;
+
+        if (Fdo->DevicePowerIrp == NULL) {
+            (VOID)KeWaitForSingleObject(Event,
+                Executive,
+                KernelMode,
+                FALSE,
+                NULL);
+            KeClearEvent(Event);
+        }
+
+        if (ThreadIsAlerted(Self))
+            break;
+
+        Irp = Fdo->DevicePowerIrp;
+
+        if (Irp == NULL)
+            continue;
+
+        Fdo->DevicePowerIrp = NULL;
+        KeMemoryBarrier();
+
+        StackLocation = IoGetCurrentIrpStackLocation(Irp);
+        MinorFunction = StackLocation->MinorFunction;
+
+        switch (StackLocation->MinorFunction) {
+        case IRP_MN_SET_POWER:
+            (VOID)__FdoSetDevicePower(Fdo, Irp);
+            break;
+
+        default:
+            ASSERT(FALSE);
+            break;
+        }
+    }
+
+    return STATUS_SUCCESS;
+}
+
+static DECLSPEC_NOINLINE NTSTATUS
+FdoDispatchPower(
+    IN  PXENHID_FDO     Fdo,
+    IN  PIRP            Irp
+)
+{
+    PIO_STACK_LOCATION  StackLocation;
+    UCHAR               MinorFunction;
+    POWER_STATE_TYPE    PowerType;
+    POWER_ACTION        PowerAction;
+    NTSTATUS            status;
+
+    StackLocation = IoGetCurrentIrpStackLocation(Irp);
+    MinorFunction = StackLocation->MinorFunction;
+
+    if (MinorFunction != IRP_MN_SET_POWER) {
+        IoSkipCurrentIrpStackLocation(Irp);
+        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
+
+        goto done;
+    }
+
+    PowerType = StackLocation->Parameters.Power.Type;
+    PowerAction = StackLocation->Parameters.Power.ShutdownType;
+
+    if (PowerAction >= PowerActionShutdown) {
+        IoSkipCurrentIrpStackLocation(Irp);
+        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
+
+        goto done;
+    }
+
+    switch (PowerType) {
+    case DevicePowerState:
+        IoMarkIrpPending(Irp);
+
+        ASSERT3P(Fdo->DevicePowerIrp, ==, NULL);
+        Fdo->DevicePowerIrp = Irp;
+        KeMemoryBarrier();
+
+        ThreadWake(Fdo->DevicePowerThread);
+
+        status = STATUS_PENDING;
+        break;
+
+    case SystemPowerState:
+    default:
+        IoSkipCurrentIrpStackLocation(Irp);
+        status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
+        break;
+    }
+
+done:
+    return status;
+}
+
 static DECLSPEC_NOINLINE NTSTATUS
 FdoDispatchInternal(
     IN  PXENHID_FDO Fdo,
@@ -1031,6 +1274,10 @@ FdoDispatch(
         status = FdoDispatchPnp(Fdo, Irp);
         break;
 
+    case IRP_MJ_POWER:
+        status = FdoDispatchPower(Fdo, Irp);
+        break;
+
     default:
         status = FdoDispatchDefault(Fdo, Irp);
         break;
@@ -1118,6 +1365,11 @@ FdoCreate(
 
     Fdo->DeviceObject = DeviceObject;
     Fdo->LowerDeviceObject = LowerDeviceObject;
+    Fdo->DevicePowerState = PowerDeviceD3;
+
+    status = ThreadCreate(FdoDevicePower, Fdo, &Fdo->DevicePowerThread);
+    if (!NT_SUCCESS(status))
+        goto fail1;
 
     InitializeListHead(&Fdo->List);
     KeInitializeSpinLock(&Fdo->Lock);
@@ -1130,7 +1382,7 @@ FdoCreate(
                              FdoCsqReleaseLock,
                              FdoCsqCompleteCanceledIrp);
     if (!NT_SUCCESS(status))
-        goto fail1;
+        goto fail2;
 
     status = FdoQueryInterface(Fdo,
                                &GUID_XENBUS_SUSPEND_INTERFACE,
@@ -1138,7 +1390,7 @@ FdoCreate(
                                (PINTERFACE)&Fdo->SuspendInterface,
                                sizeof(XENBUS_SUSPEND_INTERFACE));
     if (!NT_SUCCESS(status))
-        goto fail2;
+        goto fail3;
 
     status = FdoQueryInterface(Fdo,
                                &GUID_XENBUS_STORE_INTERFACE,
@@ -1146,7 +1398,7 @@ FdoCreate(
                                (PINTERFACE)&Fdo->StoreInterface,
                                sizeof(XENBUS_STORE_INTERFACE));
     if (!NT_SUCCESS(status))
-        goto fail3;
+        goto fail4;
 
     status = FdoQueryInterface(Fdo,
                                &GUID_XENHID_HID_INTERFACE,
@@ -1154,34 +1406,41 @@ FdoCreate(
                                (PINTERFACE)&Fdo->HidInterface,
                                sizeof(XENHID_HID_INTERFACE));
     if (!NT_SUCCESS(status))
-        goto fail4;
+        goto fail5;
 
     Trace("<=====\n");
     return STATUS_SUCCESS;
 
-fail4:
-    Error("fail4\n");
+fail5:
+    Error("fail5\n");
 
     RtlZeroMemory(&Fdo->StoreInterface,
                   sizeof(XENBUS_STORE_INTERFACE));
 
-fail3:
-    Error("fail3\n");
+fail4:
+    Error("fail4\n");
 
     RtlZeroMemory(&Fdo->SuspendInterface,
                   sizeof(XENBUS_SUSPEND_INTERFACE));
 
-fail2:
-    Error("fail2\n");
+fail3:
+    Error("fail3\n");
 
     RtlZeroMemory(&Fdo->Queue, sizeof(IO_CSQ));
 
-fail1:
-    Error("fail1 %08x\n", status);
+fail2:
+    Error("fail2 %08x\n", status);
+
+    ThreadAlert(Fdo->DevicePowerThread);
+    ThreadJoin(Fdo->DevicePowerThread);
+    Fdo->DevicePowerThread = NULL;
 
     RtlZeroMemory(&Fdo->List, sizeof(LIST_ENTRY));
     RtlZeroMemory(&Fdo->Lock, sizeof(KSPIN_LOCK));
 
+fail1:
+    Error("fail1 %08x\n", status);
+
     Fdo->DeviceObject = NULL;
     Fdo->LowerDeviceObject = NULL;
 
@@ -1202,6 +1461,13 @@ FdoDestroy(
                   sizeof(XENBUS_SUSPEND_INTERFACE));
     RtlZeroMemory(&Fdo->StoreInterface,
                   sizeof(XENBUS_STORE_INTERFACE));
+
+    ThreadAlert(Fdo->DevicePowerThread);
+    ThreadJoin(Fdo->DevicePowerThread);
+    Fdo->DevicePowerThread = NULL;
+    Fdo->DevicePowerIrp = NULL;
+    Fdo->DevicePowerState = 0;
+
     RtlZeroMemory(&Fdo->Queue, sizeof(IO_CSQ));
     RtlZeroMemory(&Fdo->List, sizeof(LIST_ENTRY));
     RtlZeroMemory(&Fdo->Lock, sizeof(KSPIN_LOCK));
diff --git a/src/xenhid/names.h b/src/xenhid/names.h
new file mode 100644
index 0000000..39e0716
--- /dev/null
+++ b/src/xenhid/names.h
@@ -0,0 +1,278 @@
+/* Copyright (c) Citrix Systems Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, 
+ * with or without modification, are permitted provided 
+ * that the following conditions are met:
+ * 
+ * *   Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the 
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above 
+ *     copyright notice, this list of conditions and the 
+ *     following disclaimer in the documentation and/or other 
+ *     materials provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
+ * SUCH DAMAGE.
+ */
+
+#ifndef _XENHID_NAMES_H_
+#define _XENHID_NAMES_H_
+
+#include <ntddk.h>
+
+#include "types.h"
+
+static FORCEINLINE const CHAR *
+PowerTypeName(
+    IN  POWER_STATE_TYPE    Type
+    )
+{
+#define _POWER_TYPE_NAME(_Type) \
+        case _Type:             \
+            return #_Type;
+
+    switch (Type) {
+    _POWER_TYPE_NAME(SystemPowerState);
+    _POWER_TYPE_NAME(DevicePowerState);
+    default:
+        break;
+    }
+
+    return ("UNKNOWN");
+#undef  _POWER_ACTION_NAME
+}
+
+static FORCEINLINE const CHAR *
+PowerSystemStateName(
+    IN  SYSTEM_POWER_STATE State
+    )
+{
+#define _POWER_SYSTEM_STATE_NAME(_State)    \
+        case PowerSystem ## _State:         \
+            return #_State;
+
+    switch (State) {
+    _POWER_SYSTEM_STATE_NAME(Unspecified);
+    _POWER_SYSTEM_STATE_NAME(Working);
+    _POWER_SYSTEM_STATE_NAME(Sleeping1);
+    _POWER_SYSTEM_STATE_NAME(Sleeping2);
+    _POWER_SYSTEM_STATE_NAME(Sleeping3);
+    _POWER_SYSTEM_STATE_NAME(Hibernate);
+    _POWER_SYSTEM_STATE_NAME(Shutdown);
+    _POWER_SYSTEM_STATE_NAME(Maximum);
+    default:
+        break;
+    }
+
+    return ("UNKNOWN");
+#undef  _POWER_SYSTEM_STATE_NAME
+}
+
+static FORCEINLINE const CHAR *
+PowerDeviceStateName(
+    IN  DEVICE_POWER_STATE State
+    )
+{
+#define _POWER_DEVICE_STATE_NAME(_State)    \
+        case PowerDevice ## _State:         \
+            return #_State;
+
+    switch (State) {
+    _POWER_DEVICE_STATE_NAME(Unspecified);
+    _POWER_DEVICE_STATE_NAME(D0);
+    _POWER_DEVICE_STATE_NAME(D1);
+    _POWER_DEVICE_STATE_NAME(D2);
+    _POWER_DEVICE_STATE_NAME(D3);
+    _POWER_DEVICE_STATE_NAME(Maximum);
+    default:
+        break;
+    }
+
+    return ("UNKNOWN");
+#undef  _POWER_DEVICE_STATE_NAME
+}
+
+static FORCEINLINE const CHAR *
+PowerActionName(
+    IN  POWER_ACTION    Type
+    )
+{
+#define _POWER_ACTION_NAME(_Type)   \
+        case PowerAction ## _Type:  \
+            return #_Type;
+
+    switch (Type) {
+    _POWER_ACTION_NAME(None);
+    _POWER_ACTION_NAME(Reserved);
+    _POWER_ACTION_NAME(Sleep);
+    _POWER_ACTION_NAME(Hibernate);
+    _POWER_ACTION_NAME(Shutdown);
+    _POWER_ACTION_NAME(ShutdownReset);
+    _POWER_ACTION_NAME(ShutdownOff);
+    _POWER_ACTION_NAME(WarmEject);
+    default:
+        break;
+    }
+
+    return ("UNKNOWN");
+#undef  _POWER_ACTION_NAME
+}
+
+static FORCEINLINE const CHAR *
+PowerMinorFunctionName(
+    IN  ULONG   MinorFunction
+    )
+{
+#define _POWER_MINOR_FUNCTION_NAME(_Function)   \
+    case IRP_MN_ ## _Function:                  \
+        return #_Function;
+
+    switch (MinorFunction) {
+    _POWER_MINOR_FUNCTION_NAME(WAIT_WAKE);
+    _POWER_MINOR_FUNCTION_NAME(POWER_SEQUENCE);
+    _POWER_MINOR_FUNCTION_NAME(SET_POWER);
+    _POWER_MINOR_FUNCTION_NAME(QUERY_POWER);
+
+    default:
+        return "UNKNOWN";
+    }
+
+#undef  _POWER_MINOR_FUNCTION_NAME
+}
+
+static FORCEINLINE const CHAR *
+PnpDeviceStateName(
+    IN  DEVICE_PNP_STATE    State
+    )
+{
+#define _PNP_DEVICE_STATE_NAME(_State) \
+    case  _State:               \
+        return #_State;
+
+    switch (State) {
+    _PNP_DEVICE_STATE_NAME(Invalid);
+    _PNP_DEVICE_STATE_NAME(Added);
+    _PNP_DEVICE_STATE_NAME(Started);
+    _PNP_DEVICE_STATE_NAME(StopPending);
+    _PNP_DEVICE_STATE_NAME(Stopped);
+    _PNP_DEVICE_STATE_NAME(RemovePending);
+    _PNP_DEVICE_STATE_NAME(SurpriseRemovePending);
+    _PNP_DEVICE_STATE_NAME(Deleted);
+    default:
+        break;
+    }
+
+    return "UNKNOWN";
+
+#undef  _STATE_NAME
+}
+
+static FORCEINLINE const CHAR *
+PnpMinorFunctionName(
+    IN  ULONG   Function
+    )
+{
+#define _PNP_MINOR_FUNCTION_NAME(_Function) \
+    case IRP_MN_ ## _Function:              \
+        return #_Function;
+
+    switch (Function) {
+    _PNP_MINOR_FUNCTION_NAME(START_DEVICE);
+    _PNP_MINOR_FUNCTION_NAME(QUERY_REMOVE_DEVICE);
+    _PNP_MINOR_FUNCTION_NAME(REMOVE_DEVICE);
+    _PNP_MINOR_FUNCTION_NAME(CANCEL_REMOVE_DEVICE);
+    _PNP_MINOR_FUNCTION_NAME(STOP_DEVICE);
+    _PNP_MINOR_FUNCTION_NAME(QUERY_STOP_DEVICE);
+    _PNP_MINOR_FUNCTION_NAME(CANCEL_STOP_DEVICE);
+    _PNP_MINOR_FUNCTION_NAME(QUERY_DEVICE_RELATIONS);
+    _PNP_MINOR_FUNCTION_NAME(QUERY_INTERFACE);
+    _PNP_MINOR_FUNCTION_NAME(QUERY_CAPABILITIES);
+    _PNP_MINOR_FUNCTION_NAME(QUERY_RESOURCES);
+    _PNP_MINOR_FUNCTION_NAME(QUERY_RESOURCE_REQUIREMENTS);
+    _PNP_MINOR_FUNCTION_NAME(QUERY_DEVICE_TEXT);
+    _PNP_MINOR_FUNCTION_NAME(FILTER_RESOURCE_REQUIREMENTS);
+    _PNP_MINOR_FUNCTION_NAME(READ_CONFIG);
+    _PNP_MINOR_FUNCTION_NAME(WRITE_CONFIG);
+    _PNP_MINOR_FUNCTION_NAME(EJECT);
+    _PNP_MINOR_FUNCTION_NAME(SET_LOCK);
+    _PNP_MINOR_FUNCTION_NAME(QUERY_ID);
+    _PNP_MINOR_FUNCTION_NAME(QUERY_PNP_DEVICE_STATE);
+    _PNP_MINOR_FUNCTION_NAME(QUERY_BUS_INFORMATION);
+    _PNP_MINOR_FUNCTION_NAME(DEVICE_USAGE_NOTIFICATION);
+    _PNP_MINOR_FUNCTION_NAME(SURPRISE_REMOVAL);
+    _PNP_MINOR_FUNCTION_NAME(QUERY_LEGACY_BUS_INFORMATION);
+    default:
+        break;
+    }
+
+    return "UNKNOWN";
+
+#undef  _PNP_MINOR_FUNCTION_NAME
+}
+
+static FORCEINLINE const CHAR *
+PartialResourceDescriptorTypeName(
+    IN  UCHAR   Type
+    )
+{
+#define _PARTIAL_RESOURCE_DESCRIPTOR_TYPE_NAME(_Type)   \
+    case CmResourceType ## _Type:                       \
+        return #_Type;
+
+    switch (Type) {
+    _PARTIAL_RESOURCE_DESCRIPTOR_TYPE_NAME(Null);
+    _PARTIAL_RESOURCE_DESCRIPTOR_TYPE_NAME(Port);
+    _PARTIAL_RESOURCE_DESCRIPTOR_TYPE_NAME(Interrupt);
+    _PARTIAL_RESOURCE_DESCRIPTOR_TYPE_NAME(Memory);
+    _PARTIAL_RESOURCE_DESCRIPTOR_TYPE_NAME(Dma);
+    _PARTIAL_RESOURCE_DESCRIPTOR_TYPE_NAME(DeviceSpecific);
+    _PARTIAL_RESOURCE_DESCRIPTOR_TYPE_NAME(BusNumber);
+    _PARTIAL_RESOURCE_DESCRIPTOR_TYPE_NAME(MemoryLarge);
+    _PARTIAL_RESOURCE_DESCRIPTOR_TYPE_NAME(ConfigData);
+    _PARTIAL_RESOURCE_DESCRIPTOR_TYPE_NAME(DevicePrivate);
+    default:
+        break;
+    }
+
+    return "UNKNOWN";
+
+#undef  _PARTIAL_RESOURCE_DESCRIPTOR_TYPE_NAME
+}
+
+static FORCEINLINE const CHAR *
+DeviceUsageTypeName(
+    IN  DEVICE_USAGE_NOTIFICATION_TYPE  Type
+    )
+{
+#define _DEVICE_USAGE_TYPE_NAME(_Type)  \
+    case DeviceUsageType ## _Type:      \
+        return #_Type;
+
+    switch (Type) {
+    _DEVICE_USAGE_TYPE_NAME(Paging);
+    _DEVICE_USAGE_TYPE_NAME(Hibernation);
+    _DEVICE_USAGE_TYPE_NAME(DumpFile);
+    default:
+        break;
+    }
+
+    return "UNKNOWN";
+
+#undef  _DEVICE_USAGE_TYPE_NAME
+}
+
+#endif // _XENHID_NAMES_H_
diff --git a/src/xenhid/thread.c b/src/xenhid/thread.c
new file mode 100644
index 0000000..cdfb976
--- /dev/null
+++ b/src/xenhid/thread.c
@@ -0,0 +1,228 @@
+/* Copyright (c) Citrix Systems Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, 
+ * with or without modification, are permitted provided 
+ * that the following conditions are met:
+ * 
+ * *   Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the 
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above 
+ *     copyright notice, this list of conditions and the 
+ *     following disclaimer in the documentation and/or other 
+ *     materials provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
+ * SUCH DAMAGE.
+ */
+
+#include <ntddk.h>
+
+#include "thread.h"
+#include "util.h"
+#include "dbg_print.h"
+#include "assert.h"
+
+#define THREAD_POOL 'ERHT'
+
+struct _XENHID_THREAD {
+    XENHID_THREAD_FUNCTION  Function;
+    PVOID                   Context;
+    KEVENT                  Event;
+    BOOLEAN                 Alerted;
+    LONG                    References;
+    PKTHREAD                Thread;
+};
+
+static FORCEINLINE PVOID
+__ThreadAllocate(
+    IN  ULONG   Length
+    )
+{
+    return __AllocatePoolWithTag(NonPagedPool, Length, THREAD_POOL);
+}
+
+static FORCEINLINE VOID
+__ThreadFree(
+    IN  PVOID   Buffer
+    )
+{
+    __FreePoolWithTag(Buffer, THREAD_POOL);
+}
+
+static FORCEINLINE VOID
+__ThreadWake(
+    IN  PXENHID_THREAD  Thread
+    )
+{
+    KeSetEvent(&Thread->Event, IO_NO_INCREMENT, FALSE);
+}
+
+VOID
+ThreadWake(
+    IN  PXENHID_THREAD  Thread
+    )
+{
+    __ThreadWake(Thread);
+}
+
+static FORCEINLINE VOID
+__ThreadAlert(
+    IN  PXENHID_THREAD  Thread
+    )
+{
+    Thread->Alerted = TRUE;
+    __ThreadWake(Thread);
+}
+
+VOID
+ThreadAlert(
+    IN  PXENHID_THREAD  Thread
+    )
+{
+    __ThreadAlert(Thread);
+}
+
+KSTART_ROUTINE  ThreadFunction;
+
+VOID
+ThreadFunction(
+    IN  PVOID       Argument
+    )
+{
+    PXENHID_THREAD  Self = Argument;
+    NTSTATUS        status;
+
+    status = Self->Function(Self, Self->Context);
+
+    if (InterlockedDecrement(&Self->References) == 0)
+        __ThreadFree(Self);
+
+    PsTerminateSystemThread(status);
+    // NOT REACHED
+}
+
+__drv_requiresIRQL(PASSIVE_LEVEL)
+NTSTATUS
+ThreadCreate(
+    IN  XENHID_THREAD_FUNCTION  Function,
+    IN  PVOID                   Context,
+    OUT PXENHID_THREAD          *Thread
+    )
+{
+    HANDLE                      Handle;
+    NTSTATUS                    status;
+
+    ASSERT3U(KeGetCurrentIrql(), ==, PASSIVE_LEVEL);
+
+    (*Thread) = __ThreadAllocate(sizeof (XENHID_THREAD));
+
+    Warning("Create thread %p %p\n", Function, Thread);
+
+    status = STATUS_NO_MEMORY;
+    if (*Thread == NULL)
+        goto fail1;
+
+    (*Thread)->Function = Function;
+    (*Thread)->Context = Context;
+    (*Thread)->Alerted = FALSE;
+    (*Thread)->References = 2; // One for us, one for the thread function
+
+    KeInitializeEvent(&(*Thread)->Event, NotificationEvent, FALSE);
+
+    status = PsCreateSystemThread(&Handle,
+                                  STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL,
+                                  NULL,
+                                  NULL,
+                                  NULL,
+                                  ThreadFunction,
+                                  *Thread);
+    if (!NT_SUCCESS(status)) {
+        --(*Thread)->References;    // Fake thread function termination
+        goto fail2;
+    }
+
+    status = ObReferenceObjectByHandle(Handle,
+                                       SYNCHRONIZE,
+                                       *PsThreadType,
+                                       KernelMode,
+                                       &(*Thread)->Thread,
+                                       NULL);
+    if (!NT_SUCCESS(status))
+        goto fail3;
+
+    ZwClose(Handle);
+
+    return STATUS_SUCCESS;
+
+fail3:
+    Error("fail3\n");
+
+    __ThreadAlert(*Thread);
+    ZwClose(Handle);
+
+fail2:
+    Error("fail2\n");
+
+    if (InterlockedDecrement(&(*Thread)->References) == 0)
+        __ThreadFree(*Thread);
+
+    *Thread = NULL;
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
+
+PKEVENT
+ThreadGetEvent(
+    IN  PXENHID_THREAD  Thread
+    )
+{
+    return &Thread->Event;
+}
+
+BOOLEAN
+ThreadIsAlerted(
+    IN  PXENHID_THREAD  Thread
+    )
+{
+    return Thread->Alerted;
+}
+
+VOID
+ThreadJoin(
+    IN  PXENHID_THREAD  Thread
+    )
+{
+    LONG                References;
+
+    ASSERT3U(KeGetCurrentIrql(), ==, PASSIVE_LEVEL);
+    ASSERT3P(KeGetCurrentThread(), !=, Thread->Thread);
+
+    (VOID) KeWaitForSingleObject(Thread->Thread,
+                                 Executive,
+                                 KernelMode,
+                                 FALSE,
+                                 NULL);
+
+    References = InterlockedDecrement(&Thread->References);
+    ASSERT3U(References, ==, 0);
+
+    __ThreadFree(Thread);
+}
+
diff --git a/src/xenhid/thread.h b/src/xenhid/thread.h
new file mode 100644
index 0000000..30369c0
--- /dev/null
+++ b/src/xenhid/thread.h
@@ -0,0 +1,75 @@
+/* Copyright (c) Citrix Systems Inc.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, 
+ * with or without modification, are permitted provided 
+ * that the following conditions are met:
+ * 
+ * *   Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the 
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above 
+ *     copyright notice, this list of conditions and the 
+ *     following disclaimer in the documentation and/or other 
+ *     materials provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
+ * SUCH DAMAGE.
+ */
+
+#ifndef _XENHID_THREAD_H
+#define _XENHID_THREAD_H
+
+#include <ntddk.h>
+
+typedef struct _XENHID_THREAD XENHID_THREAD, *PXENHID_THREAD;
+
+typedef NTSTATUS (*XENHID_THREAD_FUNCTION)(PXENHID_THREAD, PVOID);
+
+__drv_requiresIRQL(PASSIVE_LEVEL)
+extern NTSTATUS
+ThreadCreate(
+    IN  XENHID_THREAD_FUNCTION  Function,
+    IN  PVOID                   Context,
+    OUT PXENHID_THREAD          *Thread
+    );
+
+extern PKEVENT
+ThreadGetEvent(
+    IN  PXENHID_THREAD  Self
+    );
+
+extern BOOLEAN
+ThreadIsAlerted(
+    IN  PXENHID_THREAD  Self
+    );
+
+extern VOID
+ThreadWake(
+    IN  PXENHID_THREAD  Thread
+    );
+
+extern VOID
+ThreadAlert(
+    IN  PXENHID_THREAD  Thread
+    );
+
+extern VOID
+ThreadJoin(
+    IN  PXENHID_THREAD  Thread
+    );
+
+#endif  // _XENHID_THREAD_H
+
diff --git a/vs2015/xenhid/xenhid.vcxproj b/vs2015/xenhid/xenhid.vcxproj
index 35ba30f..e15b581 100644
--- a/vs2015/xenhid/xenhid.vcxproj
+++ b/vs2015/xenhid/xenhid.vcxproj
@@ -53,6 +53,7 @@
   <ItemGroup>
     <ClCompile Include="../../src/xenhid/driver.c" />
     <ClCompile Include="../../src/xenhid/fdo.c" />
+    <ClCompile Include="../../src/xenhid/thread.c" />
     <ClCompile Include="../../src/xenhid/string.c" />
   </ItemGroup>
   <ItemGroup>
diff --git a/vs2017/xenhid/xenhid.vcxproj b/vs2017/xenhid/xenhid.vcxproj
index a113120..3ecd8d9 100644
--- a/vs2017/xenhid/xenhid.vcxproj
+++ b/vs2017/xenhid/xenhid.vcxproj
@@ -61,6 +61,7 @@
   <ItemGroup>
     <ClCompile Include="../../src/xenhid/driver.c" />
     <ClCompile Include="../../src/xenhid/fdo.c" />
+    <ClCompile Include="../../src/xenhid/thread.c" />
     <ClCompile Include="../../src/xenhid/string.c" />
   </ItemGroup>
   <ItemGroup>
diff --git a/vs2019/xenhid/xenhid.vcxproj b/vs2019/xenhid/xenhid.vcxproj
index 996df2c..4573a59 100644
--- a/vs2019/xenhid/xenhid.vcxproj
+++ b/vs2019/xenhid/xenhid.vcxproj
@@ -61,6 +61,7 @@
   <ItemGroup>
     <ClCompile Include="../../src/xenhid/driver.c" />
     <ClCompile Include="../../src/xenhid/fdo.c" />
+    <ClCompile Include="../../src/xenhid/thread.c" />
     <ClCompile Include="../../src/xenhid/string.c" />
   </ItemGroup>
   <ItemGroup>
-- 
2.20.1



From win-pv-devel-bounces@lists.xenproject.org Tue Oct 13 22:25:48 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 13 Oct 2020 22:25:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6399.17049 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kSSjp-0003lS-32; Tue, 13 Oct 2020 22:25:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6399.17049; Tue, 13 Oct 2020 22:25:45 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kSSjp-0003lL-05; Tue, 13 Oct 2020 22:25:45 +0000
Received: by outflank-mailman (input) for mailman id 6399;
 Tue, 13 Oct 2020 22:25:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=58E9=DU=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kSSjo-0003lG-0e
 for win-pv-devel@lists.xenproject.org; Tue, 13 Oct 2020 22:25:44 +0000
Received: from mail-io1-xd33.google.com (unknown [2607:f8b0:4864:20::d33])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f8373987-5e83-4bb0-8ea5-b15ff61454c2;
 Tue, 13 Oct 2020 22:25:43 +0000 (UTC)
Received: by mail-io1-xd33.google.com with SMTP id k6so2416555ior.2
 for <win-pv-devel@lists.xenproject.org>; Tue, 13 Oct 2020 15:25:42 -0700 (PDT)
Received: from localhost.localdomain (ool-18bc75a6.dyn.optonline.net.
 [24.188.117.166])
 by smtp.gmail.com with ESMTPSA id w14sm1042155ilm.88.2020.10.13.15.25.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 13 Oct 2020 15:25:41 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=58E9=DU=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kSSjo-0003lG-0e
	for win-pv-devel@lists.xenproject.org; Tue, 13 Oct 2020 22:25:44 +0000
X-Inumbo-ID: f8373987-5e83-4bb0-8ea5-b15ff61454c2
Received: from mail-io1-xd33.google.com (unknown [2607:f8b0:4864:20::d33])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f8373987-5e83-4bb0-8ea5-b15ff61454c2;
	Tue, 13 Oct 2020 22:25:43 +0000 (UTC)
Received: by mail-io1-xd33.google.com with SMTP id k6so2416555ior.2
        for <win-pv-devel@lists.xenproject.org>; Tue, 13 Oct 2020 15:25:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:to:cc:subject:date:message-id:mime-version
         :content-transfer-encoding;
        bh=B0W9ul/5XaJ0cK9f1tMgr+R3PkC94UIXnM1KW81ZFqg=;
        b=hZ1tEb9rB8MkdkoVBtr33Pv5n0Va5d8N+5tqOG3BgLsVFbUSan2BuhxtPVDMymOmBa
         tuserbgoHL+lAUUPFTlxwOTHcbcgndMDAYuGFMl2xAuoI2eYrCkhG/sK9bM/Bfr8bf9H
         IzTxIDDvIV+gxu5t+vh3SUFvx/MsRDknMMsouFoGPETGYyRQ2mEvmZtW1I7zCskbeZIh
         dumluSycB1o8sd0OHUh05MvdUucL7B45WRbjEEZomE5tq7d8N7v/84bqrx+nEsd2HemW
         uHetFoMVEc9CPxrhLMo8Ybp2oz0Jy1bJpgn3YtDxuqbusL67DELLvH9a1Oop0vxvsBy4
         3dRA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
         :content-transfer-encoding;
        bh=B0W9ul/5XaJ0cK9f1tMgr+R3PkC94UIXnM1KW81ZFqg=;
        b=oSAsUnpt7aAqfN51zV2idXviNTirsBg/l9STfTRgTI3BCevQUbphLfaOpZ2AKNrcSt
         9pqeIB5L6KKF2OHCj8CQWDdQ3+IiM0nXElWC+JwK59op2Ag1xbvarmXu5KfNYelNCUZH
         QQ3/IUTPdYEqDhIKthdotmBlgdW2GM2KwlZMMrrKYSX+fWhV4tP3uWIEjG4OU6YG4uPm
         yqd98YL6ZD128s2lCanzIm9PjGukIF0pITK5S7WvorD4pZMPGU5ERkONzZwHtcu+ggsl
         VKpPUs8oUhcmur31GDN9wmfhja8ObsLVEZQH1ewpgHnieOLhoMJxFv5+uRQTDNHslzIK
         C3+Q==
X-Gm-Message-State: AOAM531k+/7KIuB+hiz4p6vv1yX4PYG4YrQgK57UERemNVvL8N71e60l
	lvJtP9nFwzTMH78uG1Z7dh6vqygFbd0=
X-Google-Smtp-Source: ABdhPJzS2Lo4iYeoRZwYKPqQnNW+2MVeZmVSGs5db3o23pbxMoWe8hu6Jrc4vpBXZeTZ38HcrgKquA==
X-Received: by 2002:a02:c80a:: with SMTP id p10mr805733jao.114.1602627942054;
        Tue, 13 Oct 2020 15:25:42 -0700 (PDT)
Received: from localhost.localdomain (ool-18bc75a6.dyn.optonline.net. [24.188.117.166])
        by smtp.gmail.com with ESMTPSA id w14sm1042155ilm.88.2020.10.13.15.25.40
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 13 Oct 2020 15:25:41 -0700 (PDT)
From: Troy Crosley <troycrosley@gmail.com>
To: win-pv-devel@lists.xenproject.org
Cc: paul@xen.org,
	ben.chalmers@citrix.com,
	owen.smith@citrix.com,
	Troy Crosley <troycrosley@gmail.com>
Subject: [PATCH] Fix HID code for KEY_SYSRQ.
Date: Tue, 13 Oct 2020 18:25:15 -0400
Message-Id: <791a47b8d45c4ac5d930aa4d969f4f50a1d70aa0.1602627782.git.troycrosley@gmail.com>
X-Mailer: git-send-email 2.20.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Signed-off-by: Troy Crosley <troycrosley@gmail.com>
---
 src/xenvkbd/vkbd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xenvkbd/vkbd.h b/src/xenvkbd/vkbd.h
index fa4cd7f..7cec2d0 100644
--- a/src/xenvkbd/vkbd.h
+++ b/src/xenvkbd/vkbd.h
@@ -227,7 +227,7 @@ static const HID_DEVICE_ATTRIBUTES VkbdDeviceAttributes = {
     DEFINE_USAGE(KEY_KPENTER, 0x58),            \
     DEFINE_USAGE(KEY_RIGHTCTRL, 0xE4),          \
     DEFINE_USAGE(KEY_KPSLASH, 0x54),            \
-    DEFINE_USAGE(KEY_SYSRQ, 0x48),              \
+    DEFINE_USAGE(KEY_SYSRQ, 0x46),              \
     DEFINE_USAGE(KEY_PAUSE, 0x48),              \
     DEFINE_USAGE(KEY_RIGHTALT, 0xE6),           \
     DEFINE_USAGE(KEY_HOME, 0x4A),               \
-- 
2.20.1



From win-pv-devel-bounces@lists.xenproject.org Wed Oct 14 09:03:01 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 14 Oct 2020 09:03:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6502.17342 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kScgU-0003WA-Cl; Wed, 14 Oct 2020 09:02:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6502.17342; Wed, 14 Oct 2020 09:02:58 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kScgU-0003W3-9Y; Wed, 14 Oct 2020 09:02:58 +0000
Received: by outflank-mailman (input) for mailman id 6502;
 Wed, 14 Oct 2020 09:02:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=x15f=DV=citrix.com=owen.smith@srs-us1.protection.inumbo.net>)
 id 1kScgS-0003UR-A4
 for win-pv-devel@lists.xenproject.org; Wed, 14 Oct 2020 09:02:56 +0000
Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b63593b9-7eaf-458e-8a1d-a1a206633e01;
 Wed, 14 Oct 2020 09:02:54 +0000 (UTC)
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=x15f=DV=citrix.com=owen.smith@srs-us1.protection.inumbo.net>)
	id 1kScgS-0003UR-A4
	for win-pv-devel@lists.xenproject.org; Wed, 14 Oct 2020 09:02:56 +0000
X-Inumbo-ID: b63593b9-7eaf-458e-8a1d-a1a206633e01
Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b63593b9-7eaf-458e-8a1d-a1a206633e01;
	Wed, 14 Oct 2020 09:02:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1602666174;
  h=from:to:cc:subject:date:message-id:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=LxgNiaXKZuktdX2CrNEhm/OwilOFreIwmoncfRfUzSE=;
  b=YeZBzTPZlNoUGh/l+svBm186tumPLs55wmDfrqmY0YdLa1XcYHhGneiU
   9jm4A6cd3xc4YaE6zJnt9mQ2m7M2fZK5yuUD+Z7OIiPWIpF/Wb8f5/6j1
   40HwcHdmdHDpUYxTvhh6BMf4DqqXCoyiozGs9viAjZbsvPFA9Rt/9t//4
   U=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
IronPort-SDR: 1AbIcd3qwfwERYPRpsc9fDHdwfx+y2yfGNYijSyTZRSS/r3vHrB+tm7st34GaakOqWfbh2HMBt
 umtFm8arRgaRr44WCqI6NIoh2A93Y6L6MR2SLlGqbBFNN1LedppY4e3LilgGlsuShmfVa5kqbw
 qD+sg2DEIjnAhQVGmd43yMldJ5aEhmJ+Hq8bLUk+wsT7ZMgM+8sB9lcP/NyVFlNF21/xFOxNm9
 iT497Ak9PV6ezff3tfYltfEBQ2v9ewgchMROTyrjlkNF3DJ+1gKVDXO1BpuqxVkr8tmusofMTq
 oAs=
X-SBRS: 2.5
X-MesageID: 29999939
X-Ironport-Server: esa4.hc3370-68.iphmx.com
X-Remote-IP: 162.221.158.21
X-Policy: $RELAYED
X-IronPort-AV: E=Sophos;i="5.77,374,1596513600"; 
   d="scan'208";a="29999939"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=FZSpR6T9mn7jNV3vd5KZdM6ksrYB4gzYPT7n0Xju4ZB2wuKFAsThQks9UBS8Q2pQkNnyxK/9bwGQS6b7ItYdjEqhzwaluMbxbHlu0tWvjuFaJ737Dp4NcH797dZHfUta96pEMhrVwuboemRIuJV5mtnn47wjV3lkT3v5VATFz5rTGBCesrxY2FnqYk06PFtY/Ya4qDqUuTljtwuGXk0p+bsOQqOfedESYJO4RPbL9WMupmBUFpxu6FYh4dfelFwTKom7WdEN94MTqWNBdcGUO93+IVh3WthaQs7aRkILrk8pFPAZquRuEHKWJtP0NHMgX86Gfv0ITv9blc7Jlq2csw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fgMkuB1XZhnvTrkCEQMUEBn/nfKOrQPd6VaVsMyk5pA=;
 b=UAZXgggifhvBwu4oFcDvh11td6g31DIDDReK7cTKqkJhpZRup/bliqMysVsP0TKREtQ2ftQqkAACskXXjjFV/bxd7vk4YJ90nQkuTuP8LRYgCXCBGSNDvaZ5jetW2cqAU49ySjRCGDY0vm/hehOrvWGo531rg2TTJasG0QsCSlXGAgEVdDjW3xIvjmi+0HTFVQHjc6oEHLsB+w52nzSh+AAc1chaD2yXfGZGGpCRnAEHL5emmt0PSGSg6PUCB7YSbFhJ1UyB60HAdEjLrgylS+mPvhTwhHI7A12thym5STuWksVCEMaUNZ72k8pHWL0qqUNMq0i9aRilphEvdNeRaQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fgMkuB1XZhnvTrkCEQMUEBn/nfKOrQPd6VaVsMyk5pA=;
 b=a1yHSjTmOEzijqRQWuaC+RrXtHgr9wxdq5ze7a+JCzWgUZkbJPpKIJob5QNmBZ2Q4kaCgTiYD/3aVGqyR72lagxU+rwm/SudLa/qrKPydqUqGM8caOzx4cOgGVoO0qHa8YBWcgVG9g6j71hNYmVdwbDc005zSju92G4jos/f1Bg=
From: Owen Smith <owen.smith@citrix.com>
To: Troy Crosley <troycrosley@gmail.com>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
CC: "paul@xen.org" <paul@xen.org>, Ben Chalmers <ben.chalmers@citrix.com>
Subject: RE: [PATCH] Fix HID code for KEY_SYSRQ.
Thread-Topic: [PATCH] Fix HID code for KEY_SYSRQ.
Thread-Index: AQHWoa/MqONPVR7WKky7Bs1Mhhi+aamWzZCw
Date: Wed, 14 Oct 2020 09:02:49 +0000
Message-ID: <BYAPR03MB4551D97A2A4ED43E0BAAC7BCFE050@BYAPR03MB4551.namprd03.prod.outlook.com>
References: <791a47b8d45c4ac5d930aa4d969f4f50a1d70aa0.1602627782.git.troycrosley@gmail.com>
In-Reply-To: <791a47b8d45c4ac5d930aa4d969f4f50a1d70aa0.1602627782.git.troycrosley@gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 93b12b91-06f2-4669-4629-08d8701fed5a
x-ms-traffictypediagnostic: BYAPR03MB3688:
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <BYAPR03MB36881843F96B4893ECDA543AFE050@BYAPR03MB3688.namprd03.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:4941;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: f8+7hIN+DjNxV+c9vFTg/bF7l7Pzws+STzleG6ZycxyioJ7fLo8ooaHRcyqa4gxHgm3vkmUdW1EoHPIyWY9u0ou6c9mD+xCGyAbL7kl/z72XBYs8iv8XTv6RoUfw36+zXr3/d5r9TRH2PLYs3DCa/tn7++NVLT73CrkMhklves79X0DFBezEFOgcAOuuhQhH5j5S1igUSfA5p79z3+2Hliq6E4kDCcMVKCjuzcGXKA5Ms7+E+UT24p1zEKvxShDOoAn9b8RUthPWkzfwpC71iMb4GEMMhUQHLiGdJN2cMdekcmFlB9j8PdYmnG2oyIl8kMHw4mXreiDQpP93HoO0QQ==
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB4551.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(39860400002)(346002)(376002)(396003)(136003)(33656002)(86362001)(107886003)(53546011)(6506007)(7696005)(478600001)(9686003)(55016002)(4326008)(26005)(110136005)(54906003)(186003)(316002)(71200400001)(44832011)(83380400001)(76116006)(64756008)(66476007)(66556008)(66946007)(66446008)(2906002)(8936002)(5660300002)(52536014)(8676002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata: A/cpzdrF5ov/XsWlsPu6MdbVzdvLIJTV0xi5EJKmo9kqlO1uUBQ/pOrds61eW32bT1IoGWEcVZKiWOc+WiCUAvppAP+QjqQVntEDPnQTBOkg6H9yzGp2Y+OQhWncdhhB0xqk8o1Z4rgL4LrfmrP1tkmHrnElDctbiXXgwmOFoMNk3nLrlmm+rXQLgGK974G2G1VLqVB8PYreli+2M5ECxS+JZ3htj7jqfNlO+1KGb4jpkQ2lejJqqLqNLVxVyj4ZEB7YfADXW2WQ5G966xMLueSIZROVzJg8Blx5cP8qnhm3UL3OJEIU1dkPHDT/M/lqNjgyyBua51ZXB5ZtkLYw2ztbh1/5Od8eRql2p4BtUxERdAhbebcGkiuMGDCxCnXrQsD3dIrgovv//93LpNrUDIREDlTuOMlSNXX5lu2L8nmPcD97Py9wMET0XXZbE31eqKPKwK8wNxVntNXcmdU7iEKGdonMbCxktwsd/yiGYAOmwu5cmNqSL8mbkB+GHyZQX7dwDsBEEGWXhWo9W+Ur5cwnelzebth5WTOGV+Ns17MJYKCDuor1PZ+ACxmYI8jW6H7cK0+FxBRKNxlD3YxbNijqZYFtaLCpcJsYaX0PBBMoPPhttZqxHH54XzZwTQxisCnXbLfSCU7sKwwJugY+lQ==
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB4551.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 93b12b91-06f2-4669-4629-08d8701fed5a
X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2020 09:02:49.9869
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Xg8dDfYPBJ14cR8DLgg7V8nMfjEsjD1dNjfWtSTYCcs3fPffguq8howmDKm9byR6TdSwe0fgF7CPcE09dczA5A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR03MB3688
X-OriginatorOrg: citrix.com

I don't have a standard keyboard in front of me, but I think Pause/SysRq is=
 the right labelling, and there is no current mapping to HID usage 0x46.

Acked-by: Owen Smith <owen.smith@citrix.com>

> -----Original Message-----
> From: Troy Crosley <troycrosley@gmail.com>
> Sent: 13 October 2020 23:25
> To: win-pv-devel@lists.xenproject.org
> Cc: paul@xen.org; Ben Chalmers <ben.chalmers@citrix.com>; Owen Smith
> <owen.smith@citrix.com>; Troy Crosley <troycrosley@gmail.com>
> Subject: [PATCH] Fix HID code for KEY_SYSRQ.
>=20
> [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments
> unless you have verified the sender and know the content is safe.
>=20
> Signed-off-by: Troy Crosley <troycrosley@gmail.com>
> ---
>  src/xenvkbd/vkbd.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>=20
> diff --git a/src/xenvkbd/vkbd.h b/src/xenvkbd/vkbd.h index fa4cd7f..7cec2=
d0
> 100644
> --- a/src/xenvkbd/vkbd.h
> +++ b/src/xenvkbd/vkbd.h
> @@ -227,7 +227,7 @@ static const HID_DEVICE_ATTRIBUTES
> VkbdDeviceAttributes =3D {
>      DEFINE_USAGE(KEY_KPENTER, 0x58),            \
>      DEFINE_USAGE(KEY_RIGHTCTRL, 0xE4),          \
>      DEFINE_USAGE(KEY_KPSLASH, 0x54),            \
> -    DEFINE_USAGE(KEY_SYSRQ, 0x48),              \
> +    DEFINE_USAGE(KEY_SYSRQ, 0x46),              \
>      DEFINE_USAGE(KEY_PAUSE, 0x48),              \
>      DEFINE_USAGE(KEY_RIGHTALT, 0xE6),           \
>      DEFINE_USAGE(KEY_HOME, 0x4A),               \
> --
> 2.20.1
>=20



From win-pv-devel-bounces@lists.xenproject.org Wed Oct 14 15:51:43 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 14 Oct 2020 15:51:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6798.17913 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kSj41-00013j-5D; Wed, 14 Oct 2020 15:51:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6798.17913; Wed, 14 Oct 2020 15:51:41 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kSj41-00013b-1p; Wed, 14 Oct 2020 15:51:41 +0000
Received: by outflank-mailman (input) for mailman id 6798;
 Wed, 14 Oct 2020 15:51:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jFXg=DV=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kSj3z-00013W-K2
 for win-pv-devel@lists.xenproject.org; Wed, 14 Oct 2020 15:51:39 +0000
Received: from mail-ej1-x629.google.com (unknown [2a00:1450:4864:20::629])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6fc6765e-d65b-4756-a142-667b1e6687c6;
 Wed, 14 Oct 2020 15:51:38 +0000 (UTC)
Received: by mail-ej1-x629.google.com with SMTP id p15so5524250ejm.7
 for <win-pv-devel@lists.xenproject.org>; Wed, 14 Oct 2020 08:51:38 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=jFXg=DV=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kSj3z-00013W-K2
	for win-pv-devel@lists.xenproject.org; Wed, 14 Oct 2020 15:51:39 +0000
X-Inumbo-ID: 6fc6765e-d65b-4756-a142-667b1e6687c6
Received: from mail-ej1-x629.google.com (unknown [2a00:1450:4864:20::629])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6fc6765e-d65b-4756-a142-667b1e6687c6;
	Wed, 14 Oct 2020 15:51:38 +0000 (UTC)
Received: by mail-ej1-x629.google.com with SMTP id p15so5524250ejm.7
        for <win-pv-devel@lists.xenproject.org>; Wed, 14 Oct 2020 08:51:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=oDZJ+NBQ3RHk5OcyEuYIpo65dn3sUxL7crzBSNZDfJQ=;
        b=dMkU9yIcp673pmGCy+0EbNRywPoSFoTRyEccMCjHSflO/si+tEkBi40wLRRnZAxEBm
         m7JTTcmPWYHjyr+xS5JuaBm7/GGs2b9deDnhVKRaDdxkiCxnFQTQuFYeKfa5iASUjJ0D
         9kxdHLjNjRioOxTrHlEQWfWycFI5LpvxgOdO8l6DNW8WjkR+n3cLdw+qCe6MtLBYUJDT
         ZOa0I8iM7xt8Vb8DtJLPj6wXQ+v+VUgeh5Uoi8lN4JinbKj2l1fYpISu7Xy06ARfqN2N
         r6ZpqFPf/GHHDcfEehU3h10ycPdXCXFO3d7WNUwtXInJgly4dlOHtely6Z2+kbSX67by
         Lrow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=oDZJ+NBQ3RHk5OcyEuYIpo65dn3sUxL7crzBSNZDfJQ=;
        b=Wgbx2tvAP7NNc2Gsc/Q7phowO/KSkma1Mwqbr6I3xDuYDOh88DEUkluIl8tylqi+8B
         nYwWJxh/Sh4jzwESBZv9a4HJCeRU+UZNY6Mtv9sugC2/qsYk7HQtf3FdSlwSAnV51++1
         D1M8Kzwat/342+cIfdJMuO5FQ26EraVOKugIE6IYxCRk6j7DpvpF8W9GJB0J3bOSw88P
         2XrijusG/ccLoR9mbyvO/+07CTQ/sP/DGTp1dsjzZUZFqut2cAjXuSWZG5Oq5bV1ORpI
         6V/AKjteXZe7a6G25QSlAJeSH2/AddlN4x0uEf0Ru4dkgqGhAn1LS8JOPg21gZuthdxe
         Ou8Q==
X-Gm-Message-State: AOAM531TcYdFaxmjQHd0L3k0ijyUzf3miryWOQzGtCSC/1Yq4PnEd2Lp
	nBtlOEnbm2ASWC08hpj7Jclkl6OUfqC6H+iUyNs=
X-Google-Smtp-Source: ABdhPJzNj1LW6hkeeeICrDXLSwwgBsEEl5wSKDOCvaBKGu8OsUUh0OKtlXFFh53NfJLSmY2emG5oZ78IU0FGpVLNxUs=
X-Received: by 2002:a17:906:3bc9:: with SMTP id v9mr5849780ejf.340.1602690697798;
 Wed, 14 Oct 2020 08:51:37 -0700 (PDT)
MIME-Version: 1.0
References: <791a47b8d45c4ac5d930aa4d969f4f50a1d70aa0.1602627782.git.troycrosley@gmail.com>
 <BYAPR03MB4551D97A2A4ED43E0BAAC7BCFE050@BYAPR03MB4551.namprd03.prod.outlook.com>
In-Reply-To: <BYAPR03MB4551D97A2A4ED43E0BAAC7BCFE050@BYAPR03MB4551.namprd03.prod.outlook.com>
From: Troy Crosley <troycrosley@gmail.com>
Date: Wed, 14 Oct 2020 11:51:27 -0400
Message-ID: <CAOBjEr+XyHgZSGr1E73UZkiFojsL6WuwXmWcPm4qBZpKKtG7eA@mail.gmail.com>
Subject: Re: [PATCH] Fix HID code for KEY_SYSRQ.
To: Owen Smith <owen.smith@citrix.com>
Cc: "win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>, "paul@xen.org" <paul@xen.org>, 
	Ben Chalmers <ben.chalmers@citrix.com>
Content-Type: multipart/alternative; boundary="000000000000ba27c905b1a3811c"

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

Usage 0x46 is mapped to "Keyboard PrintScreen" according to a HID usage
reference (Section 10, page 53 of
https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf). My test
keyboards have one button for PrtSc/SysRq (and a separate one for
Pause/Break), and without this patch, pressing PrtSc sends Pause instead of
PrtSc in contrast with the qemu device and bare metal.

Troy

On Wed, Oct 14, 2020 at 5:02 AM Owen Smith <owen.smith@citrix.com> wrote:

> I don't have a standard keyboard in front of me, but I think Pause/SysRq
> is the right labelling, and there is no current mapping to HID usage 0x46.
>
> Acked-by: Owen Smith <owen.smith@citrix.com>
>
> > -----Original Message-----
> > From: Troy Crosley <troycrosley@gmail.com>
> > Sent: 13 October 2020 23:25
> > To: win-pv-devel@lists.xenproject.org
> > Cc: paul@xen.org; Ben Chalmers <ben.chalmers@citrix.com>; Owen Smith
> > <owen.smith@citrix.com>; Troy Crosley <troycrosley@gmail.com>
> > Subject: [PATCH] Fix HID code for KEY_SYSRQ.
> >
> > [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments
> > unless you have verified the sender and know the content is safe.
> >
> > Signed-off-by: Troy Crosley <troycrosley@gmail.com>
> > ---
> >  src/xenvkbd/vkbd.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/xenvkbd/vkbd.h b/src/xenvkbd/vkbd.h index
> fa4cd7f..7cec2d0
> > 100644
> > --- a/src/xenvkbd/vkbd.h
> > +++ b/src/xenvkbd/vkbd.h
> > @@ -227,7 +227,7 @@ static const HID_DEVICE_ATTRIBUTES
> > VkbdDeviceAttributes = {
> >      DEFINE_USAGE(KEY_KPENTER, 0x58),            \
> >      DEFINE_USAGE(KEY_RIGHTCTRL, 0xE4),          \
> >      DEFINE_USAGE(KEY_KPSLASH, 0x54),            \
> > -    DEFINE_USAGE(KEY_SYSRQ, 0x48),              \
> > +    DEFINE_USAGE(KEY_SYSRQ, 0x46),              \
> >      DEFINE_USAGE(KEY_PAUSE, 0x48),              \
> >      DEFINE_USAGE(KEY_RIGHTALT, 0xE6),           \
> >      DEFINE_USAGE(KEY_HOME, 0x4A),               \
> > --
> > 2.20.1
> >
>
>

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

<div dir=3D"ltr">Usage 0x46 is mapped to &quot;Keyboard PrintScreen&quot; a=
ccording to a HID usage reference (Section 10, page 53 of <a href=3D"https:=
//www.usb.org/sites/default/files/documents/hut1_12v2.pdf">https://www.usb.=
org/sites/default/files/documents/hut1_12v2.pdf</a>). My test keyboards hav=
e one button for PrtSc/SysRq (and a separate one for Pause/Break), and with=
out this patch, pressing PrtSc sends Pause instead of PrtSc in contrast wit=
h the qemu device and bare metal.<br><br>Troy<br></div><br><div class=3D"gm=
ail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Oct 14, 2020 at 5:=
02 AM Owen Smith &lt;<a href=3D"mailto:owen.smith@citrix.com">owen.smith@ci=
trix.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex">I don&#39;t have a standard keyboard in front of me, but I think Pa=
use/SysRq is the right labelling, and there is no current mapping to HID us=
age 0x46.<br>
<br>
Acked-by: Owen Smith &lt;<a href=3D"mailto:owen.smith@citrix.com" target=3D=
"_blank">owen.smith@citrix.com</a>&gt;<br>
<br>
&gt; -----Original Message-----<br>
&gt; From: Troy Crosley &lt;<a href=3D"mailto:troycrosley@gmail.com" target=
=3D"_blank">troycrosley@gmail.com</a>&gt;<br>
&gt; Sent: 13 October 2020 23:25<br>
&gt; To: <a href=3D"mailto:win-pv-devel@lists.xenproject.org" target=3D"_bl=
ank">win-pv-devel@lists.xenproject.org</a><br>
&gt; Cc: <a href=3D"mailto:paul@xen.org" target=3D"_blank">paul@xen.org</a>=
; Ben Chalmers &lt;<a href=3D"mailto:ben.chalmers@citrix.com" target=3D"_bl=
ank">ben.chalmers@citrix.com</a>&gt;; Owen Smith<br>
&gt; &lt;<a href=3D"mailto:owen.smith@citrix.com" target=3D"_blank">owen.sm=
ith@citrix.com</a>&gt;; Troy Crosley &lt;<a href=3D"mailto:troycrosley@gmai=
l.com" target=3D"_blank">troycrosley@gmail.com</a>&gt;<br>
&gt; Subject: [PATCH] Fix HID code for KEY_SYSRQ.<br>
&gt; <br>
&gt; [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachme=
nts<br>
&gt; unless you have verified the sender and know the content is safe.<br>
&gt; <br>
&gt; Signed-off-by: Troy Crosley &lt;<a href=3D"mailto:troycrosley@gmail.co=
m" target=3D"_blank">troycrosley@gmail.com</a>&gt;<br>
&gt; ---<br>
&gt;=C2=A0 src/xenvkbd/vkbd.h | 2 +-<br>
&gt;=C2=A0 1 file changed, 1 insertion(+), 1 deletion(-)<br>
&gt; <br>
&gt; diff --git a/src/xenvkbd/vkbd.h b/src/xenvkbd/vkbd.h index fa4cd7f..7c=
ec2d0<br>
&gt; 100644<br>
&gt; --- a/src/xenvkbd/vkbd.h<br>
&gt; +++ b/src/xenvkbd/vkbd.h<br>
&gt; @@ -227,7 +227,7 @@ static const HID_DEVICE_ATTRIBUTES<br>
&gt; VkbdDeviceAttributes =3D {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 DEFINE_USAGE(KEY_KPENTER, 0x58),=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 DEFINE_USAGE(KEY_RIGHTCTRL, 0xE4),=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 DEFINE_USAGE(KEY_KPSLASH, 0x54),=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 \<br>
&gt; -=C2=A0 =C2=A0 DEFINE_USAGE(KEY_SYSRQ, 0x48),=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 \<br>
&gt; +=C2=A0 =C2=A0 DEFINE_USAGE(KEY_SYSRQ, 0x46),=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 DEFINE_USAGE(KEY_PAUSE, 0x48),=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 DEFINE_USAGE(KEY_RIGHTALT, 0xE6),=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0\<br>
&gt;=C2=A0 =C2=A0 =C2=A0 DEFINE_USAGE(KEY_HOME, 0x4A),=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\<br>
&gt; --<br>
&gt; 2.20.1<br>
&gt; <br>
<br>
</blockquote></div>

--000000000000ba27c905b1a3811c--


From win-pv-devel-bounces@lists.xenproject.org Thu Oct 15 16:01:21 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 15 Oct 2020 16:01:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7535.19768 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kT5gs-0000Lx-AG; Thu, 15 Oct 2020 16:01:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7535.19768; Thu, 15 Oct 2020 16:01:18 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kT5gs-0000Lq-75; Thu, 15 Oct 2020 16:01:18 +0000
Received: by outflank-mailman (input) for mailman id 7535;
 Thu, 15 Oct 2020 16:01:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7gwo=DW=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
 id 1kT5gq-0000Ll-SG
 for win-pv-devel@lists.xenproject.org; Thu, 15 Oct 2020 16:01:16 +0000
Received: from mail-wr1-x435.google.com (unknown [2a00:1450:4864:20::435])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 791cdc67-5b87-4874-b3ad-a189caaf885e;
 Thu, 15 Oct 2020 16:01:16 +0000 (UTC)
Received: by mail-wr1-x435.google.com with SMTP id g12so4130235wrp.10
 for <win-pv-devel@lists.xenproject.org>; Thu, 15 Oct 2020 09:01:15 -0700 (PDT)
Received: from CBGR90WXYV0 (54-240-197-235.amazon.com. [54.240.197.235])
 by smtp.gmail.com with ESMTPSA id 30sm5577107wrr.35.2020.10.15.09.01.11
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 15 Oct 2020 09:01:12 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=7gwo=DW=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
	id 1kT5gq-0000Ll-SG
	for win-pv-devel@lists.xenproject.org; Thu, 15 Oct 2020 16:01:16 +0000
X-Inumbo-ID: 791cdc67-5b87-4874-b3ad-a189caaf885e
Received: from mail-wr1-x435.google.com (unknown [2a00:1450:4864:20::435])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 791cdc67-5b87-4874-b3ad-a189caaf885e;
	Thu, 15 Oct 2020 16:01:16 +0000 (UTC)
Received: by mail-wr1-x435.google.com with SMTP id g12so4130235wrp.10
        for <win-pv-devel@lists.xenproject.org>; Thu, 15 Oct 2020 09:01:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=Ok54GibR2vXKV2x9dUa1iRa/ykGJx9bUcvOywR20fjk=;
        b=neLtIErR0ygsTYJLAiv5i8aZzJWiCT66n81r5smF6N2CAUgTRnsBBz1biYcWAMDa9L
         FqYsudTljfqbTB/pWOJNK0d0oC9X4WszezHVwQeVBKSggdZy10K1cl7vo6z16qtWTesb
         LROESJzab+rI64nL9W7IIvRQE7A8rg3sRe9D83oN0NZy7/IsXmu8GpozieADCwV3nxaS
         DkGLHHqnH/FlABoFXuIQzUxoIYyBd+57+i4sUSBBI4lg7UFSYTpAyBb9XNX/xD+ygLBb
         nA2RBJ2OTGnCLqUqmfnXb7OgWWc+CdglcRcnGTyO9gpXmGDG7QHSWmUysY89VFbAbRLK
         mTAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to
         :subject:date:message-id:mime-version:content-transfer-encoding
         :thread-index:content-language;
        bh=Ok54GibR2vXKV2x9dUa1iRa/ykGJx9bUcvOywR20fjk=;
        b=LWECZ380fPz36IysNIVifsXijYk1ecZHgXKKXhs1FgM9oTG3B8XfnmA8s5IZ1sLjhr
         iNYjg58Sit6n9W9ll8mqos050ZlY5CUugpsoTlJniKetvLDMD6EcN5rFZlR28aogkQcr
         8HVetai1mH24utSqiRtruHQRx8tYgPxqFisfwq0PzDp2VOZwZmfUg1uHhGEI3W+6rSZB
         vHSIkabD5eiFGgurEE8wjznWX28cKRUYiMooCJnFUmbHzL0sJpHfjP187Tnyfm5xRInE
         1AKG+HIBRTAvV5t7SMaIweTdyQI97CFJelqFY7ICOxhFyecXxWP+CJNce5NwKSfCAZZM
         klEw==
X-Gm-Message-State: AOAM533U2n6PT2qps51/dXeTmXwr5SgDmglxM5eScHzrNoZvU4Khh2+n
	u0yau6AHOOpgE3Zf7TCtMXU=
X-Google-Smtp-Source: ABdhPJwwuBXvIheaHAzieRJHLdXFdHxYW/8FrbnYPNOyTxq9ViYbi/qbBPRhODxlX3HsZw6RoqzhjQ==
X-Received: by 2002:adf:d849:: with SMTP id k9mr4927368wrl.332.1602777673204;
        Thu, 15 Oct 2020 09:01:13 -0700 (PDT)
Received: from CBGR90WXYV0 (54-240-197-235.amazon.com. [54.240.197.235])
        by smtp.gmail.com with ESMTPSA id 30sm5577107wrr.35.2020.10.15.09.01.11
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 15 Oct 2020 09:01:12 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: "Paul Durrant" <paul@xen.org>
Reply-To: <paul@xen.org>
To: "'Troy Crosley'" <troycrosley@gmail.com>,
	<win-pv-devel@lists.xenproject.org>
Cc: <ben.chalmers@citrix.com>,
	<owen.smith@citrix.com>
References: <791a47b8d45c4ac5d930aa4d969f4f50a1d70aa0.1602627782.git.troycrosley@gmail.com>
In-Reply-To: <791a47b8d45c4ac5d930aa4d969f4f50a1d70aa0.1602627782.git.troycrosley@gmail.com>
Subject: RE: [PATCH] Fix HID code for KEY_SYSRQ.
Date: Thu, 15 Oct 2020 17:01:11 +0100
Message-ID: <000201d6a30c$675ab060$36101120$@xen.org>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQG0GaTJaP4YfUV1RmQxWKhfpu4Opand5WoQ
Content-Language: en-gb

> -----Original Message-----
> From: Troy Crosley <troycrosley@gmail.com>
> Sent: 13 October 2020 23:25
> To: win-pv-devel@lists.xenproject.org
> Cc: paul@xen.org; ben.chalmers@citrix.com; owen.smith@citrix.com; Troy Crosley <troycrosley@gmail.com>
> Subject: [PATCH] Fix HID code for KEY_SYSRQ.
> 
> Signed-off-by: Troy Crosley <troycrosley@gmail.com>

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

> ---
>  src/xenvkbd/vkbd.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/xenvkbd/vkbd.h b/src/xenvkbd/vkbd.h
> index fa4cd7f..7cec2d0 100644
> --- a/src/xenvkbd/vkbd.h
> +++ b/src/xenvkbd/vkbd.h
> @@ -227,7 +227,7 @@ static const HID_DEVICE_ATTRIBUTES VkbdDeviceAttributes = {
>      DEFINE_USAGE(KEY_KPENTER, 0x58),            \
>      DEFINE_USAGE(KEY_RIGHTCTRL, 0xE4),          \
>      DEFINE_USAGE(KEY_KPSLASH, 0x54),            \
> -    DEFINE_USAGE(KEY_SYSRQ, 0x48),              \
> +    DEFINE_USAGE(KEY_SYSRQ, 0x46),              \
>      DEFINE_USAGE(KEY_PAUSE, 0x48),              \
>      DEFINE_USAGE(KEY_RIGHTALT, 0xE6),           \
>      DEFINE_USAGE(KEY_HOME, 0x4A),               \
> --
> 2.20.1




From win-pv-devel-bounces@lists.xenproject.org Thu Oct 15 17:24:52 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 15 Oct 2020 17:24:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7675.20235 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kT6zj-0003J7-1K; Thu, 15 Oct 2020 17:24:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7675.20235; Thu, 15 Oct 2020 17:24:51 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kT6zi-0003Iz-Ud; Thu, 15 Oct 2020 17:24:50 +0000
Received: by outflank-mailman (input) for mailman id 7675;
 Thu, 15 Oct 2020 17:24:50 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kT6zh-0003Iu-QK
 for win-pv-devel@lists.xenproject.org; Thu, 15 Oct 2020 17:24:49 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1kT6zh-0003Iu-QK
	for win-pv-devel@lists.xenproject.org; Thu, 15 Oct 2020 17:24:49 +0000
Date: Thu, 15 Oct 2020 17:24:31 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <32575619.1.1602782673053.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENVKBD-master - Build #26 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_0_18616549.1602782672444"
X-Jenkins-Job: XENVKBD-master
X-Jenkins-Result: SUCCESS


------=_Part_0_18616549.1602782672444
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #26.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENVKBD-master/26/console to view the results.
------=_Part_0_18616549.1602782672444--


From win-pv-devel-bounces@lists.xenproject.org Thu Oct 15 17:29:06 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 15 Oct 2020 17:29:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7684.20251 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kT73q-0003Vh-Jy; Thu, 15 Oct 2020 17:29:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7684.20251; Thu, 15 Oct 2020 17:29:06 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kT73q-0003VZ-Gx; Thu, 15 Oct 2020 17:29:06 +0000
Received: by outflank-mailman (input) for mailman id 7684;
 Thu, 15 Oct 2020 17:29:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7gwo=DW=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
 id 1kT73p-0003VR-0E
 for win-pv-devel@lists.xenproject.org; Thu, 15 Oct 2020 17:29:05 +0000
Received: from mail-wr1-x436.google.com (unknown [2a00:1450:4864:20::436])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6ab7050b-4342-45df-9acf-08adf3fa17a9;
 Thu, 15 Oct 2020 17:29:04 +0000 (UTC)
Received: by mail-wr1-x436.google.com with SMTP id b8so4570753wrn.0
 for <win-pv-devel@lists.xenproject.org>; Thu, 15 Oct 2020 10:29:04 -0700 (PDT)
Received: from CBGR90WXYV0 (54-240-197-235.amazon.com. [54.240.197.235])
 by smtp.gmail.com with ESMTPSA id t10sm5229121wmf.46.2020.10.15.10.29.02
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 15 Oct 2020 10:29:02 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=7gwo=DW=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
	id 1kT73p-0003VR-0E
	for win-pv-devel@lists.xenproject.org; Thu, 15 Oct 2020 17:29:05 +0000
X-Inumbo-ID: 6ab7050b-4342-45df-9acf-08adf3fa17a9
Received: from mail-wr1-x436.google.com (unknown [2a00:1450:4864:20::436])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6ab7050b-4342-45df-9acf-08adf3fa17a9;
	Thu, 15 Oct 2020 17:29:04 +0000 (UTC)
Received: by mail-wr1-x436.google.com with SMTP id b8so4570753wrn.0
        for <win-pv-devel@lists.xenproject.org>; Thu, 15 Oct 2020 10:29:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=yyniIabrO9jfmGXnBFJEhEugPIMX0kzXcsNf7P/6Ny8=;
        b=bEgYRXbiahzYhCdvnkDkJY2dzYKAR/fGHIw9nydodrBftbkHQtoJ/fpa0ZgzuFz8Gq
         DwuqVa52u1fbPsggxu+taVw3rtpPBqzbQBacDnvhead6/wlXtHpeRAbQZkOTLXTIXaSZ
         t6pPZbdExXQYKvYDaMaPyfMUvs3PFPJeQvRjxj2hdOIVfx16Hylfrxzt1JK+El0Q0VFr
         18kEdqmLATi5/RudibkXI5ZA5SXBlpPQl5RIsrtgxFlxHu5nM3xNKdztcgDmRXUxDYqZ
         d8itAD3+3Td0StSjrGrRDaelyTMwpzplic5Glv5qujldHIuuhWgAjUbX+uxdUlOwTBlh
         1fSQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to
         :subject:date:message-id:mime-version:content-transfer-encoding
         :thread-index:content-language;
        bh=yyniIabrO9jfmGXnBFJEhEugPIMX0kzXcsNf7P/6Ny8=;
        b=aDqijVhkv55R0j1vZy4CnnSpy5i/XcM+rvP3ld/nwDmZoXZSgKCe2Nw9hwhHMjja4U
         2biL5LcTqh7Z4oDp1qx1g4rvfZQQDaUc32FxBvGJqRv4/Pa5XB04ESLMYIMRIK/PFwao
         /s80lM+jz/2xIl1r6az7xs1qog22N65RaJccqq9/9oMug/25FFyWCSWOijOby3U71BXc
         evQhqW6MVzWyVmf/0719dIJYmqdclxN37HpyQWaxoFcMyKYhTz+MvXi+IoXLGQB8sVty
         cL3Aqs9IW6ckKy7YuSlAx+0xUnvmytUJo8YzpPJ9snJDVBa/wPvXHwz6ctDXBIE5VZv2
         Aeng==
X-Gm-Message-State: AOAM533AYmX0mUQUhpMEU+LpXTX2iRSgrTN3XTXNGapc0HMDleVYoZEb
	NG775NqLqRj5jccZK3g5Kwc=
X-Google-Smtp-Source: ABdhPJzX/1PQKtNzDqXUYjfiRYrYxtY+GfdplGJFnk9MLzPmLWnqmhRJ3CbZYsWglmsbvtFOeVOwQg==
X-Received: by 2002:adf:ab50:: with SMTP id r16mr5279750wrc.235.1602782943476;
        Thu, 15 Oct 2020 10:29:03 -0700 (PDT)
Received: from CBGR90WXYV0 (54-240-197-235.amazon.com. [54.240.197.235])
        by smtp.gmail.com with ESMTPSA id t10sm5229121wmf.46.2020.10.15.10.29.02
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 15 Oct 2020 10:29:02 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: "Paul Durrant" <paul@xen.org>
Reply-To: <paul@xen.org>
To: "'Troy Crosley'" <troycrosley@gmail.com>,
	<win-pv-devel@lists.xenproject.org>
Cc: <ben.chalmers@citrix.com>,
	<owen.smith@citrix.com>
References: <345f9cca4f0b9dd5dc46f92e5b2ad49a0b002f80.1602618877.git.troycrosley@gmail.com>
In-Reply-To: <345f9cca4f0b9dd5dc46f92e5b2ad49a0b002f80.1602618877.git.troycrosley@gmail.com>
Subject: RE: [PATCH v2] Implement device power state transitions.
Date: Thu, 15 Oct 2020 18:29:01 +0100
Message-ID: <000b01d6a318$acdd5fa0$06981ee0$@xen.org>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQEmmmndB5XtaCZXM0tts3cXsaJB1Kr4+65w
Content-Language: en-gb

> -----Original Message-----
> From: Troy Crosley <troycrosley@gmail.com>
> Sent: 13 October 2020 20:57
> To: win-pv-devel@lists.xenproject.org
> Cc: paul@xen.org; ben.chalmers@citrix.com; owen.smith@citrix.com; Troy Crosley <troycrosley@gmail.com>
> Subject: [PATCH v2] Implement device power state transitions.
> 
> Implement device power state transition boilerplate so that xenhid can
> release its interfaces before the system enters S3. Let hidclass handle
> other power types.
> 
> Signed-off-by: Troy Crosley <troycrosley@gmail.com>

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



From win-pv-devel-bounces@lists.xenproject.org Fri Oct 16 08:05:58 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 16 Oct 2020 08:05:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7811.20579 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kTKkO-0006Fk-36; Fri, 16 Oct 2020 08:05:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7811.20579; Fri, 16 Oct 2020 08:05:56 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kTKkN-0006Fb-W3; Fri, 16 Oct 2020 08:05:55 +0000
Received: by outflank-mailman (input) for mailman id 7811;
 Fri, 16 Oct 2020 08:05:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rL6s=DX=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
 id 1kTKkN-0006FW-7b
 for win-pv-devel@lists.xenproject.org; Fri, 16 Oct 2020 08:05:55 +0000
Received: from mail-wm1-x332.google.com (unknown [2a00:1450:4864:20::332])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 70a7ae3a-a834-43f8-b8af-eb4e2ad9f86d;
 Fri, 16 Oct 2020 08:05:54 +0000 (UTC)
Received: by mail-wm1-x332.google.com with SMTP id p15so1486514wmi.4
 for <win-pv-devel@lists.xenproject.org>; Fri, 16 Oct 2020 01:05:54 -0700 (PDT)
Received: from CBGR90WXYV0
 (host109-146-187-185.range109-146.btcentralplus.com. [109.146.187.185])
 by smtp.gmail.com with ESMTPSA id l26sm1756755wmi.39.2020.10.16.01.05.52
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 16 Oct 2020 01:05:53 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=rL6s=DX=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
	id 1kTKkN-0006FW-7b
	for win-pv-devel@lists.xenproject.org; Fri, 16 Oct 2020 08:05:55 +0000
X-Inumbo-ID: 70a7ae3a-a834-43f8-b8af-eb4e2ad9f86d
Received: from mail-wm1-x332.google.com (unknown [2a00:1450:4864:20::332])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 70a7ae3a-a834-43f8-b8af-eb4e2ad9f86d;
	Fri, 16 Oct 2020 08:05:54 +0000 (UTC)
Received: by mail-wm1-x332.google.com with SMTP id p15so1486514wmi.4
        for <win-pv-devel@lists.xenproject.org>; Fri, 16 Oct 2020 01:05:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:reply-to:to:cc:subject:date:message-id:mime-version
         :content-transfer-encoding:thread-index:content-language;
        bh=kHKLJkb+4mwWPzCaEoPqPeCsUq93Bo6Z716yaxktbMc=;
        b=PlOZUSw5lGNU9zFEXxQDFcCDE48flq5t20oOb/J+z6phOtXvo9794qjh0TLoS5tbj5
         +qOOrxC66Q6zD07TNLYvTHITFEr57zRsVNf+YPsLzxmZL+qiE/Bwdv5EVMmqQG+fuzCo
         WyY6UiXS9dAcOLyVkRFa7lcDpiHMJDXLAhJ2GKw4dWWcgDjWgWBfu94vzD6IajvjaOZW
         nL35jhoBwjaOKK5+yYrWpBoKIfahHCNIVVbF0+s5pb5+Jv+bpc1czP3683uOIP1JYLLK
         WCSDFRFuiIS1klKfhfsb8yO1QAuJvNiSY09gMQe+qTt1FQX7p2ncvwvI3b2I2NcEyY5H
         fzwA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:reply-to:to:cc:subject:date:message-id
         :mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=kHKLJkb+4mwWPzCaEoPqPeCsUq93Bo6Z716yaxktbMc=;
        b=EWKHRQr6d1tppE6eBGyW++Q2T8eWdTmh9iw7AoCfD4FVCDlxBNww0ougwwKT1hb5dd
         7XmGMAw7+1bSutAZzGi+u0ogxTIeiVVmi5kyzcjc4ZAFpIzlm6YWNH1q+J0nh2EJQt7o
         KfWuXIoTIfVLgdx/t5jBtaNqUUHoT89zOxb1//8/aK+Oh86+S9akmqXjMab1d8CDEFzb
         1HCm3LguaBLd+Gnf+Z4nbHxxIjuXBkhnZ7r+6PzJEUTPiZKuBfQo4QPPkUmArTeltF8o
         LNkdJ36Ku945oQsKcmBGk1hLl5xFFBhmOugfYvyAbrJX+apv1nQLzyvRTUdNkyVfcoW8
         nBdQ==
X-Gm-Message-State: AOAM531ZosSZuXaZTnnqMvtCguNfn7BS/TqUmHzbmMEeuybjSP1pyH88
	1UI/MyUu94ITn2DMJJfYpZM=
X-Google-Smtp-Source: ABdhPJxwFDmU9/p87udgwZ/vunIj+for2MMVJ/186mBlgjgcv9xPxOs1Gu8y85Y1UlfXtF3Y4A/zvA==
X-Received: by 2002:a7b:c7d5:: with SMTP id z21mr2490720wmk.73.1602835553644;
        Fri, 16 Oct 2020 01:05:53 -0700 (PDT)
Received: from CBGR90WXYV0 (host109-146-187-185.range109-146.btcentralplus.com. [109.146.187.185])
        by smtp.gmail.com with ESMTPSA id l26sm1756755wmi.39.2020.10.16.01.05.52
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 16 Oct 2020 01:05:53 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: "Paul Durrant" <paul@xen.org>
Reply-To: <paul@xen.org>
To: <owen.smith@citrix.com>
Cc: <win-pv-devel@lists.xenproject.org>,
	"'Troy Crosley'" <troycrosley@gmail.com>
Subject: IRP buffer access in XENHID
Date: Fri, 16 Oct 2020 09:05:52 +0100
Message-ID: <001401d6a393$2af83d40$80e8b7c0$@xen.org>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 16.0
Thread-Index: Adajks5K2RXRBzjPSjyzzRFYc8SPYQ==
Content-Language: en-gb

Hi Owen,

  In testing Troy's power state handling patch I got a crash, which appears to be because XENHID is directly accessing user memory
in IRP handling (particularly UserBuffer in the hid callback) without probing for access. Is that just an oversight, or is there a
reason not to call ProbeForRead/Write() on the buffers?

  Paul



From win-pv-devel-bounces@lists.xenproject.org Fri Oct 16 08:31:30 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 16 Oct 2020 08:31:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7820.20595 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kTL97-0000Lx-7I; Fri, 16 Oct 2020 08:31:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7820.20595; Fri, 16 Oct 2020 08:31:29 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kTL97-0000Lq-42; Fri, 16 Oct 2020 08:31:29 +0000
Received: by outflank-mailman (input) for mailman id 7820;
 Fri, 16 Oct 2020 08:31:27 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kTL95-0000Ll-GT
 for win-pv-devel@lists.xenproject.org; Fri, 16 Oct 2020 08:31:27 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1kTL95-0000Ll-GT
	for win-pv-devel@lists.xenproject.org; Fri, 16 Oct 2020 08:31:27 +0000
Date: Fri, 16 Oct 2020 08:31:10 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <16987684.3.1602837071050.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENHID-master - Build #23 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2_25254428.1602837070737"
X-Jenkins-Job: XENHID-master
X-Jenkins-Result: SUCCESS


------=_Part_2_25254428.1602837070737
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #23.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENHID-master/23/console to view the results.
------=_Part_2_25254428.1602837070737--


From win-pv-devel-bounces@lists.xenproject.org Fri Oct 16 19:33:42 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 16 Oct 2020 19:33:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8228.21939 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kTVTw-0000cT-F0; Fri, 16 Oct 2020 19:33:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8228.21939; Fri, 16 Oct 2020 19:33:40 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kTVTw-0000cL-BT; Fri, 16 Oct 2020 19:33:40 +0000
Received: by outflank-mailman (input) for mailman id 8228;
 Fri, 16 Oct 2020 19:33:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6Hja=DX=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kTVTv-0000cG-EZ
 for win-pv-devel@lists.xenproject.org; Fri, 16 Oct 2020 19:33:39 +0000
Received: from mail-ej1-x630.google.com (unknown [2a00:1450:4864:20::630])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 45fe26cd-360e-4604-9439-1cbf4f33b63a;
 Fri, 16 Oct 2020 19:33:38 +0000 (UTC)
Received: by mail-ej1-x630.google.com with SMTP id lw21so4778210ejb.6
 for <win-pv-devel@lists.xenproject.org>; Fri, 16 Oct 2020 12:33:38 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=6Hja=DX=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kTVTv-0000cG-EZ
	for win-pv-devel@lists.xenproject.org; Fri, 16 Oct 2020 19:33:39 +0000
X-Inumbo-ID: 45fe26cd-360e-4604-9439-1cbf4f33b63a
Received: from mail-ej1-x630.google.com (unknown [2a00:1450:4864:20::630])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 45fe26cd-360e-4604-9439-1cbf4f33b63a;
	Fri, 16 Oct 2020 19:33:38 +0000 (UTC)
Received: by mail-ej1-x630.google.com with SMTP id lw21so4778210ejb.6
        for <win-pv-devel@lists.xenproject.org>; Fri, 16 Oct 2020 12:33:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=z79OSMXAFrk1WMn70EIPu2R3rRTplHxRyGO/11b0A4o=;
        b=DYsaUlEFTVvwqkodScLkJA0j/hKqHm+25Y05G/m8qN1QFAOsqE034u3gNq0uY60nur
         hkbZpin10eQhYhIPC4wrImfs2g0B7W3FgZOPbmV1RktW7OO57mH7L5PNWdtQI5PiuXRa
         QCWVGN5wCebvvHczrSA6xZbhEgnrunhmVgCR64wIlB2Y6cN2583+7cngwRSEr3duD/Dj
         I10Bju8ljxqdZaKM7ZdeKorZ4rkoDdb64DApQu8TawIaIe89G0xW3j162TX/IceWpw+r
         yu609GI6I2BnddjIMrzED3mXEiu0qlUKRsDSV+W/yFh0ZYvWU889tq4tsV4U0nsD6yBk
         on+w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=z79OSMXAFrk1WMn70EIPu2R3rRTplHxRyGO/11b0A4o=;
        b=rGAE6GshXrbtkaPVVTogHfKPJ3Sw3jOEXM/50z1XSzNaCaYE5AdU1KF5x8EEkIwTks
         NCLnaikaHJRP5uTLTLJpjY+CVVKqHe6uSKLIXstz+WpLeKTIGlnP5AryfOeQQW0YwDYn
         3tjM0LjppKmQuFIIVBqqJqFWgvfDrsNcSmbNT+Y27e2dPchd65Dy/vW/XN2cVWLttv4Q
         X9d/dLNd/Ms4U3yg8nOu8b0jrCMh1KCjn9h5AusAj/mBFafH/UykzCWUF/7mNP/UnzTM
         5pHWfelS8vpai/J+eEReNWn4JreOkMdP+u9yV/aZA8DIk/8LM1rmhUshsri3mFPBksHk
         rLrQ==
X-Gm-Message-State: AOAM533UHdLiShaJz3wQcbxoCRR+A/ib9NSQiZtpFGNgv/LznZ0WCK7v
	0bUxOoqa916LMS6/5mY+aUzkPJgb5SAhfQrQnJw=
X-Google-Smtp-Source: ABdhPJy+yA0DSmjAZ2AbIngJpAcsZaX7ulPvnNxJDIrQBej97IIoYjdKuKxJUkgaNHv/QGKeK84fe3FWmaexn0l2MN4=
X-Received: by 2002:a17:906:c095:: with SMTP id f21mr5642650ejz.108.1602876817418;
 Fri, 16 Oct 2020 12:33:37 -0700 (PDT)
MIME-Version: 1.0
References: <001401d6a393$2af83d40$80e8b7c0$@xen.org>
In-Reply-To: <001401d6a393$2af83d40$80e8b7c0$@xen.org>
From: Troy Crosley <troycrosley@gmail.com>
Date: Fri, 16 Oct 2020 15:33:28 -0400
Message-ID: <CAOBjErLyeibt_9_qkxDgx0BnPtSLZn7qOEjc6JuJDvy+axa=iQ@mail.gmail.com>
Subject: Re: IRP buffer access in XENHID
To: paul@xen.org
Cc: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000522f9505b1ced7cb"

--000000000000522f9505b1ced7cb
Content-Type: text/plain; charset="UTF-8"

Under certain situations, such as when input is being sent during driver
install or sleep transition, FdoCsqPeekNextIrp can be called with an empty
Fdo->List. In that case, FdoCsqPeekNextIrp dereferences the list head and
returns an invalid IRP; it should check for this error condition.

Troy "Owen" Crosley

On Fri, Oct 16, 2020 at 4:05 AM Paul Durrant <xadimgnik@gmail.com> wrote:

> Hi Owen,
>
>   In testing Troy's power state handling patch I got a crash, which
> appears to be because XENHID is directly accessing user memory
> in IRP handling (particularly UserBuffer in the hid callback) without
> probing for access. Is that just an oversight, or is there a
> reason not to call ProbeForRead/Write() on the buffers?
>
>   Paul
>
>

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

<div dir=3D"ltr">Under certain situations, such as when input is being sent=
 during driver install or sleep transition, FdoCsqPeekNextIrp can be called=
 with an empty Fdo-&gt;List. In that case, FdoCsqPeekNextIrp dereferences t=
he list head and returns an invalid IRP; it should check for this error con=
dition.<br><br>Troy &quot;Owen&quot; Crosley<br></div><br><div class=3D"gma=
il_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Oct 16, 2020 at 4:0=
5 AM Paul Durrant &lt;<a href=3D"mailto:xadimgnik@gmail.com">xadimgnik@gmai=
l.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:=
1ex">Hi Owen,<br>
<br>
=C2=A0 In testing Troy&#39;s power state handling patch I got a crash, whic=
h appears to be because XENHID is directly accessing user memory<br>
in IRP handling (particularly UserBuffer in the hid callback) without probi=
ng for access. Is that just an oversight, or is there a<br>
reason not to call ProbeForRead/Write() on the buffers?<br>
<br>
=C2=A0 Paul<br>
<br>
</blockquote></div>

--000000000000522f9505b1ced7cb--


From win-pv-devel-bounces@lists.xenproject.org Mon Oct 19 18:57:31 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 19 Oct 2020 18:57:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8810.23679 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kUaLY-0002LW-LX; Mon, 19 Oct 2020 18:57:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8810.23679; Mon, 19 Oct 2020 18:57:28 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kUaLY-0002LO-Ie; Mon, 19 Oct 2020 18:57:28 +0000
Received: by outflank-mailman (input) for mailman id 8810;
 Mon, 19 Oct 2020 18:57:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=t+By=D2=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kUaLY-0002LJ-6z
 for win-pv-devel@lists.xenproject.org; Mon, 19 Oct 2020 18:57:28 +0000
Received: from mail-il1-x142.google.com (unknown [2607:f8b0:4864:20::142])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4d3afe70-cab6-4847-8024-3d2b290d7811;
 Mon, 19 Oct 2020 18:57:27 +0000 (UTC)
Received: by mail-il1-x142.google.com with SMTP id l16so1319035ilj.9
 for <win-pv-devel@lists.xenproject.org>; Mon, 19 Oct 2020 11:57:27 -0700 (PDT)
Received: from localhost.localdomain (ool-18bc75a6.dyn.optonline.net.
 [24.188.117.166])
 by smtp.gmail.com with ESMTPSA id e11sm638487ioq.48.2020.10.19.11.57.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 19 Oct 2020 11:57:26 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=t+By=D2=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kUaLY-0002LJ-6z
	for win-pv-devel@lists.xenproject.org; Mon, 19 Oct 2020 18:57:28 +0000
X-Inumbo-ID: 4d3afe70-cab6-4847-8024-3d2b290d7811
Received: from mail-il1-x142.google.com (unknown [2607:f8b0:4864:20::142])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4d3afe70-cab6-4847-8024-3d2b290d7811;
	Mon, 19 Oct 2020 18:57:27 +0000 (UTC)
Received: by mail-il1-x142.google.com with SMTP id l16so1319035ilj.9
        for <win-pv-devel@lists.xenproject.org>; Mon, 19 Oct 2020 11:57:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:to:cc:subject:date:message-id:mime-version
         :content-transfer-encoding;
        bh=vEt1UvF38jpKFMcvsPs2Yak11kAVYRRSAjOnLmQzS2c=;
        b=UPZx20DtnzaNAH6qq6/1Dj/sqWYpmH0PBIgZJmY9izOC3Ttv+htAvV1w2+dTzn2RBV
         TfzNf80YFj58o9qA1DpY9HSMHqYGssyJBOGFqXmTBI/gnuMIFnxGC7sjKMBmcT6Dq2LW
         QZgysmfm0ra0Q3wnry85wuzFvK7l6QMx0+yhp6k1s+blfBwx70dIDEf0RKhO28RnKq2p
         rgje9ssxmMYebMJmdMCl4w5VbnppMIEfTnFpRFsue6n8xxvYV0X6nLjcsRkR6XqCgv56
         SIVcL+smdwwmvOQT2bpYpNmB1eupzINGbGZgi2iC0Q9g3bl1w3ec0MJjz8MblHjopBPh
         nAEQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
         :content-transfer-encoding;
        bh=vEt1UvF38jpKFMcvsPs2Yak11kAVYRRSAjOnLmQzS2c=;
        b=RLzjewnw042M/qHeCX+SEsI0GYjWiAN+7vn+5yxKntkAJM8WzkhyBQFbzxmdhmpnNB
         m6697+XN7VibXaxqsYXalWHNQ7KkCcpbVPA9+VlUmpNStQjmkoHW1n2d7QLN5Nhi4+Tk
         S7SRhWIAAiKxldW8tIq/2nqiTeqXgyCk2DtulsOEmREL0WtvGOEsZZ+JlzNFTld9Lift
         P4zgwDpDqJpm6AL/qla6B0axIesmxCBq1Me9wIWQvbFQfzf8LhCy2Hr/xnyxPve2LZda
         C6O8DvhV6U9BiW0PpII9oO1BpULGlVzGJ/PO3Lpgv4XquFB7ptGNPpPQxPMuTuyhr9bF
         fpbg==
X-Gm-Message-State: AOAM532R7/V7bOdIqkaUmM2vc69eUEf2Qab2GNTy1lZRYAvF4oPNvSss
	iCXktiFyRVjg5BucKItqRzjVuVxcnWc=
X-Google-Smtp-Source: ABdhPJwBdqNnAhjwyx5Uo3GnC+JTB4tddx/7r+orVGITLPc3GYYmeoJBaDvVzIE3PNW9i7Nsd2PJmA==
X-Received: by 2002:a92:c00c:: with SMTP id q12mr1187369ild.274.1603133846637;
        Mon, 19 Oct 2020 11:57:26 -0700 (PDT)
Received: from localhost.localdomain (ool-18bc75a6.dyn.optonline.net. [24.188.117.166])
        by smtp.gmail.com with ESMTPSA id e11sm638487ioq.48.2020.10.19.11.57.25
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Mon, 19 Oct 2020 11:57:26 -0700 (PDT)
From: Troy Crosley <troycrosley@gmail.com>
To: win-pv-devel@lists.xenproject.org
Cc: paul@xen.org,
	ben.chalmers@citrix.com,
	owen.smith@citrix.com,
	Troy Crosley <troycrosley@gmail.com>
Subject: [PATCH] Add check for empty List in FdoCsqPeekNextIrp.
Date: Mon, 19 Oct 2020 14:57:17 -0400
Message-Id: <b57d4f207ebde4e99200d678ce54c05dc4e40bf1.1603133626.git.troycrosley@gmail.com>
X-Mailer: git-send-email 2.20.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Under certain situations, such as when input is being sent during driver
install or sleep transition, FdoCsqPeekNextIrp can be called with an
empty Fdo->List. In that case, FdoCsqPeekNextIrp dereferences the list
head and returns an invalid IRP; it should check for this error
condition.

Signed-off-by: Troy Crosley <troycrosley@gmail.com>
---
 src/xenhid/fdo.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/xenhid/fdo.c b/src/xenhid/fdo.c
index c2ef7c8..04d3d7f 100644
--- a/src/xenhid/fdo.c
+++ b/src/xenhid/fdo.c
@@ -123,8 +123,12 @@ FdoCsqPeekNextIrp(
     else
         ListEntry = Irp->Tail.Overlay.ListEntry.Flink;
 
-    NextIrp = CONTAINING_RECORD(ListEntry, IRP, Tail.Overlay.ListEntry);
     // should walk through the list until a match against Context is found
+    if (ListEntry != &Fdo->List)
+        NextIrp = CONTAINING_RECORD(ListEntry, IRP, Tail.Overlay.ListEntry);
+    else
+        NextIrp = NULL;
+
     return NextIrp;
 }
 
-- 
2.20.1



From win-pv-devel-bounces@lists.xenproject.org Tue Oct 20 11:03:55 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 20 Oct 2020 11:03:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9092.24451 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kUpQn-00019I-PZ; Tue, 20 Oct 2020 11:03:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9092.24451; Tue, 20 Oct 2020 11:03:53 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kUpQn-00019B-Mn; Tue, 20 Oct 2020 11:03:53 +0000
Received: by outflank-mailman (input) for mailman id 9092;
 Tue, 20 Oct 2020 11:03:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dZuW=D3=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
 id 1kUpQm-000196-TK
 for win-pv-devel@lists.xenproject.org; Tue, 20 Oct 2020 11:03:53 +0000
Received: from mail-ej1-x642.google.com (unknown [2a00:1450:4864:20::642])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9d0722ac-b33a-467a-a0ae-c5acc073febb;
 Tue, 20 Oct 2020 11:03:52 +0000 (UTC)
Received: by mail-ej1-x642.google.com with SMTP id qp15so2050565ejb.3
 for <win-pv-devel@lists.xenproject.org>; Tue, 20 Oct 2020 04:03:52 -0700 (PDT)
Received: from CBGR90WXYV0 (54-240-197-238.amazon.com. [54.240.197.238])
 by smtp.gmail.com with ESMTPSA id k11sm2110588eji.72.2020.10.20.04.03.50
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 20 Oct 2020 04:03:50 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=dZuW=D3=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
	id 1kUpQm-000196-TK
	for win-pv-devel@lists.xenproject.org; Tue, 20 Oct 2020 11:03:53 +0000
X-Inumbo-ID: 9d0722ac-b33a-467a-a0ae-c5acc073febb
Received: from mail-ej1-x642.google.com (unknown [2a00:1450:4864:20::642])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9d0722ac-b33a-467a-a0ae-c5acc073febb;
	Tue, 20 Oct 2020 11:03:52 +0000 (UTC)
Received: by mail-ej1-x642.google.com with SMTP id qp15so2050565ejb.3
        for <win-pv-devel@lists.xenproject.org>; Tue, 20 Oct 2020 04:03:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=h+HBUDmVDMhYkS1VdZ33LVrT2EUmSlyPdgOzbGV0Oa8=;
        b=uYAkSDpjRURhnLKAL4fhyvgIMl2xsFNvDoIYWEn6EhoQjfHljaB9PDXQW+DIf1PKjx
         eioXyxUhpipPVmkdeSW494C8RyHdMNdmhv/Nq+G9MgMIKeYDIKJZbEHwkkoviI2KD/xN
         tZ8RYNVnVSvaBPWzZkTf3WTC/vaW4WJOWHKK7hqycDGjIuwHOBp1S6d3R2+qnx6quIxF
         8WS8nVgj19A0bR2enqUMPBevlJo9KareW1fTq6Z0yFT2SCH9WF1OgxIeu0Whzl5v5n0o
         1HXAlvvUJFpw0unRIA/j36YfGUoFFz8Jv07ydpkV2w5fEZwUhdYKlkXwct8FU4fCTWv6
         65OA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to
         :subject:date:message-id:mime-version:content-transfer-encoding
         :thread-index:content-language;
        bh=h+HBUDmVDMhYkS1VdZ33LVrT2EUmSlyPdgOzbGV0Oa8=;
        b=e453KWBlWw+4dzkO2bv3eWJe00ApfU3Uk2XC0E8zJ2mrTj07c4pmdc9LfU2LnxP4cn
         /Nh7dLXQRZhYHPdaGMRWpicPsKxo2/a+WK/24yMYptouZGOMewObm4khENvpxjgb1jbG
         DaHxy3weWmE0csUO+EftBxux6SwAg5sXplpYwg6nOep3VFm9PcP/hnX+8wH+u6ZoTjjn
         PNujcS7fs67cVsX2Dj66YI64IjxzWr9ja0qVTtNK1rblEgkL3v3rAfnkXkKg9xjT7wG3
         aS7ywqYyC3b9ivVFIeK4aWO85IE4Oe/rT79udVIyx3xRu1ycSFdywhsamdD3GZz1AQgI
         HE/Q==
X-Gm-Message-State: AOAM533sJWYhx2GUMDW4aHSGcz2lMFp9kPwlQIT7UlCsDXrIrqCcRR8c
	VX0u3I+ITaEvXM7qSS6+eAY=
X-Google-Smtp-Source: ABdhPJzMAaGFKGVff4snboEjDr0dhxvK8nzbRg+3DCC7N5UGLgf+RcovTTCzNTM3Cxm/cLR9X7M8hg==
X-Received: by 2002:a17:906:bc98:: with SMTP id lv24mr2457410ejb.545.1603191831353;
        Tue, 20 Oct 2020 04:03:51 -0700 (PDT)
Received: from CBGR90WXYV0 (54-240-197-238.amazon.com. [54.240.197.238])
        by smtp.gmail.com with ESMTPSA id k11sm2110588eji.72.2020.10.20.04.03.50
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 20 Oct 2020 04:03:50 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: "Paul Durrant" <paul@xen.org>
Reply-To: <paul@xen.org>
To: "'Troy Crosley'" <troycrosley@gmail.com>,
	<win-pv-devel@lists.xenproject.org>
Cc: <ben.chalmers@citrix.com>,
	<owen.smith@citrix.com>
References: <b57d4f207ebde4e99200d678ce54c05dc4e40bf1.1603133626.git.troycrosley@gmail.com>
In-Reply-To: <b57d4f207ebde4e99200d678ce54c05dc4e40bf1.1603133626.git.troycrosley@gmail.com>
Subject: RE: [PATCH] Add check for empty List in FdoCsqPeekNextIrp.
Date: Tue, 20 Oct 2020 12:03:49 +0100
Message-ID: <005201d6a6d0$b1045d70$130d1850$@xen.org>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQFkj2r8Zg09gZ0vRuAyXmotGjI3iqqEgUSw
Content-Language: en-gb

> -----Original Message-----
> From: Troy Crosley <troycrosley@gmail.com>
> Sent: 19 October 2020 19:57
> To: win-pv-devel@lists.xenproject.org
> Cc: paul@xen.org; ben.chalmers@citrix.com; owen.smith@citrix.com; Troy Crosley <troycrosley@gmail.com>
> Subject: [PATCH] Add check for empty List in FdoCsqPeekNextIrp.
> 
> Under certain situations, such as when input is being sent during driver
> install or sleep transition, FdoCsqPeekNextIrp can be called with an
> empty Fdo->List. In that case, FdoCsqPeekNextIrp dereferences the list
> head and returns an invalid IRP; it should check for this error
> condition.
> 
> Signed-off-by: Troy Crosley <troycrosley@gmail.com>

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

> ---
>  src/xenhid/fdo.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/xenhid/fdo.c b/src/xenhid/fdo.c
> index c2ef7c8..04d3d7f 100644
> --- a/src/xenhid/fdo.c
> +++ b/src/xenhid/fdo.c
> @@ -123,8 +123,12 @@ FdoCsqPeekNextIrp(
>      else
>          ListEntry = Irp->Tail.Overlay.ListEntry.Flink;
> 
> -    NextIrp = CONTAINING_RECORD(ListEntry, IRP, Tail.Overlay.ListEntry);
>      // should walk through the list until a match against Context is found
> +    if (ListEntry != &Fdo->List)
> +        NextIrp = CONTAINING_RECORD(ListEntry, IRP, Tail.Overlay.ListEntry);
> +    else
> +        NextIrp = NULL;
> +
>      return NextIrp;
>  }
> 
> --
> 2.20.1




From win-pv-devel-bounces@lists.xenproject.org Tue Oct 20 11:59:47 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 20 Oct 2020 11:59:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9101.24462 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kUqIr-0005S4-TP; Tue, 20 Oct 2020 11:59:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9101.24462; Tue, 20 Oct 2020 11:59:45 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kUqIr-0005Rw-QP; Tue, 20 Oct 2020 11:59:45 +0000
Received: by outflank-mailman (input) for mailman id 9101;
 Tue, 20 Oct 2020 11:59:45 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kUqIq-0005Rr-WA
 for win-pv-devel@lists.xenproject.org; Tue, 20 Oct 2020 11:59:45 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1kUqIq-0005Rr-WA
	for win-pv-devel@lists.xenproject.org; Tue, 20 Oct 2020 11:59:45 +0000
Date: Tue, 20 Oct 2020 11:59:30 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <4450373.5.1603195171514.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENHID-master - Build #24 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_4_28377960.1603195170827"
X-Jenkins-Job: XENHID-master
X-Jenkins-Result: SUCCESS


------=_Part_4_28377960.1603195170827
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #24.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENHID-master/24/console to view the results.
------=_Part_4_28377960.1603195170827--


From win-pv-devel-bounces@lists.xenproject.org Thu Oct 22 12:05:19 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 22 Oct 2020 12:05:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10409.27668 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kVZLI-0002xs-Je; Thu, 22 Oct 2020 12:05:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10409.27668; Thu, 22 Oct 2020 12:05:16 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kVZLI-0002xk-Ge; Thu, 22 Oct 2020 12:05:16 +0000
Received: by outflank-mailman (input) for mailman id 10409;
 Thu, 22 Oct 2020 12:05:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=F78R=D5=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kVZLH-0002xf-16
 for win-pv-devel@lists.xenproject.org; Thu, 22 Oct 2020 12:05:15 +0000
Received: from mail-ed1-x532.google.com (unknown [2a00:1450:4864:20::532])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 226350ee-7ec3-44e0-910f-fc7df309d024;
 Thu, 22 Oct 2020 12:05:14 +0000 (UTC)
Received: by mail-ed1-x532.google.com with SMTP id o18so1504528edq.4
 for <win-pv-devel@lists.xenproject.org>; Thu, 22 Oct 2020 05:05:14 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=F78R=D5=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kVZLH-0002xf-16
	for win-pv-devel@lists.xenproject.org; Thu, 22 Oct 2020 12:05:15 +0000
X-Inumbo-ID: 226350ee-7ec3-44e0-910f-fc7df309d024
Received: from mail-ed1-x532.google.com (unknown [2a00:1450:4864:20::532])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 226350ee-7ec3-44e0-910f-fc7df309d024;
	Thu, 22 Oct 2020 12:05:14 +0000 (UTC)
Received: by mail-ed1-x532.google.com with SMTP id o18so1504528edq.4
        for <win-pv-devel@lists.xenproject.org>; Thu, 22 Oct 2020 05:05:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:from:date:message-id:subject:to;
        bh=xWJWtEvzTUL/CKzcf07Em6/cBK7Soo6AEfsKTh8qEGg=;
        b=TGnOr1A9JdW2cLhcOk4qtVCAsXSj6Ng0EePyA2fAS4DJBtZLpPrIAmMUeHhiw3WIaw
         UMHMf98LHlm52cHODjm23Fr7s8q4BA07KpiHJVBH5/iaXososzWH9ZlBs0HE4PflrP+3
         BV93V6n5Dcl3MZO9fgcGN/shs3jUHt5oLHr5L7M73nrlRaThWnBE1SQJt23iGGnTUX09
         VnvFUx8g8H/5nl3N/WWyoY8AhcElC1mj8xqxtaWbWOnGQJYHF5Eek7fHdzqKL/OgIJXv
         5wUYJYhQbT7R5Wh862wx/2OhErU/sbnmKDZi42mwe15V+yJ6yUZBuECOdBq1uMNc9v4Y
         fkfA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
        bh=xWJWtEvzTUL/CKzcf07Em6/cBK7Soo6AEfsKTh8qEGg=;
        b=C9IQZq4lMQKoBSJ96DEP+dRF565W/FyzgZmPX/duJPdUHyaA9pQPUeaQAl2SGVdSzT
         A0I9eucDBAFvS9F8CqmaO7uR5fYBJT2gLYgqtA8GWXKAYF5OUlYUNFGOXqnkRbeXvOdz
         kwzgPXIYzDNXg+ZClGdoTa52ntriZhk2GL/5P9Q86ulsJEprC5vf03hDU+xjebzs/KFp
         Lo+vxvm7sPe9uidBCke2FFKEK9E7DjO7nPBLVHVhcuvYeLc+lYnMyCLguGYaDyXHt55G
         d137izjtFiuLL0Yam2WIvjkHUuNv+dNCK7Gyorc3UzkC1hhMECh5a5ZoeCu4qEfIdT0S
         PT+w==
X-Gm-Message-State: AOAM530Wiu3U4BzvGyNFIEQZkedi8I3LFfTU0QC4bJftyHJcH5zXtlmN
	JJl93y/avHE1uPhNSoxrUfT07wLqnzq1LVUV8oQ2c1D6WOs=
X-Google-Smtp-Source: ABdhPJxQ+6wdcrpGeTSQh8qu77wHpVNhzCGXKxBavL3/KPTr7kBIHkmA1NWuQb8qetosrslEE1HdCAV9lsfx6IwQaOQ=
X-Received: by 2002:a05:6402:1c8f:: with SMTP id cy15mr1886885edb.335.1603368312978;
 Thu, 22 Oct 2020 05:05:12 -0700 (PDT)
MIME-Version: 1.0
From: Troy Crosley <troycrosley@gmail.com>
Date: Thu, 22 Oct 2020 08:04:00 -0400
Message-ID: <CAOBjErLKhTy6h-0Xs9EmhiPjsx6_CtMfp1X+vA6uF9=V6XX5Fg@mail.gmail.com>
Subject: Driver uninstallation issues
To: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000bd3fde05b24146d4"

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

In Windows 10 version 2004, The coinstallers' DIF_INSTALLDEVICE routines do
not get called on driver uninstall (via e.g. Apps & Features). In previous
versions of Windows, this occurs as part of the uninstall during the null
device install and is the only time DifRemove gets called to perform
cleanup. We found a workaround by calling DifRemove (in the case of null
drivers) from DIF_SELECTBESTCOMPATDRV, which is the only coinstaller
request that seems to happen on uninstall in Windows 10 version 2004. I am
wondering if there's a better way to address this issue that would be
appropriate for the Xen Project.

I also found that the null driver detection in DIF_INSTALLDEVICE is
insufficient (I last tested it on Windows 10 version 1803), causing
DifInstall to be called rather than DifRemove during null driver
installation. Specifically, DriverInfoAvailable gets set to TRUE rather
than FALSE as expected for null drivers. I worked around this issue by
additionally checking to see if DriverInfoData.DriverType was equal to
SPDIT_CLASSDRIVER or SPDIT_COMPATDRIVER.

Troy

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

<div dir=3D"ltr">In Windows 10 version 2004, The coinstallers&#39; DIF_INST=
ALLDEVICE routines do not get called on driver uninstall (via e.g. Apps &am=
p; Features). In previous versions of Windows, this occurs as part of the u=
ninstall during the null device install and is the only time DifRemove gets=
 called to perform cleanup. We found a workaround by calling DifRemove (in =
the case of null drivers) from DIF_SELECTBESTCOMPATDRV, which is the only c=
oinstaller request that seems to happen on uninstall in Windows 10 version =
2004. I am wondering if there&#39;s a better way to address this issue that=
 would be appropriate for the Xen Project.<br><br>I also found that the nul=
l driver detection in DIF_INSTALLDEVICE is insufficient (I last tested it o=
n Windows 10 version 1803), causing DifInstall to be called rather than Dif=
Remove during null driver installation. Specifically, DriverInfoAvailable g=
ets set to TRUE rather than FALSE as expected for null drivers. I worked ar=
ound this issue by additionally checking to see if DriverInfoData.DriverTyp=
e was equal to SPDIT_CLASSDRIVER or SPDIT_COMPATDRIVER.<br><div><br></div><=
div>Troy</div></div>

--000000000000bd3fde05b24146d4--


From win-pv-devel-bounces@lists.xenproject.org Fri Oct 23 16:55:54 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 23 Oct 2020 16:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11272.29889 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kW0M3-0005kK-MB; Fri, 23 Oct 2020 16:55:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11272.29889; Fri, 23 Oct 2020 16:55:51 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kW0M3-0005kD-Ip; Fri, 23 Oct 2020 16:55:51 +0000
Received: by outflank-mailman (input) for mailman id 11272;
 Fri, 23 Oct 2020 16:55:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=r6wU=D6=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
 id 1kW0M2-0005k8-86
 for win-pv-devel@lists.xenproject.org; Fri, 23 Oct 2020 16:55:50 +0000
Received: from mail-wr1-x432.google.com (unknown [2a00:1450:4864:20::432])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c19d88a4-eed8-49f5-adf3-9b61399230b9;
 Fri, 23 Oct 2020 16:55:48 +0000 (UTC)
Received: by mail-wr1-x432.google.com with SMTP id s9so2775866wro.8
 for <win-pv-devel@lists.xenproject.org>; Fri, 23 Oct 2020 09:55:48 -0700 (PDT)
Received: from CBGR90WXYV0 (54-240-197-235.amazon.com. [54.240.197.235])
 by smtp.gmail.com with ESMTPSA id p67sm4409061wmp.11.2020.10.23.09.55.46
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 23 Oct 2020 09:55:47 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=r6wU=D6=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
	id 1kW0M2-0005k8-86
	for win-pv-devel@lists.xenproject.org; Fri, 23 Oct 2020 16:55:50 +0000
X-Inumbo-ID: c19d88a4-eed8-49f5-adf3-9b61399230b9
Received: from mail-wr1-x432.google.com (unknown [2a00:1450:4864:20::432])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c19d88a4-eed8-49f5-adf3-9b61399230b9;
	Fri, 23 Oct 2020 16:55:48 +0000 (UTC)
Received: by mail-wr1-x432.google.com with SMTP id s9so2775866wro.8
        for <win-pv-devel@lists.xenproject.org>; Fri, 23 Oct 2020 09:55:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:reply-to:to:references:in-reply-to:subject:date:message-id
         :mime-version:content-language:thread-index;
        bh=5XXNZFlbX93mFfvUpsUqdndRiFzu1PC/V2ooEgjgJq8=;
        b=Kv3Ip2RRt76i/ElxpCC4aYMx9/IVTw4Wmt+e8uXhVMRF8I3K/vFnuo0jo7EVinDKiz
         H5Lvf7GL+X6mufdL5plpq7yUii0xMYm1Nhg9HJqIBESb7dTFC5WK8kwLTZ7a30j8jXqg
         t2kOxtvU5YdJppGBufPehWl85+g3JLUJ0js4sOqFpmNgjT3cLWpze2Pkr733PajRvV8G
         4lRw/XdG+H8NdrAOndg1NjgukIWWrJIVZ08vmy6e1nNzJ9gAlYfAe6OT8+IZvKllqM+y
         O8alUVhyhpyXuErKeGbC5tkr3ylBaVV3j0T+k8Uqa+Niru5n82M/eRQxheOl14tbzCjS
         CZLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:reply-to:to:references:in-reply-to:subject
         :date:message-id:mime-version:content-language:thread-index;
        bh=5XXNZFlbX93mFfvUpsUqdndRiFzu1PC/V2ooEgjgJq8=;
        b=sL+jCCEbBeFyqsjiULLEYBlJari55ldJ6jvCa0DRLMiRBzv0orB8pmDXO25+KPOhqF
         SDCKNGIcKHFSa7GTVNZPpb/G/l6pcOXxium9WM3+bHJV4vH7XjMtWFPnnSt/skiAf3n/
         YLHLWOOeLqxy9HXhjSK00rmKCXRZpisyQitPxIWM5zn+uxM+ubFqbvmhYvGIG2A+fp03
         SdpoJdPdIuKBQe7Wjt7ec4nssxKQ9XfJfPAoQ95cd3vce1WHzb29n49I2erfKPrL91jh
         ndKDoO+xI8C+zN8tk68T2hlEQJ0ozSxmZWpdgjuYrmtFaJL84vuYRZBvWDwT3bVSQDeJ
         yhcQ==
X-Gm-Message-State: AOAM532ooZMi11E+K6F8fYWM0xxLb4v9/cTMnKzHRVWon3ap7EhzU3+l
	LGFrZ/pJjEcdRoqS83qXutU=
X-Google-Smtp-Source: ABdhPJy88o7l0BCTyAeBfb1C1/Akd8rZ/TmOw44gvqJu1En4lKAuW7y9g9dC1xG6pGpPzQLe62mhcQ==
X-Received: by 2002:adf:b353:: with SMTP id k19mr3552735wrd.216.1603472147857;
        Fri, 23 Oct 2020 09:55:47 -0700 (PDT)
Received: from CBGR90WXYV0 (54-240-197-235.amazon.com. [54.240.197.235])
        by smtp.gmail.com with ESMTPSA id p67sm4409061wmp.11.2020.10.23.09.55.46
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 23 Oct 2020 09:55:47 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: "Paul Durrant" <paul@xen.org>
Reply-To: <paul@xen.org>
To: "'Troy Crosley'" <troycrosley@gmail.com>,
	<win-pv-devel@lists.xenproject.org>
References: <CAOBjErLKhTy6h-0Xs9EmhiPjsx6_CtMfp1X+vA6uF9=V6XX5Fg@mail.gmail.com>
In-Reply-To: <CAOBjErLKhTy6h-0Xs9EmhiPjsx6_CtMfp1X+vA6uF9=V6XX5Fg@mail.gmail.com>
Subject: RE: Driver uninstallation issues
Date: Fri, 23 Oct 2020 17:55:46 +0100
Message-ID: <002901d6a95d$5ab17400$10145c00$@xen.org>
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_002A_01D6A965.BC771480"
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-gb
Thread-Index: AQJomq4nVJNXvjWGoRG7rAHXKHT0m6iBhBKA

This is a multipart message in MIME format.

------=_NextPart_000_002A_01D6A965.BC771480
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Hi Troy,
=20
  Thanks for the analysis. We always seem to be working round =
Microsoft=E2=80=99s insistence in steadily making co-installers more =
broken whilst not offering an alternative. If the =
DIF_SELECTBESTCOMPATDRV works then I guess we go with that. Similarly we =
should guard DifInstall as you suggest.
=20
  Cheers,
=20
    Paul
=20
From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> On Behalf =
Of Troy Crosley
Sent: 22 October 2020 13:04
To: win-pv-devel@lists.xenproject.org
Subject: Driver uninstallation issues
=20
In Windows 10 version 2004, The coinstallers' DIF_INSTALLDEVICE routines =
do not get called on driver uninstall (via e.g. Apps & Features). In =
previous versions of Windows, this occurs as part of the uninstall =
during the null device install and is the only time DifRemove gets =
called to perform cleanup. We found a workaround by calling DifRemove =
(in the case of null drivers) from DIF_SELECTBESTCOMPATDRV, which is the =
only coinstaller request that seems to happen on uninstall in Windows 10 =
version 2004. I am wondering if there's a better way to address this =
issue that would be appropriate for the Xen Project.

I also found that the null driver detection in DIF_INSTALLDEVICE is =
insufficient (I last tested it on Windows 10 version 1803), causing =
DifInstall to be called rather than DifRemove during null driver =
installation. Specifically, DriverInfoAvailable gets set to TRUE rather =
than FALSE as expected for null drivers. I worked around this issue by =
additionally checking to see if DriverInfoData.DriverType was equal to =
SPDIT_CLASSDRIVER or SPDIT_COMPATDRIVER.
=20
Troy

------=_NextPart_000_002A_01D6A965.BC771480
Content-Type: text/html;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta =
name=3DProgId content=3DWord.Document><meta name=3DGenerator =
content=3D"Microsoft Word 15"><meta name=3DOriginator =
content=3D"Microsoft Word 15"><link rel=3DFile-List =
href=3D"cid:filelist.xml@01D6A965.AC0A8550"><!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:SpellingState>Clean</w:SpellingState>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:EnvelopeVis/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-GB</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:DoNotExpandShiftReturn/>
<w:BreakWrappedTables/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=3D"Cambria Math"/>
<m:brkBin m:val=3D"before"/>
<m:brkBinSub m:val=3D"&#45;-"/>
<m:smallFrac m:val=3D"off"/>
<m:dispDef/>
<m:lMargin m:val=3D"0"/>
<m:rMargin m:val=3D"0"/>
<m:defJc m:val=3D"centerGroup"/>
<m:wrapIndent m:val=3D"1440"/>
<m:intLim m:val=3D"subSup"/>
<m:naryLim m:val=3D"undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState=3D"false" DefUnhideWhenUsed=3D"false" =
DefSemiHidden=3D"false" DefQFormat=3D"false" DefPriority=3D"99" =
LatentStyleCount=3D"371">
<w:LsdException Locked=3D"false" Priority=3D"0" QFormat=3D"true" =
Name=3D"Normal"/>
<w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" =
Name=3D"heading 1"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 2"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 3"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 4"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 5"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 6"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 7"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 8"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 9"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 6"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 7"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 8"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 9"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 1"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 2"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 3"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 4"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 5"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 6"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 7"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 8"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 9"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Normal Indent"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"footnote text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"annotation text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"header"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"footer"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index heading"/>
<w:LsdException Locked=3D"false" Priority=3D"35" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"caption"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"table of figures"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"envelope address"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"envelope return"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"footnote reference"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"annotation reference"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"line number"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"page number"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"endnote reference"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"endnote text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"table of authorities"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"macro"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toa heading"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number 5"/>
<w:LsdException Locked=3D"false" Priority=3D"10" QFormat=3D"true" =
Name=3D"Title"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Closing"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Signature"/>
<w:LsdException Locked=3D"false" Priority=3D"1" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Default Paragraph Font"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text Indent"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Message Header"/>
<w:LsdException Locked=3D"false" Priority=3D"11" QFormat=3D"true" =
Name=3D"Subtitle"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Salutation"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Date"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text First Indent"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text First Indent 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Note Heading"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text Indent 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text Indent 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Block Text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Hyperlink"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"FollowedHyperlink"/>
<w:LsdException Locked=3D"false" Priority=3D"22" QFormat=3D"true" =
Name=3D"Strong"/>
<w:LsdException Locked=3D"false" Priority=3D"20" QFormat=3D"true" =
Name=3D"Emphasis"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Document Map"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Plain Text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"E-mail Signature"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Top of Form"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Bottom of Form"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Normal (Web)"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Acronym"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Address"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Cite"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Code"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Definition"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Keyboard"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Preformatted"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Sample"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Typewriter"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Variable"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Normal Table"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"annotation subject"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"No List"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Outline List 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Outline List 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Outline List 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Simple 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Simple 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Simple 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Classic 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Classic 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Classic 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Classic 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Colorful 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Colorful 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Colorful 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 6"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 7"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 8"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 6"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 7"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 8"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table 3D effects 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table 3D effects 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table 3D effects 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Contemporary"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Elegant"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Professional"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Subtle 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Subtle 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Web 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Web 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Web 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Balloon Text"/>
<w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"Table Grid"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Theme"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" Name=3D"Placeholder =
Text"/>
<w:LsdException Locked=3D"false" Priority=3D"1" QFormat=3D"true" =
Name=3D"No Spacing"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light =
Shading"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List =
1"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List =
2"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid =
1"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid =
2"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid =
3"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful =
List"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful =
Grid"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" Name=3D"Revision"/>
<w:LsdException Locked=3D"false" Priority=3D"34" QFormat=3D"true" =
Name=3D"List Paragraph"/>
<w:LsdException Locked=3D"false" Priority=3D"29" QFormat=3D"true" =
Name=3D"Quote"/>
<w:LsdException Locked=3D"false" Priority=3D"30" QFormat=3D"true" =
Name=3D"Intense Quote"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"19" QFormat=3D"true" =
Name=3D"Subtle Emphasis"/>
<w:LsdException Locked=3D"false" Priority=3D"21" QFormat=3D"true" =
Name=3D"Intense Emphasis"/>
<w:LsdException Locked=3D"false" Priority=3D"31" QFormat=3D"true" =
Name=3D"Subtle Reference"/>
<w:LsdException Locked=3D"false" Priority=3D"32" QFormat=3D"true" =
Name=3D"Intense Reference"/>
<w:LsdException Locked=3D"false" Priority=3D"33" QFormat=3D"true" =
Name=3D"Book Title"/>
<w:LsdException Locked=3D"false" Priority=3D"37" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Bibliography"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"TOC Heading"/>
<w:LsdException Locked=3D"false" Priority=3D"41" Name=3D"Plain Table =
1"/>
<w:LsdException Locked=3D"false" Priority=3D"42" Name=3D"Plain Table =
2"/>
<w:LsdException Locked=3D"false" Priority=3D"43" Name=3D"Plain Table =
3"/>
<w:LsdException Locked=3D"false" Priority=3D"44" Name=3D"Plain Table =
4"/>
<w:LsdException Locked=3D"false" Priority=3D"45" Name=3D"Plain Table =
5"/>
<w:LsdException Locked=3D"false" Priority=3D"40" Name=3D"Grid Table =
Light"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 6"/>
</w:LatentStyles>
</xml><![endif]--><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-536869121 1107305727 33554432 0 415 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-469750017 -1073732485 9 0 511 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman",serif;
	mso-fareast-font-family:Calibri;}
a:link, span.MsoHyperlink
	{mso-style-noshow:yes;
	mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-noshow:yes;
	mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;
	text-underline:single;}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-style-unhide:no;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman",serif;
	mso-fareast-font-family:Calibri;}
span.EmailStyle18
	{mso-style-type:personal-reply;
	mso-style-noshow:yes;
	mso-style-unhide:no;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:11.0pt;
	font-family:"Courier New";
	mso-ascii-font-family:"Courier New";
	mso-hansi-font-family:"Courier New";
	mso-bidi-font-family:"Times New Roman";
	color:#1F497D;}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	font-family:"Calibri",sans-serif;
	mso-ascii-font-family:Calibri;
	mso-fareast-font-family:Calibri;
	mso-hansi-font-family:Calibri;
	mso-bidi-font-family:"Times New Roman";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 10]><style>/* Style Definitions */
table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-ascii-font-family:Calibri;
	mso-hansi-font-family:Calibri;
	mso-bidi-font-family:"Times New Roman";
	mso-fareast-language:EN-US;}
</style><![endif]--><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-GB =
link=3D"#0563C1" vlink=3D"#954F72" style=3D'tab-interval:36.0pt'><div =
class=3DWordSection1><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'>Hi =
Troy,<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span>=
</p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><span =
style=3D'mso-spacerun:yes'>=C2=A0 </span>Thanks for the analysis. We =
always seem to be working round Microsoft=E2=80=99s insistence in =
steadily making co-installers more broken whilst not offering an =
alternative. If the DIF_SELECTBESTCOMPATDRV works then I guess we go =
with that. Similarly we should guard <span =
class=3DSpellE>DifInstall</span> as you suggest.<o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span>=
</p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><span =
style=3D'mso-spacerun:yes'>=C2=A0 </span>Cheers,<o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span>=
</p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><span =
style=3D'mso-spacerun:yes'>=C2=A0=C2=A0=C2=A0 =
</span>Paul<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span>=
</p><div style=3D'border:none;border-left:solid blue 1.5pt;padding:0cm =
0cm 0cm 4.0pt'><div><div style=3D'border:none;border-top:solid #E1E1E1 =
1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=3DMsoNormal><b><span =
lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-fo=
nt-family:"Times New =
Roman";mso-ansi-language:EN-US'>From:</span></b><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-fo=
nt-family:"Times New Roman";mso-ansi-language:EN-US'> win-pv-devel =
&lt;win-pv-devel-bounces@lists.xenproject.org&gt; <b>On Behalf Of =
</b>Troy Crosley<br><b>Sent:</b> 22 October 2020 13:04<br><b>To:</b> =
win-pv-devel@lists.xenproject.org<br><b>Subject:</b> Driver =
uninstallation issues<o:p></o:p></span></p></div></div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal>In =
Windows 10 version 2004, The coinstallers' DIF_INSTALLDEVICE routines do =
not get called on driver uninstall (via e.g. Apps &amp; Features). In =
previous versions of Windows, this occurs as part of the uninstall =
during the null device install and is the only time DifRemove gets =
called to perform cleanup. We found a workaround by calling DifRemove =
(in the case of null drivers) from DIF_SELECTBESTCOMPATDRV, which is the =
only coinstaller request that seems to happen on uninstall in Windows 10 =
version 2004. I am wondering if there's a better way to address this =
issue that would be appropriate for the Xen Project.<br><br>I also found =
that the null driver detection in DIF_INSTALLDEVICE is insufficient (I =
last tested it on Windows 10 version 1803), causing DifInstall to be =
called rather than DifRemove during null driver installation. =
Specifically, DriverInfoAvailable gets set to TRUE rather than FALSE as =
expected for null drivers. I worked around this issue by additionally =
checking to see if DriverInfoData.DriverType was equal to =
SPDIT_CLASSDRIVER or SPDIT_COMPATDRIVER.<o:p></o:p></p><div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p =
class=3DMsoNormal>Troy<o:p></o:p></p></div></div></div></div></body></htm=
l>
------=_NextPart_000_002A_01D6A965.BC771480--



From win-pv-devel-bounces@lists.xenproject.org Wed Oct 28 19:19:41 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 28 Oct 2020 19:19:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13830.34592 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kXqyx-0001np-IW; Wed, 28 Oct 2020 19:19:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13830.34592; Wed, 28 Oct 2020 19:19:39 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kXqyx-0001ni-FQ; Wed, 28 Oct 2020 19:19:39 +0000
Received: by outflank-mailman (input) for mailman id 13830;
 Wed, 28 Oct 2020 19:19:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=WxFO=ED=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kXqyv-0001nd-Kf
 for win-pv-devel@lists.xenproject.org; Wed, 28 Oct 2020 19:19:37 +0000
Received: from mail-ej1-x631.google.com (unknown [2a00:1450:4864:20::631])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2aef2b38-a4ba-4968-828c-2623034ba94b;
 Wed, 28 Oct 2020 19:19:36 +0000 (UTC)
Received: by mail-ej1-x631.google.com with SMTP id bn26so463291ejb.6
 for <win-pv-devel@lists.xenproject.org>; Wed, 28 Oct 2020 12:19:36 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=WxFO=ED=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kXqyv-0001nd-Kf
	for win-pv-devel@lists.xenproject.org; Wed, 28 Oct 2020 19:19:37 +0000
X-Inumbo-ID: 2aef2b38-a4ba-4968-828c-2623034ba94b
Received: from mail-ej1-x631.google.com (unknown [2a00:1450:4864:20::631])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2aef2b38-a4ba-4968-828c-2623034ba94b;
	Wed, 28 Oct 2020 19:19:36 +0000 (UTC)
Received: by mail-ej1-x631.google.com with SMTP id bn26so463291ejb.6
        for <win-pv-devel@lists.xenproject.org>; Wed, 28 Oct 2020 12:19:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=mzoLLwGt2DwhiUW4f14f22/DkphWY8nQYlZCeCtnXFA=;
        b=SIxVwYDWANLCPIz4JB5aqVs16s6EuysCIGfWN7961ExZ9zHueaYXRB+HDTtR+71eZ0
         xti2tOP+H1egQwZnsuKDG1ufclUlzRSnT5wxf15YF1VLREdB/KhofzK7PMF5wKTw789b
         4J5os449a+cqvM8HsJEeLfxS8ciiu9M3yihy4tUrjRvmFLZLjfijLdY40CLXWV6JJ0GJ
         SkEm1Rcs+2zD6Dq5BC0km3PJCNYd5WwYRKR929OE2LpDTRw0d+fFWZAZCCHUgMxxHrQk
         5pWSW2Wt9EmWmkw5rqZzASevtMX/BEtdsY1oJ6/ryfRKg8j/c3FBRYJtfhQhfaB0BZz5
         c49w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=mzoLLwGt2DwhiUW4f14f22/DkphWY8nQYlZCeCtnXFA=;
        b=KcjlON+sNX72oTqQpC1aa4zMIfUbV6yDoep7OgbHzmmviTZs3/UbVj+0jDHrR4hjvE
         YlLhZm/cayN+vhPK47X2Vi0ITtx9fMfNcIcdJ3EU4NqnEkr64il1O0wlhiI/sTOgRyFQ
         1atjqEMPbqXHkYSWKJ61VerQw/R3exngG1/P+sunfZ8p8B50NN0AO3nLCvGjrRlMzPY2
         kSBXOnzH4DrWIv03VWVwtP4gpelQbOhplXGVXqxPEp8dR4Wvi8EczN7si/lw5HkZfr6e
         gnMsvh06LWZbzJZm6zMI/1gnTC5d03f+jXL5NB5V/HR4V4xJ802lJBsBVJXAzCjVqfRQ
         fdjg==
X-Gm-Message-State: AOAM5331YknuaAHEk37NUsgr6e8AbjHt6/cdxiVNQF+3BvkN0T0/Kbus
	wL/XXiNOoZVu0TTErTzQBXU9K/hh3zcsvUKWmywMAX2s0xM=
X-Google-Smtp-Source: ABdhPJzw67kF6UAvS+/xkum0ZA528J9Aupa0VIGVe+1Z8SjcS+vazoiQSUjULUpdz+HLidyqylpr3A5V5kV582xhzDw=
X-Received: by 2002:a17:906:2e0e:: with SMTP id n14mr617545eji.120.1603912775549;
 Wed, 28 Oct 2020 12:19:35 -0700 (PDT)
MIME-Version: 1.0
References: <CAOBjErLKhTy6h-0Xs9EmhiPjsx6_CtMfp1X+vA6uF9=V6XX5Fg@mail.gmail.com>
 <002901d6a95d$5ab17400$10145c00$@xen.org>
In-Reply-To: <002901d6a95d$5ab17400$10145c00$@xen.org>
From: Troy Crosley <troycrosley@gmail.com>
Date: Wed, 28 Oct 2020 15:19:24 -0400
Message-ID: <CAOBjEr+Y=PskZ3=dnEz8LKWYRhJWgn7mSZ7OT3suKfkG9biQRA@mail.gmail.com>
Subject: Re: Driver uninstallation issues
To: paul@xen.org
Cc: win-pv-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="0000000000003cc9e505b2c00b19"

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

Okay, I can submit patches with those changes. Is there anything specific
that coinstallers do that cannot be done through universal inf files (which
seem to be what Microsoft is encouraging)?

Troy

On Fri, Oct 23, 2020 at 12:55 PM Paul Durrant <xadimgnik@gmail.com> wrote:

> Hi Troy,
>
>
>
>   Thanks for the analysis. We always seem to be working round Microsoft=
=E2=80=99s
> insistence in steadily making co-installers more broken whilst not offeri=
ng
> an alternative. If the DIF_SELECTBESTCOMPATDRV works then I guess we go
> with that. Similarly we should guard DifInstall as you suggest.
>
>
>
>   Cheers,
>
>
>
>     Paul
>
>
>
> *From:* win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> *On
> Behalf Of *Troy Crosley
> *Sent:* 22 October 2020 13:04
> *To:* win-pv-devel@lists.xenproject.org
> *Subject:* Driver uninstallation issues
>
>
>
> In Windows 10 version 2004, The coinstallers' DIF_INSTALLDEVICE routines
> do not get called on driver uninstall (via e.g. Apps & Features). In
> previous versions of Windows, this occurs as part of the uninstall during
> the null device install and is the only time DifRemove gets called to
> perform cleanup. We found a workaround by calling DifRemove (in the case =
of
> null drivers) from DIF_SELECTBESTCOMPATDRV, which is the only coinstaller
> request that seems to happen on uninstall in Windows 10 version 2004. I a=
m
> wondering if there's a better way to address this issue that would be
> appropriate for the Xen Project.
>
> I also found that the null driver detection in DIF_INSTALLDEVICE is
> insufficient (I last tested it on Windows 10 version 1803), causing
> DifInstall to be called rather than DifRemove during null driver
> installation. Specifically, DriverInfoAvailable gets set to TRUE rather
> than FALSE as expected for null drivers. I worked around this issue by
> additionally checking to see if DriverInfoData.DriverType was equal to
> SPDIT_CLASSDRIVER or SPDIT_COMPATDRIVER.
>
>
>
> Troy
>

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

<div dir=3D"ltr">Okay, I can submit patches with those changes. Is there an=
ything specific that coinstallers do that cannot be done through universal =
inf files (which seem to be what Microsoft is encouraging)?<br><br>Troy<br>=
</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">=
On Fri, Oct 23, 2020 at 12:55 PM Paul Durrant &lt;<a href=3D"mailto:xadimgn=
ik@gmail.com">xadimgnik@gmail.com</a>&gt; wrote:<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex"><div lang=3D"EN-GB"><div class=3D"gmail-m_=
-5791956485498167867WordSection1"><p class=3D"MsoNormal"><span style=3D"fon=
t-size:10pt;font-family:&quot;Courier New&quot;;color:rgb(31,73,125)">Hi Tr=
oy,<u></u><u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size=
:10pt;font-family:&quot;Courier New&quot;;color:rgb(31,73,125)"><u></u>=C2=
=A0<u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:10pt;f=
ont-family:&quot;Courier New&quot;;color:rgb(31,73,125)"><span>=C2=A0 </spa=
n>Thanks for the analysis. We always seem to be working round Microsoft=E2=
=80=99s insistence in steadily making co-installers more broken whilst not =
offering an alternative. If the DIF_SELECTBESTCOMPATDRV works then I guess =
we go with that. Similarly we should guard <span class=3D"gmail-m_-57919564=
85498167867SpellE">DifInstall</span> as you suggest.<u></u><u></u></span></=
p><p class=3D"MsoNormal"><span style=3D"font-size:10pt;font-family:&quot;Co=
urier New&quot;;color:rgb(31,73,125)"><u></u>=C2=A0<u></u></span></p><p cla=
ss=3D"MsoNormal"><span style=3D"font-size:10pt;font-family:&quot;Courier Ne=
w&quot;;color:rgb(31,73,125)"><span>=C2=A0 </span>Cheers,<u></u><u></u></sp=
an></p><p class=3D"MsoNormal"><span style=3D"font-size:10pt;font-family:&qu=
ot;Courier New&quot;;color:rgb(31,73,125)"><u></u>=C2=A0<u></u></span></p><=
p class=3D"MsoNormal"><span style=3D"font-size:10pt;font-family:&quot;Couri=
er New&quot;;color:rgb(31,73,125)"><span>=C2=A0=C2=A0=C2=A0 </span>Paul<u><=
/u><u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:10pt;f=
ont-family:&quot;Courier New&quot;;color:rgb(31,73,125)"><u></u>=C2=A0<u></=
u></span></p><div style=3D"border-top:none;border-right:none;border-bottom:=
none;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 4pt"><div><div style=
=3D"border-right:none;border-bottom:none;border-left:none;border-top:1pt so=
lid rgb(225,225,225);padding:3pt 0cm 0cm"><p class=3D"MsoNormal"><b><span l=
ang=3D"EN-US" style=3D"font-size:11pt;font-family:Calibri,sans-serif">From:=
</span></b><span lang=3D"EN-US" style=3D"font-size:11pt;font-family:Calibri=
,sans-serif"> win-pv-devel &lt;<a href=3D"mailto:win-pv-devel-bounces@lists=
.xenproject.org" target=3D"_blank">win-pv-devel-bounces@lists.xenproject.or=
g</a>&gt; <b>On Behalf Of </b>Troy Crosley<br><b>Sent:</b> 22 October 2020 =
13:04<br><b>To:</b> <a href=3D"mailto:win-pv-devel@lists.xenproject.org" ta=
rget=3D"_blank">win-pv-devel@lists.xenproject.org</a><br><b>Subject:</b> Dr=
iver uninstallation issues<u></u><u></u></span></p></div></div><p class=3D"=
MsoNormal"><u></u>=C2=A0<u></u></p><div><p class=3D"MsoNormal">In Windows 1=
0 version 2004, The coinstallers&#39; DIF_INSTALLDEVICE routines do not get=
 called on driver uninstall (via e.g. Apps &amp; Features). In previous ver=
sions of Windows, this occurs as part of the uninstall during the null devi=
ce install and is the only time DifRemove gets called to perform cleanup. W=
e found a workaround by calling DifRemove (in the case of null drivers) fro=
m DIF_SELECTBESTCOMPATDRV, which is the only coinstaller request that seems=
 to happen on uninstall in Windows 10 version 2004. I am wondering if there=
&#39;s a better way to address this issue that would be appropriate for the=
 Xen Project.<br><br>I also found that the null driver detection in DIF_INS=
TALLDEVICE is insufficient (I last tested it on Windows 10 version 1803), c=
ausing DifInstall to be called rather than DifRemove during null driver ins=
tallation. Specifically, DriverInfoAvailable gets set to TRUE rather than F=
ALSE as expected for null drivers. I worked around this issue by additional=
ly checking to see if DriverInfoData.DriverType was equal to SPDIT_CLASSDRI=
VER or SPDIT_COMPATDRIVER.<u></u><u></u></p><div><p class=3D"MsoNormal"><u>=
</u>=C2=A0<u></u></p></div><div><p class=3D"MsoNormal">Troy<u></u><u></u></=
p></div></div></div></div></div></blockquote></div>

--0000000000003cc9e505b2c00b19--


From win-pv-devel-bounces@lists.xenproject.org Wed Oct 28 19:53:23 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 28 Oct 2020 19:53:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13883.34727 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kXrVZ-0006Km-RG; Wed, 28 Oct 2020 19:53:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13883.34727; Wed, 28 Oct 2020 19:53:21 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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 1kXrVZ-0006Kf-O6; Wed, 28 Oct 2020 19:53:21 +0000
Received: by outflank-mailman (input) for mailman id 13883;
 Wed, 28 Oct 2020 19:53:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=we2c=ED=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
 id 1kXrVY-0006Jv-9P
 for win-pv-devel@lists.xenproject.org; Wed, 28 Oct 2020 19:53:20 +0000
Received: from mail-wr1-x42f.google.com (unknown [2a00:1450:4864:20::42f])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 16a46e00-a1d5-437d-b2b2-dcc4a7641434;
 Wed, 28 Oct 2020 19:53:18 +0000 (UTC)
Received: by mail-wr1-x42f.google.com with SMTP id n15so393758wrq.2
 for <win-pv-devel@lists.xenproject.org>; Wed, 28 Oct 2020 12:53:18 -0700 (PDT)
Received: from CBGR90WXYV0 (54-240-197-238.amazon.com. [54.240.197.238])
 by smtp.gmail.com with ESMTPSA id z191sm630973wme.30.2020.10.28.12.53.16
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 28 Oct 2020 12:53:17 -0700 (PDT)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=we2c=ED=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
	id 1kXrVY-0006Jv-9P
	for win-pv-devel@lists.xenproject.org; Wed, 28 Oct 2020 19:53:20 +0000
X-Inumbo-ID: 16a46e00-a1d5-437d-b2b2-dcc4a7641434
Received: from mail-wr1-x42f.google.com (unknown [2a00:1450:4864:20::42f])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 16a46e00-a1d5-437d-b2b2-dcc4a7641434;
	Wed, 28 Oct 2020 19:53:18 +0000 (UTC)
Received: by mail-wr1-x42f.google.com with SMTP id n15so393758wrq.2
        for <win-pv-devel@lists.xenproject.org>; Wed, 28 Oct 2020 12:53:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-language:thread-index;
        bh=Xcp8L/4yamjmL39S3srOFRQj4Z5pm3qPdW8DVsHG+M4=;
        b=aYXyyOW6Db8Ha4sFBupmro+ImeiebFh21EAj6gQvyZYJ4086kzut7Witl3jPAQJGyo
         ZNqJhO8yX7pmTpSSjPT6pq9RyM5kMI9Rq0ZzB77o8T5jXqyI56kWKCpQ1iCy0thoFzpG
         ML6iyMOBkFkHBBGrAhWSPVI2SlDyO83PmXwPp62im8HtlR/VCAzl53+14p476j/mcRqa
         Z1NIP8QwvwYKpQWQG7DV06FQQG1YetZRTFWswU5d5MkKj4/gY25+ne2FPWwlOo4JAtWG
         TYUdO0FZC5iy8fkHnG/f5lJtQVGd3JerX94d+Z6xik8nRH/RPqkPvAFzYw88i2rSJUd6
         V0Vw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to
         :subject:date:message-id:mime-version:content-language:thread-index;
        bh=Xcp8L/4yamjmL39S3srOFRQj4Z5pm3qPdW8DVsHG+M4=;
        b=lG+DZLZTceNKMTTlRPmOpyBIAVuG41yRdnV41uDZeYIuh1HZbhCB3IF6nNFxTNnNQT
         DQSISRriup4UDPk95f+oePBEsked8f+A303FvRPElW8myXkFqbh5gvfChSogwtvtYV/g
         kk/TkzZccLz7YOQnB57AFC50oCrZLlf3SDjL/gicTCMkl/p7NKoZfSIGKNb7pqsk8AE7
         VeX5p6d14KgCIBnfaPmeZ/L2Y5N7mlTzIfNn2vyriLZp9ibXojAUdV6KQTZIsED0Er+v
         Orcj/QHu9dIF/P3HbNM+3wMsSnyCG1G8Jp5VZ9TWWITGah/TLVQky0KE8wbLQWcRUc04
         2KJg==
X-Gm-Message-State: AOAM531OKb+0xRIYy9VJwUz48rLe+bjOM+jlVUn4W8NisItHoyb6a8XN
	FiJZm6AeD8I4inrpYVTzcX8=
X-Google-Smtp-Source: ABdhPJwGR0AOMEv0Bx59cnShd0aQ+l8jDu5TAnzhvEQOVVwnRdGPnAwa+bz09g1C87TR4bUaZ34/BA==
X-Received: by 2002:adf:e681:: with SMTP id r1mr1041555wrm.181.1603914798066;
        Wed, 28 Oct 2020 12:53:18 -0700 (PDT)
Received: from CBGR90WXYV0 (54-240-197-238.amazon.com. [54.240.197.238])
        by smtp.gmail.com with ESMTPSA id z191sm630973wme.30.2020.10.28.12.53.16
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 28 Oct 2020 12:53:17 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: "Paul Durrant" <paul@xen.org>
Reply-To: <paul@xen.org>
To: "'Troy Crosley'" <troycrosley@gmail.com>
Cc: <win-pv-devel@lists.xenproject.org>
References: <CAOBjErLKhTy6h-0Xs9EmhiPjsx6_CtMfp1X+vA6uF9=V6XX5Fg@mail.gmail.com> <002901d6a95d$5ab17400$10145c00$@xen.org> <CAOBjEr+Y=PskZ3=dnEz8LKWYRhJWgn7mSZ7OT3suKfkG9biQRA@mail.gmail.com>
In-Reply-To: <CAOBjEr+Y=PskZ3=dnEz8LKWYRhJWgn7mSZ7OT3suKfkG9biQRA@mail.gmail.com>
Subject: RE: Driver uninstallation issues
Date: Wed, 28 Oct 2020 19:53:16 -0000
Message-ID: <00f101d6ad63$faaa4a40$effedec0$@xen.org>
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_00F2_01D6AD63.FAABD0E0"
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-gb
Thread-Index: AQJomq4nVJNXvjWGoRG7rAHXKHT0mwIruPRWAb58D/Koaj3ywA==

This is a multipart message in MIME format.

------=_NextPart_000_00F2_01D6AD63.FAABD0E0
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Hi Troy,
=20
  Yes, we hang onto to co-installers because in some cases they do =
indeed do that cannot be done via INF files as it is dynamic in nature. =
Some of them do compatibility checks with drivers of child devices to =
make sure they do not update a parent driver where no compatible child =
driver is installed. Some of them also clear =E2=80=98unplug=E2=80=99 =
keys to make sure that the system doesn=E2=80=99t BSOD due to lack of a =
critical device after uninstallation and reboot.
=20
  Cheers,
=20
    Paul
=20
=20
From: Troy Crosley <troycrosley@gmail.com>=20
Sent: 28 October 2020 19:19
To: paul@xen.org
Cc: win-pv-devel@lists.xenproject.org
Subject: Re: Driver uninstallation issues
=20
Okay, I can submit patches with those changes. Is there anything =
specific that coinstallers do that cannot be done through universal inf =
files (which seem to be what Microsoft is encouraging)?

Troy
=20
On Fri, Oct 23, 2020 at 12:55 PM Paul Durrant <xadimgnik@gmail.com =
<mailto:xadimgnik@gmail.com> > wrote:
Hi Troy,
=20
  Thanks for the analysis. We always seem to be working round =
Microsoft=E2=80=99s insistence in steadily making co-installers more =
broken whilst not offering an alternative. If the =
DIF_SELECTBESTCOMPATDRV works then I guess we go with that. Similarly we =
should guard DifInstall as you suggest.
=20
  Cheers,
=20
    Paul
=20
From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org =
<mailto:win-pv-devel-bounces@lists.xenproject.org> > On Behalf Of Troy =
Crosley
Sent: 22 October 2020 13:04
To: win-pv-devel@lists.xenproject.org =
<mailto:win-pv-devel@lists.xenproject.org>=20
Subject: Driver uninstallation issues
=20
In Windows 10 version 2004, The coinstallers' DIF_INSTALLDEVICE routines =
do not get called on driver uninstall (via e.g. Apps & Features). In =
previous versions of Windows, this occurs as part of the uninstall =
during the null device install and is the only time DifRemove gets =
called to perform cleanup. We found a workaround by calling DifRemove =
(in the case of null drivers) from DIF_SELECTBESTCOMPATDRV, which is the =
only coinstaller request that seems to happen on uninstall in Windows 10 =
version 2004. I am wondering if there's a better way to address this =
issue that would be appropriate for the Xen Project.

I also found that the null driver detection in DIF_INSTALLDEVICE is =
insufficient (I last tested it on Windows 10 version 1803), causing =
DifInstall to be called rather than DifRemove during null driver =
installation. Specifically, DriverInfoAvailable gets set to TRUE rather =
than FALSE as expected for null drivers. I worked around this issue by =
additionally checking to see if DriverInfoData.DriverType was equal to =
SPDIT_CLASSDRIVER or SPDIT_COMPATDRIVER.
=20
Troy

------=_NextPart_000_00F2_01D6AD63.FAABD0E0
Content-Type: text/html;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta =
name=3DProgId content=3DWord.Document><meta name=3DGenerator =
content=3D"Microsoft Word 15"><meta name=3DOriginator =
content=3D"Microsoft Word 15"><link rel=3DFile-List =
href=3D"cid:filelist.xml@01D6AD63.ED55F790"><!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:SpellingState>Clean</w:SpellingState>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:EnvelopeVis/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-GB</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:DoNotExpandShiftReturn/>
<w:BreakWrappedTables/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=3D"Cambria Math"/>
<m:brkBin m:val=3D"before"/>
<m:brkBinSub m:val=3D"&#45;-"/>
<m:smallFrac m:val=3D"off"/>
<m:dispDef/>
<m:lMargin m:val=3D"0"/>
<m:rMargin m:val=3D"0"/>
<m:defJc m:val=3D"centerGroup"/>
<m:wrapIndent m:val=3D"1440"/>
<m:intLim m:val=3D"subSup"/>
<m:naryLim m:val=3D"undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState=3D"false" DefUnhideWhenUsed=3D"false" =
DefSemiHidden=3D"false" DefQFormat=3D"false" DefPriority=3D"99" =
LatentStyleCount=3D"371">
<w:LsdException Locked=3D"false" Priority=3D"0" QFormat=3D"true" =
Name=3D"Normal"/>
<w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" =
Name=3D"heading 1"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 2"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 3"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 4"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 5"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 6"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 7"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 8"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"heading 9"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 6"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 7"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 8"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index 9"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 1"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 2"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 3"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 4"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 5"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 6"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 7"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 8"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toc 9"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Normal Indent"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"footnote text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"annotation text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"header"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"footer"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"index heading"/>
<w:LsdException Locked=3D"false" Priority=3D"35" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"caption"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"table of figures"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"envelope address"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"envelope return"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"footnote reference"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"annotation reference"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"line number"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"page number"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"endnote reference"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"endnote text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"table of authorities"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"macro"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"toa heading"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Bullet 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Number 5"/>
<w:LsdException Locked=3D"false" Priority=3D"10" QFormat=3D"true" =
Name=3D"Title"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Closing"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Signature"/>
<w:LsdException Locked=3D"false" Priority=3D"1" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Default Paragraph Font"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text Indent"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"List Continue 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Message Header"/>
<w:LsdException Locked=3D"false" Priority=3D"11" QFormat=3D"true" =
Name=3D"Subtitle"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Salutation"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Date"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text First Indent"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text First Indent 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Note Heading"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text Indent 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Body Text Indent 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Block Text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Hyperlink"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"FollowedHyperlink"/>
<w:LsdException Locked=3D"false" Priority=3D"22" QFormat=3D"true" =
Name=3D"Strong"/>
<w:LsdException Locked=3D"false" Priority=3D"20" QFormat=3D"true" =
Name=3D"Emphasis"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Document Map"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Plain Text"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"E-mail Signature"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Top of Form"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Bottom of Form"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Normal (Web)"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Acronym"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Address"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Cite"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Code"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Definition"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Keyboard"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Preformatted"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Sample"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Typewriter"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"HTML Variable"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Normal Table"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"annotation subject"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"No List"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Outline List 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Outline List 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Outline List 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Simple 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Simple 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Simple 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Classic 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Classic 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Classic 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Classic 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Colorful 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Colorful 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Colorful 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Columns 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 6"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 7"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Grid 8"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 4"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 5"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 6"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 7"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table List 8"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table 3D effects 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table 3D effects 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table 3D effects 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Contemporary"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Elegant"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Professional"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Subtle 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Subtle 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Web 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Web 2"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Web 3"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Balloon Text"/>
<w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"Table Grid"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Table Theme"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" Name=3D"Placeholder =
Text"/>
<w:LsdException Locked=3D"false" Priority=3D"1" QFormat=3D"true" =
Name=3D"No Spacing"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light =
Shading"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List =
1"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List =
2"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid =
1"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid =
2"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid =
3"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful =
List"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful =
Grid"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 1"/>
<w:LsdException Locked=3D"false" SemiHidden=3D"true" Name=3D"Revision"/>
<w:LsdException Locked=3D"false" Priority=3D"34" QFormat=3D"true" =
Name=3D"List Paragraph"/>
<w:LsdException Locked=3D"false" Priority=3D"29" QFormat=3D"true" =
Name=3D"Quote"/>
<w:LsdException Locked=3D"false" Priority=3D"30" QFormat=3D"true" =
Name=3D"Intense Quote"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"60" Name=3D"Light Shading =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"61" Name=3D"Light List =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"62" Name=3D"Light Grid =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"63" Name=3D"Medium Shading =
1 Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"64" Name=3D"Medium Shading =
2 Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"65" Name=3D"Medium List 1 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"66" Name=3D"Medium List 2 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"67" Name=3D"Medium Grid 1 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"68" Name=3D"Medium Grid 2 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"69" Name=3D"Medium Grid 3 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"70" Name=3D"Dark List =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"71" Name=3D"Colorful =
Shading Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"72" Name=3D"Colorful List =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"73" Name=3D"Colorful Grid =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"19" QFormat=3D"true" =
Name=3D"Subtle Emphasis"/>
<w:LsdException Locked=3D"false" Priority=3D"21" QFormat=3D"true" =
Name=3D"Intense Emphasis"/>
<w:LsdException Locked=3D"false" Priority=3D"31" QFormat=3D"true" =
Name=3D"Subtle Reference"/>
<w:LsdException Locked=3D"false" Priority=3D"32" QFormat=3D"true" =
Name=3D"Intense Reference"/>
<w:LsdException Locked=3D"false" Priority=3D"33" QFormat=3D"true" =
Name=3D"Book Title"/>
<w:LsdException Locked=3D"false" Priority=3D"37" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" Name=3D"Bibliography"/>
<w:LsdException Locked=3D"false" Priority=3D"39" SemiHidden=3D"true" =
UnhideWhenUsed=3D"true" QFormat=3D"true" Name=3D"TOC Heading"/>
<w:LsdException Locked=3D"false" Priority=3D"41" Name=3D"Plain Table =
1"/>
<w:LsdException Locked=3D"false" Priority=3D"42" Name=3D"Plain Table =
2"/>
<w:LsdException Locked=3D"false" Priority=3D"43" Name=3D"Plain Table =
3"/>
<w:LsdException Locked=3D"false" Priority=3D"44" Name=3D"Plain Table =
4"/>
<w:LsdException Locked=3D"false" Priority=3D"45" Name=3D"Plain Table =
5"/>
<w:LsdException Locked=3D"false" Priority=3D"40" Name=3D"Grid Table =
Light"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"Grid Table 1 =
Light Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"Grid Table 2 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"Grid Table 3 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"Grid Table 4 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"Grid Table 5 =
Dark Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"Grid Table 6 =
Colorful Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"Grid Table 7 =
Colorful Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"46" Name=3D"List Table 1 =
Light Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"47" Name=3D"List Table 2 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"48" Name=3D"List Table 3 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"49" Name=3D"List Table 4 =
Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"50" Name=3D"List Table 5 =
Dark Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"51" Name=3D"List Table 6 =
Colorful Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"52" Name=3D"List Table 7 =
Colorful Accent 6"/>
</w:LatentStyles>
</xml><![endif]--><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-536869121 1107305727 33554432 0 415 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-469750017 -1073732485 9 0 511 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman",serif;
	mso-fareast-font-family:Calibri;}
a:link, span.MsoHyperlink
	{mso-style-noshow:yes;
	mso-style-priority:99;
	color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-noshow:yes;
	mso-style-priority:99;
	color:purple;
	text-decoration:underline;
	text-underline:single;}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-style-unhide:no;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman",serif;
	mso-fareast-font-family:Calibri;}
span.gmail-m-5791956485498167867spelle
	{mso-style-name:gmail-m_-5791956485498167867spelle;
	mso-style-unhide:no;}
span.EmailStyle19
	{mso-style-type:personal-reply;
	mso-style-noshow:yes;
	mso-style-unhide:no;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:11.0pt;
	font-family:"Courier New";
	mso-ascii-font-family:"Courier New";
	mso-hansi-font-family:"Courier New";
	mso-bidi-font-family:"Times New Roman";
	color:#1F497D;}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	font-family:"Calibri",sans-serif;
	mso-ascii-font-family:Calibri;
	mso-fareast-font-family:Calibri;
	mso-hansi-font-family:Calibri;
	mso-bidi-font-family:"Times New Roman";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 10]><style>/* Style Definitions */
table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-ascii-font-family:Calibri;
	mso-hansi-font-family:Calibri;
	mso-bidi-font-family:"Times New Roman";
	mso-fareast-language:EN-US;}
</style><![endif]--><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-GB link=3Dblue =
vlink=3Dpurple style=3D'tab-interval:36.0pt'><div =
class=3DWordSection1><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'>Hi =
Troy,<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span>=
</p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><span =
style=3D'mso-spacerun:yes'>=C2=A0 </span>Yes, we hang onto to =
co-installers because in some cases they do indeed do that cannot be =
done via INF files as it is dynamic in nature. Some of them do =
compatibility checks with drivers of child devices to make sure they do =
not update a parent driver where no compatible child driver is =
installed. Some of them also clear =E2=80=98unplug=E2=80=99 keys to make =
sure that the system doesn=E2=80=99t BSOD due to lack of a critical =
device after uninstallation and reboot.<o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span>=
</p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><span =
style=3D'mso-spacerun:yes'>=C2=A0 </span>Cheers,<o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span>=
</p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><span =
style=3D'mso-spacerun:yes'>=C2=A0=C2=A0=C2=A0 =
</span>Paul<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span>=
</p><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:"Courier =
New";mso-bidi-font-family:"Times New =
Roman";color:#1F497D;mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span>=
</p><div style=3D'border:none;border-left:solid blue 1.5pt;padding:0cm =
0cm 0cm 4.0pt'><div><div style=3D'border:none;border-top:solid #E1E1E1 =
1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=3DMsoNormal><b><span =
lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-fo=
nt-family:"Times New =
Roman";mso-ansi-language:EN-US'>From:</span></b><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-fo=
nt-family:"Times New Roman";mso-ansi-language:EN-US'> Troy Crosley =
&lt;troycrosley@gmail.com&gt; <br><b>Sent:</b> 28 October 2020 =
19:19<br><b>To:</b> paul@xen.org<br><b>Cc:</b> =
win-pv-devel@lists.xenproject.org<br><b>Subject:</b> Re: Driver =
uninstallation issues<o:p></o:p></span></p></div></div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal>Okay, I =
can submit patches with those changes. Is there anything specific that =
coinstallers do that cannot be done through universal inf files (which =
seem to be what Microsoft is =
encouraging)?<br><br>Troy<o:p></o:p></p></div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><div><p class=3DMsoNormal>On =
Fri, Oct 23, 2020 at 12:55 PM Paul Durrant &lt;<a =
href=3D"mailto:xadimgnik@gmail.com">xadimgnik@gmail.com</a>&gt; =
wrote:<o:p></o:p></p></div><blockquote =
style=3D'border:none;border-left:solid #CCCCCC =
1.0pt;mso-border-left-alt:solid #CCCCCC .75pt;padding:0cm 0cm 0cm =
6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
style=3D'font-size:10.0pt;font-family:"Courier New";color:#1F497D'>Hi =
Troy,</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:#1F497D'>&nbsp; Thanks for the analysis. We always seem to be =
working round Microsoft=E2=80=99s insistence in steadily making =
co-installers more broken whilst not offering an alternative. If the =
DIF_SELECTBESTCOMPATDRV works then I guess we go with that. Similarly we =
should guard <span =
class=3Dgmail-m-5791956485498167867spelle>DifInstall</span> as you =
suggest.</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:#1F497D'>&nbsp; Cheers,</span><o:p></o:p></p><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:#1F497D'>&nbsp;&nbsp;&nbsp; Paul</span><o:p></o:p></p><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:#1F497D'>&nbsp;</span><o:p></o:p></p><div =
style=3D'border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm =
4.0pt'><div><div style=3D'border:none;border-top:solid #E1E1E1 =
1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-outline-l=
evel:1'><b><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif;mso-ansi-langu=
age:EN-US'>From:</span></b><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif;mso-ansi-langu=
age:EN-US'> win-pv-devel &lt;<a =
href=3D"mailto:win-pv-devel-bounces@lists.xenproject.org" =
target=3D"_blank">win-pv-devel-bounces@lists.xenproject.org</a>&gt; =
<b>On Behalf Of </b>Troy Crosley<br><b>Sent:</b> 22 October 2020 =
13:04<br><b>To:</b> <a href=3D"mailto:win-pv-devel@lists.xenproject.org" =
target=3D"_blank">win-pv-devel@lists.xenproject.org</a><br><b>Subject:</b=
> Driver uninstallation issues</span><o:p></o:p></p></div></div><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p><=
/o:p></p><div><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>In Windows =
10 version 2004, The coinstallers' DIF_INSTALLDEVICE routines do not get =
called on driver uninstall (via e.g. Apps &amp; Features). In previous =
versions of Windows, this occurs as part of the uninstall during the =
null device install and is the only time DifRemove gets called to =
perform cleanup. We found a workaround by calling DifRemove (in the case =
of null drivers) from DIF_SELECTBESTCOMPATDRV, which is the only =
coinstaller request that seems to happen on uninstall in Windows 10 =
version 2004. I am wondering if there's a better way to address this =
issue that would be appropriate for the Xen Project.<br><br>I also found =
that the null driver detection in DIF_INSTALLDEVICE is insufficient (I =
last tested it on Windows 10 version 1803), causing DifInstall to be =
called rather than DifRemove during null driver installation. =
Specifically, DriverInfoAvailable gets set to TRUE rather than FALSE as =
expected for null drivers. I worked around this issue by additionally =
checking to see if DriverInfoData.DriverType was equal to =
SPDIT_CLASSDRIVER or SPDIT_COMPATDRIVER.<o:p></o:p></p><div><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p><=
/o:p></p></div><div><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Troy<o:p></o=
:p></p></div></div></div></div></div></blockquote></div></div></div></bod=
y></html>
------=_NextPart_000_00F2_01D6AD63.FAABD0E0--



