<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 28, 2016 at 4:30 PM, Christophe Fergeau <span dir="ltr"><<a href="mailto:cfergeau@redhat.com" target="_blank">cfergeau@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Wed, Sep 28, 2016 at 02:09:26PM +0300, Sameeh Jubran wrote:<br>
> This patch replaces the "#pragma code_seg(push)" and "#pragma code_seg(pop)"<br>
> with __declspec(code_seg("PAGE")) for declaring code as pageable. This<br>
> change enahnces maintainability as it is much clearer which functions are paged.<br>
<br>
</span>s/enahnces/enhances/<br>
<br>
1/4 already adds PAGED_CODE at the beginning of each paged functions, do<br>
we really need to add a second reminder to each function? This also<br></blockquote><div>The PAGED_CODE is not a reminder it is a runtime assertion that makes</div><div>sure that these functions are not used in high IRQL. However __declspec(code_seg("PAGE"))</div><div>makes the function pageable. By default all of the driver code is not pageable, this</div><div>macro instructs the driver that those functions are pageable.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
adds it 2 times, once in the .h file and once in the .cpp file for more<br>
redundancy. Imo the current way it's done is enough (unless some<br>
functions which should be marked as pageable aren't).<br></blockquote><div>Adding them twice is required for compilation, it won't compile otherwise. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
If you want something explicit, what could be done instead is to<br>
explicitly mark the non-pageable functions so that these ones too can be<br>
seen at once, rather than having to look for what is missing from these<br>
functions declarations/definitions.<br></blockquote><div>We can do this using a combination of #pargma and declspec however this would be</div><div>very dangerous as one can easily make a mistake.</div><div><br></div><div>This patch can be dropped anyways as it offers a minor optimization.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
Christophe<br>
<div><div class="gmail-h5"><br>
><br>
> Signed-off-by: Sameeh Jubran <<a href="mailto:sameeh@daynix.com">sameeh@daynix.com</a>><br>
> ---<br>
>  qxldod/QxlDod.cpp | 140 ++++++++++++++++++++++++++++++<wbr>+++++++++++++-------<br>
>  qxldod/QxlDod.h   | 151 ++++++++++++++++++++++++++++++<wbr>+++++++++++++++++++++---<br>
>  2 files changed, 267 insertions(+), 24 deletions(-)<br>
><br>
> diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp<br>
> index ef21176..2bc6b77 100755<br>
> --- a/qxldod/QxlDod.cpp<br>
> +++ b/qxldod/QxlDod.cpp<br>
> @@ -2,8 +2,6 @@<br>
>  #include "qxldod.h"<br>
>  #include "qxl_windows.h"<br>
><br>
> -#pragma code_seg(push)<br>
> -#pragma code_seg()<br>
><br>
>  #define WIN_QXL_INT_MASK ((QXL_INTERRUPT_DISPLAY) | \<br>
>                            (QXL_INTERRUPT_CURSOR) | \<br>
> @@ -47,7 +45,6 @@ BYTE PixelMask[BITS_PER_BYTE]  = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01<br>
>                                         ((ULONG)LOWER_5_BITS((Pixel)) << SHIFT_LOWER_5_IN_565_BACK))<br>
><br>
><br>
> -#pragma code_seg(pop)<br>
><br>
>  struct QXLEscape {<br>
>      uint32_t ioctl;<br>
> @@ -57,6 +54,7 @@ struct QXLEscape {<br>
>      };<br>
>  };<br>
><br>
> +QXL_PAGED<br>
>  QxlDod::QxlDod(_In_ DEVICE_OBJECT* pPhysicalDeviceObject) : m_pPhysicalDevice(<wbr>pPhysicalDeviceObject),<br>
>                                                              m_MonitorPowerState(<wbr>PowerDeviceD0),<br>
>                                                              m_AdapterPowerState(<wbr>PowerDeviceD0)<br>
> @@ -73,7 +71,7 @@ QxlDod::QxlDod(_In_ DEVICE_OBJECT* pPhysicalDeviceObject) : m_pPhysicalDevice(pP<br>
>      DbgPrint(TRACE_LEVEL_<wbr>INFORMATION, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> -<br>
> +QXL_PAGED<br>
>  QxlDod::~QxlDod(void)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -82,6 +80,7 @@ QxlDod::~QxlDod(void)<br>
>      m_pHWDevice = NULL;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::CheckHardware()<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -119,6 +118,7 @@ NTSTATUS QxlDod::CheckHardware()<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::StartDevice(_In_  DXGK_START_INFO*   pDxgkStartInfo,<br>
>                           _In_  DXGKRNL_INTERFACE* pDxgkInterface,<br>
>                           _Out_ ULONG*             pNumberOfViews,<br>
> @@ -209,6 +209,7 @@ NTSTATUS QxlDod::StartDevice(_In_  DXGK_START_INFO*   pDxgkStartInfo,<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::StopDevice(VOID)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -216,6 +217,7 @@ NTSTATUS QxlDod::StopDevice(VOID)<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  VOID QxlDod::CleanUp(VOID)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -228,7 +230,7 @@ VOID QxlDod::CleanUp(VOID)<br>
>      }<br>
>  }<br>
><br>
> -<br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::DispatchIoRequest(_In_  ULONG VidPnSourceId,<br>
>                                     _In_  VIDEO_REQUEST_PACKET* pVideoRequestPacket)<br>
>  {<br>
> @@ -240,6 +242,7 @@ NTSTATUS QxlDod::DispatchIoRequest(_In_  ULONG VidPnSourceId,<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  PCHAR<br>
>  DbgDevicePowerString(<br>
>      __in DEVICE_POWER_STATE Type<br>
> @@ -265,6 +268,7 @@ DbgDevicePowerString(<br>
>      }<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  PCHAR<br>
>  DbgPowerActionString(<br>
>      __in POWER_ACTION Type<br>
> @@ -294,6 +298,7 @@ DbgPowerActionString(<br>
>      }<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::SetPowerState(_In_  ULONG HardwareUid,<br>
>                                 _In_  DEVICE_POWER_STATE DevicePowerState,<br>
>                                 _In_  POWER_ACTION       ActionType)<br>
> @@ -327,6 +332,7 @@ NTSTATUS QxlDod::SetPowerState(_In_  ULONG HardwareUid,<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::QueryChildRelations(_<wbr>Out_writes_bytes_(<wbr>ChildRelationsSize) DXGK_CHILD_DESCRIPTOR* pChildRelations,<br>
>                                       _In_  ULONG  ChildRelationsSize)<br>
>  {<br>
> @@ -356,6 +362,7 @@ NTSTATUS QxlDod::QueryChildRelations(_<wbr>Out_writes_bytes_(<wbr>ChildRelationsSize) DXGK<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::QueryChildStatus(_<wbr>Inout_ DXGK_CHILD_STATUS* pChildStatus,<br>
>                                                  _In_    BOOLEAN            NonDestructiveOnly)<br>
>  {<br>
> @@ -391,6 +398,7 @@ NTSTATUS QxlDod::QueryChildStatus(_<wbr>Inout_ DXGK_CHILD_STATUS* pChildStatus,<br>
>  }<br>
><br>
>  // EDID retrieval<br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::QueryDeviceDescriptor(<wbr>_In_    ULONG                   ChildUid,<br>
>                                         _Inout_ DXGK_DEVICE_DESCRIPTOR* pDeviceDescriptor)<br>
>  {<br>
> @@ -403,6 +411,7 @@ NTSTATUS QxlDod::QueryDeviceDescriptor(<wbr>_In_    ULONG                   ChildUid,<br>
>      return STATUS_MONITOR_NO_MORE_<wbr>DESCRIPTOR_DATA;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::QueryAdapterInfo(_In_ CONST DXGKARG_QUERYADAPTERINFO* pQueryAdapterInfo)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -447,6 +456,7 @@ NTSTATUS QxlDod::QueryAdapterInfo(_In_ CONST DXGKARG_QUERYADAPTERINFO* pQueryAda<br>
>      }<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::SetPointerPosition(_<wbr>In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -465,6 +475,7 @@ NTSTATUS QxlDod::SetPointerPosition(_<wbr>In_ CONST DXGKARG_SETPOINTERPOSITION* pSetP<br>
><br>
>  // Basic Sample Display Driver does not support hardware cursors, and reports such<br>
>  // in QueryAdapterInfo. Therefore this function should never be called.<br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -475,6 +486,7 @@ NTSTATUS QxlDod::SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointer<br>
>      return m_pHWDevice->SetPointerShape(<wbr>pSetPointerShape);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::Escape(_In_ CONST DXGKARG_ESCAPE* pEscape)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -488,7 +500,7 @@ NTSTATUS QxlDod::Escape(_In_ CONST DXGKARG_ESCAPE* pEscape)<br>
>      return Status;<br>
>  }<br>
><br>
> -<br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::PresentDisplayOnly(_<wbr>In_ CONST DXGKARG_PRESENT_DISPLAYONLY* pPresentDisplayOnly)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -550,6 +562,7 @@ NTSTATUS QxlDod::PresentDisplayOnly(_<wbr>In_ CONST DXGKARG_PRESENT_DISPLAYONLY* pPre<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::QueryInterface(_In_ CONST PQUERY_INTERFACE pQueryInterface)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -560,6 +573,7 @@ NTSTATUS QxlDod::QueryInterface(_In_ CONST PQUERY_INTERFACE pQueryInterface)<br>
>      return STATUS_NOT_SUPPORTED;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::<wbr>StopDeviceAndReleasePostDispla<wbr>yOwnership(_In_  D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId,<br>
>                                                            _Out_ DXGK_DISPLAY_INFORMATION*      pDisplayInfo)<br>
>  {<br>
> @@ -584,7 +598,7 @@ NTSTATUS QxlDod::<wbr>StopDeviceAndReleasePostDispla<wbr>yOwnership(_In_  D3DDDI_VIDEO_PRE<br>
>      return StopDevice();<br>
>  }<br>
><br>
> -<br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::<wbr>QueryVidPnHWCapability(_Inout_ DXGKARG_<wbr>QUERYVIDPNHWCAPABILITY* pVidPnHWCaps)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -608,6 +622,7 @@ NTSTATUS QxlDod::<wbr>QueryVidPnHWCapability(_Inout_ DXGKARG_<wbr>QUERYVIDPNHWCAPABILITY*<br>
><br>
><br>
>  // TODO: Need to also check pinned modes and the path parameters, not just topology<br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::IsSupportedVidPn(_<wbr>Inout_ DXGKARG_ISSUPPORTEDVIDPN* pIsSupportedVidPn)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -670,6 +685,7 @@ NTSTATUS QxlDod::IsSupportedVidPn(_<wbr>Inout_ DXGKARG_ISSUPPORTEDVIDPN* pIsSupported<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::<wbr>RecommendFunctionalVidPn(_In_ CONST DXGKARG_<wbr>RECOMMENDFUNCTIONALVIDPN* CONST pRecommendFunctionalVidPn)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -680,6 +696,7 @@ NTSTATUS QxlDod::<wbr>RecommendFunctionalVidPn(_In_ CONST DXGKARG_RECOMMENDFUNCTIONAL<br>
>      return STATUS_GRAPHICS_NO_<wbr>RECOMMENDED_FUNCTIONAL_VIDPN;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::<wbr>RecommendVidPnTopology(_In_ CONST DXGKARG_<wbr>RECOMMENDVIDPNTOPOLOGY* CONST pRecommendVidPnTopology)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -690,6 +707,7 @@ NTSTATUS QxlDod::<wbr>RecommendVidPnTopology(_In_ CONST DXGKARG_RECOMMENDVIDPNTOPOLOG<br>
>      return STATUS_GRAPHICS_NO_<wbr>RECOMMENDED_FUNCTIONAL_VIDPN;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::RecommendMonitorModes(<wbr>_In_ CONST DXGKARG_RECOMMENDMONITORMODES* CONST pRecommendMonitorModes)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -698,7 +716,7 @@ NTSTATUS QxlDod::RecommendMonitorModes(<wbr>_In_ CONST DXGKARG_RECOMMENDMONITORMODES*<br>
>      return AddSingleMonitorMode(<wbr>pRecommendMonitorModes);<br>
>  }<br>
><br>
> -<br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::AddSingleSourceMode(_<wbr>In_ CONST DXGK_VIDPNSOURCEMODESET_<wbr>INTERFACE* pVidPnSourceModeSetInterface,<br>
>                                                     D3DKMDT_HVIDPNSOURCEMODESET hVidPnSourceModeSet,<br>
>                                                     D3DDDI_VIDEO_PRESENT_SOURCE_ID SourceId)<br>
> @@ -755,6 +773,7 @@ NTSTATUS QxlDod::AddSingleSourceMode(_<wbr>In_ CONST DXGK_VIDPNSOURCEMODESET_<wbr>INTERFAC<br>
>  }<br>
><br>
>  // Add the current mode information (acquired from the POST frame buffer) as the target mode.<br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::AddSingleTargetMode(_<wbr>In_ CONST DXGK_VIDPNTARGETMODESET_<wbr>INTERFACE* pVidPnTargetModeSetInterface,<br>
>                                                     D3DKMDT_HVIDPNTARGETMODESET hVidPnTargetModeSet,<br>
>                                                     _In_opt_ CONST D3DKMDT_VIDPN_SOURCE_MODE* pVidPnPinnedSourceModeInfo,<br>
> @@ -807,7 +826,7 @@ NTSTATUS QxlDod::AddSingleTargetMode(_<wbr>In_ CONST DXGK_VIDPNTARGETMODESET_<wbr>INTERFAC<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> -<br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::AddSingleMonitorMode(_<wbr>In_ CONST DXGKARG_RECOMMENDMONITORMODES* CONST pRecommendMonitorModes)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -927,6 +946,7 @@ NTSTATUS QxlDod::AddSingleMonitorMode(_<wbr>In_ CONST DXGKARG_RECOMMENDMONITORMODES*<br>
>  }<br>
><br>
>  // Tell DMM about all the modes, etc. that are supported<br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::<wbr>EnumVidPnCofuncModality(_In_ CONST DXGKARG_<wbr>ENUMVIDPNCOFUNCMODALITY* CONST pEnumCofuncModality)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -1285,6 +1305,7 @@ NTSTATUS QxlDod::<wbr>EnumVidPnCofuncModality(_In_ CONST DXGKARG_ENUMVIDPNCOFUNCMODAL<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::<wbr>SetVidPnSourceVisibility(_In_ CONST DXGKARG_<wbr>SETVIDPNSOURCEVISIBILITY* pSetVidPnSourceVisibility)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -1317,6 +1338,7 @@ NTSTATUS QxlDod::<wbr>SetVidPnSourceVisibility(_In_ CONST DXGKARG_SETVIDPNSOURCEVISIB<br>
><br>
>  // NOTE: The value of pCommitVidPn-><wbr>MonitorConnectivityChecks is ignored, since BDD is unable to recognize whether a monitor is connected or not<br>
>  // The value of pCommitVidPn-><wbr>hPrimaryAllocation is also ignored, since BDD is a display only driver and does not deal with allocations<br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::CommitVidPn(_In_ CONST DXGKARG_COMMITVIDPN* CONST pCommitVidPn)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -1502,6 +1524,7 @@ CommitVidPnExit:<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::SetSourceModeAndPath(<wbr>CONST D3DKMDT_VIDPN_SOURCE_MODE* pSourceMode,<br>
>                                                      CONST D3DKMDT_VIDPN_PRESENT_PATH* pPath)<br>
>  {<br>
> @@ -1548,6 +1571,7 @@ NTSTATUS QxlDod::SetSourceModeAndPath(<wbr>CONST D3DKMDT_VIDPN_SOURCE_MODE* pSourceMo<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::<wbr>IsVidPnPathFieldsValid(CONST D3DKMDT_VIDPN_PRESENT_PATH* pPath) const<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -1596,6 +1620,7 @@ NTSTATUS QxlDod::<wbr>IsVidPnPathFieldsValid(CONST D3DKMDT_VIDPN_PRESENT_PATH* pPath)<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::<wbr>IsVidPnSourceModeFieldsValid(<wbr>CONST D3DKMDT_VIDPN_SOURCE_MODE* pSourceMode) const<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -1627,6 +1652,7 @@ NTSTATUS QxlDod::<wbr>IsVidPnSourceModeFieldsValid(<wbr>CONST D3DKMDT_VIDPN_SOURCE_MODE* p<br>
>      return STATUS_GRAPHICS_INVALID_VIDEO_<wbr>PRESENT_SOURCE_MODE;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::<wbr>UpdateActiveVidPnPresentPath(_<wbr>In_ CONST DXGKARG_<wbr>UPDATEACTIVEVIDPNPRESENTPATH* CONST pUpdateActiveVidPnPresentPath)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -1652,8 +1678,6 @@ NTSTATUS QxlDod::<wbr>UpdateActiveVidPnPresentPath(_<wbr>In_ CONST DXGKARG_UPDATEACTIVEVID<br>
>  //<br>
>  // Non-Paged Code<br>
>  //<br>
> -#pragma code_seg(push)<br>
> -#pragma code_seg()<br>
><br>
>  VOID QxlDod::DpcRoutine(VOID)<br>
>  {<br>
> @@ -1781,8 +1805,8 @@ VOID QxlDod::SystemDisplayWrite(_<wbr>In_reads_bytes_(SourceHeight * SourceStride) VO<br>
><br>
>  }<br>
><br>
> -#pragma code_seg(pop) // End Non-Paged Code<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::WriteHWInfoStr(_In_ HANDLE DevInstRegKeyHandle, _In_ PCWSTR pszwValueName, _In_ PCSTR pszValue)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -1826,6 +1850,7 @@ NTSTATUS QxlDod::WriteHWInfoStr(_In_ HANDLE DevInstRegKeyHandle, _In_ PCWSTR psz<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::RegisterHWInfo(ULONG Id)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -1905,6 +1930,7 @@ NTSTATUS QxlDod::RegisterHWInfo(ULONG Id)<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDod::ReadConfiguration()<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -1959,8 +1985,6 @@ NTSTATUS QxlDod::ReadConfiguration()<br>
>  //<br>
>  // Non-Paged Code<br>
>  //<br>
> -#pragma code_seg(push)<br>
> -#pragma code_seg()<br>
>  D3DDDI_VIDEO_PRESENT_SOURCE_ID QxlDod::FindSourceForTarget(<wbr>D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId, BOOLEAN DefaultToZero)<br>
>  {<br>
>      UNREFERENCED_PARAMETER(<wbr>TargetId);<br>
> @@ -1975,12 +1999,10 @@ D3DDDI_VIDEO_PRESENT_SOURCE_ID QxlDod::FindSourceForTarget(<wbr>D3DDDI_VIDEO_PRESENT_<br>
>      return DefaultToZero ? 0 : D3DDDI_ID_UNINITIALIZED;<br>
>  }<br>
><br>
> -#pragma code_seg(pop) // End Non-Paged Code<br>
> -<br>
>  //<br>
>  // Frame buffer map/unmap<br>
>  //<br>
> -<br>
> +QXL_PAGED<br>
>  NTSTATUS<br>
>  MapFrameBuffer(<br>
>      _In_                       PHYSICAL_ADDRESS    PhysicalAddress,<br>
> @@ -2022,6 +2044,7 @@ MapFrameBuffer(<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS<br>
>  UnmapFrameBuffer(<br>
>      _In_reads_bytes_(Length) VOID* VirtualAddress,<br>
> @@ -2324,6 +2347,7 @@ VOID BltBits (<br>
>      }<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  VgaDevice::VgaDevice(_In_ QxlDod* pQxlDod)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2335,6 +2359,7 @@ VgaDevice::VgaDevice(_In_ QxlDod* pQxlDod)<br>
>      m_Id = 0;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  VgaDevice::~VgaDevice(void)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2348,6 +2373,7 @@ VgaDevice::~VgaDevice(void)<br>
>      m_Id = 0;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  BOOL VgaDevice::SetVideoModeInfo(<wbr>UINT Idx, PVBE_MODEINFO pModeInfo)<br>
>  {<br>
>      PVIDEO_MODE_INFORMATION pMode = NULL;<br>
> @@ -2385,6 +2411,7 @@ BOOL VgaDevice::SetVideoModeInfo(<wbr>UINT Idx, PVBE_MODEINFO pModeInfo)<br>
>      return TRUE;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS VgaDevice::GetModeList(DXGK_<wbr>DISPLAY_INFORMATION* pDispInfo)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2576,6 +2603,7 @@ NTSTATUS VgaDevice::GetModeList(DXGK_<wbr>DISPLAY_INFORMATION* pDispInfo)<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS VgaDevice::QueryCurrentMode(<wbr>PVIDEO_MODE RequestedMode)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2586,6 +2614,7 @@ NTSTATUS VgaDevice::QueryCurrentMode(<wbr>PVIDEO_MODE RequestedMode)<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS VgaDevice::SetCurrentMode(<wbr>ULONG Mode)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2604,6 +2633,7 @@ NTSTATUS VgaDevice::SetCurrentMode(<wbr>ULONG Mode)<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS VgaDevice::GetCurrentMode(<wbr>ULONG* pMode)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2622,6 +2652,7 @@ NTSTATUS VgaDevice::GetCurrentMode(<wbr>ULONG* pMode)<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS VgaDevice::HWInit(PCM_<wbr>RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2633,6 +2664,7 @@ NTSTATUS VgaDevice::HWInit(PCM_<wbr>RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION*<br>
>      return GetModeList(pDispInfo);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS VgaDevice::HWClose(void)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2642,6 +2674,7 @@ NTSTATUS VgaDevice::HWClose(void)<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS VgaDevice::SetPowerState(_In_  DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2668,7 +2701,7 @@ NTSTATUS VgaDevice::SetPowerState(_In_  DEVICE_POWER_STATE DevicePowerState, DXG<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> -<br>
> +QXL_PAGED<br>
>  NTSTATUS<br>
>  VgaDevice::<wbr>ExecutePresentDisplayOnly(<br>
>      _In_ BYTE*             DstAddr,<br>
> @@ -2870,6 +2903,7 @@ VgaDevice::<wbr>ExecutePresentDisplayOnly(<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  VOID VgaDevice::BlackOutScreen(<wbr>CURRENT_BDD_MODE* pCurrentBddMod)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2953,6 +2987,7 @@ NTSTATUS VgaDevice::ReleaseFrameBuffer(<wbr>CURRENT_BDD_MODE* pCurrentBddMode)<br>
>      return status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS  VgaDevice::SetPointerShape(_<wbr>In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2960,6 +2995,7 @@ NTSTATUS  VgaDevice::SetPointerShape(_<wbr>In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPoi<br>
>      return STATUS_NOT_SUPPORTED;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS VgaDevice::SetPointerPosition(<wbr>_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2967,6 +3003,7 @@ NTSTATUS VgaDevice::SetPointerPosition(<wbr>_In_ CONST DXGKARG_SETPOINTERPOSITION* pS<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS VgaDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscap)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2975,6 +3012,7 @@ NTSTATUS VgaDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscap)<br>
>      return STATUS_NOT_IMPLEMENTED;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  QxlDevice::QxlDevice(_In_ QxlDod* pQxlDod)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -2988,6 +3026,7 @@ QxlDevice::QxlDevice(_In_ QxlDod* pQxlDod)<br>
>      m_Pending = 0;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  QxlDevice::~QxlDevice(void)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3000,6 +3039,7 @@ QxlDevice::~QxlDevice(void)<br>
>      m_ModeCount = 0;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  BOOL QxlDevice::SetVideoModeInfo(<wbr>UINT Idx, QXLMode* pModeInfo)<br>
>  {<br>
>      PVIDEO_MODE_INFORMATION pMode = NULL;<br>
> @@ -3033,6 +3073,7 @@ BOOL QxlDevice::SetVideoModeInfo(<wbr>UINT Idx, QXLMode* pModeInfo)<br>
>      return TRUE;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::<wbr>UpdateVideoModeInfo(UINT Idx, UINT xres, UINT yres, UINT bpp)<br>
>  {<br>
>      PVIDEO_MODE_INFORMATION pMode = NULL;<br>
> @@ -3055,6 +3096,7 @@ void QxlDevice::<wbr>UpdateVideoModeInfo(UINT Idx, UINT xres, UINT yres, UINT bpp)<br>
>      pMode->RedMask = pMode->GreenMask << color_bits;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDevice::GetModeList(DXGK_<wbr>DISPLAY_INFORMATION* pDispInfo)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3162,6 +3204,7 @@ NTSTATUS QxlDevice::GetModeList(DXGK_<wbr>DISPLAY_INFORMATION* pDispInfo)<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDevice::QueryCurrentMode(<wbr>PVIDEO_MODE RequestedMode)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3171,6 +3214,7 @@ NTSTATUS QxlDevice::QueryCurrentMode(<wbr>PVIDEO_MODE RequestedMode)<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDevice::SetCurrentMode(<wbr>ULONG Mode)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3191,6 +3235,7 @@ NTSTATUS QxlDevice::SetCurrentMode(<wbr>ULONG Mode)<br>
>      return STATUS_UNSUCCESSFUL;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDevice::GetCurrentMode(<wbr>ULONG* pMode)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3201,6 +3246,7 @@ NTSTATUS QxlDevice::GetCurrentMode(<wbr>ULONG* pMode)<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDevice::SetPowerState(_In_ DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3217,6 +3263,7 @@ NTSTATUS QxlDevice::SetPowerState(_In_ DEVICE_POWER_STATE DevicePowerState, DXGK<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDevice::HWInit(PCM_<wbr>RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3365,6 +3412,7 @@ NTSTATUS QxlDevice::HWInit(PCM_<wbr>RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION*<br>
>      return QxlInit(pDispInfo);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDevice::QxlInit(DXGK_<wbr>DISPLAY_INFORMATION* pDispInfo)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3393,12 +3441,14 @@ NTSTATUS QxlDevice::QxlInit(DXGK_<wbr>DISPLAY_INFORMATION* pDispInfo)<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::QxlClose()<br>
>  {<br>
>      PAGED_CODE();<br>
>      DestroyMemSlots();<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::UnmapMemory(void)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3427,6 +3477,7 @@ void QxlDevice::UnmapMemory(void)<br>
>      }<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  BOOL QxlDevice::InitMemSlots(void)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3447,6 +3498,7 @@ BOOL QxlDevice::InitMemSlots(void)<br>
>      return FALSE;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::DestroyMemSlots(<wbr>void)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3456,6 +3508,7 @@ void QxlDevice::DestroyMemSlots(<wbr>void)<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::<wbr>CreatePrimarySurface(PVIDEO_<wbr>MODE_INFORMATION pModeInfo)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3479,6 +3532,7 @@ void QxlDevice::<wbr>CreatePrimarySurface(PVIDEO_<wbr>MODE_INFORMATION pModeInfo)<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::<wbr>DestroyPrimarySurface(void)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3488,6 +3542,7 @@ void QxlDevice::<wbr>DestroyPrimarySurface(void)<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  _inline QXLPHYSICAL QxlDevice::PA(PVOID virt, UINT8 slot_id)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3496,6 +3551,7 @@ _inline QXLPHYSICAL QxlDevice::PA(PVOID virt, UINT8 slot_id)<br>
>      return pSlot->high_bits | ((UINT64)virt - pSlot->start_virt_addr);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  _inline UINT64 QxlDevice::VA(QXLPHYSICAL paddr, UINT8 slot_id)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3509,6 +3565,7 @@ _inline UINT64 QxlDevice::VA(QXLPHYSICAL paddr, UINT8 slot_id)<br>
>      return virt;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::SetupHWSlot(UINT8 Idx, MemSlot *pSlot)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3519,6 +3576,7 @@ void QxlDevice::SetupHWSlot(UINT8 Idx, MemSlot *pSlot)<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  BOOL QxlDevice::CreateEvents()<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3541,6 +3599,7 @@ BOOL QxlDevice::CreateEvents()<br>
>      return TRUE;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  BOOL QxlDevice::CreateRings()<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3552,6 +3611,7 @@ BOOL QxlDevice::CreateRings()<br>
>      return TRUE;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::AsyncIo(UCHAR  Port, UCHAR Value)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3564,6 +3624,7 @@ void QxlDevice::AsyncIo(UCHAR  Port, UCHAR Value)<br>
>      ReleaseMutex(&m_IoLock, locked);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::SyncIo(UCHAR  Port, UCHAR Value)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3573,6 +3634,7 @@ void QxlDevice::SyncIo(UCHAR  Port, UCHAR Value)<br>
>      ReleaseMutex(&m_IoLock, locked);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  UINT8 QxlDevice::SetupMemSlot(UINT8 Idx, UINT64 pastart, UINT64 paend, UINT64 vastart, UINT64 vaend)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3599,6 +3661,7 @@ UINT8 QxlDevice::SetupMemSlot(UINT8 Idx, UINT64 pastart, UINT64 paend, UINT64 va<br>
>      return slot_index;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  BOOL QxlDevice::CreateMemSlots(<wbr>void)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3619,6 +3682,7 @@ BOOL QxlDevice::CreateMemSlots(<wbr>void)<br>
>      return TRUE;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::<wbr>InitDeviceMemoryResources(<wbr>void)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3628,6 +3692,7 @@ void QxlDevice::<wbr>InitDeviceMemoryResources(<wbr>void)<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::InitMonitorConfig(<wbr>void)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3639,6 +3704,7 @@ void QxlDevice::InitMonitorConfig(<wbr>void)<br>
>      *m_monitor_config_pa = PA(m_monitor_config, m_MainMemSlot);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::InitMspace(UINT32 mspace_type, UINT8 *start, size_t capacity)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3657,6 +3723,7 @@ void QxlDevice::ResetDevice(void)<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS<br>
>  QxlDevice::<wbr>ExecutePresentDisplayOnly(<br>
>      _In_ BYTE*             DstAddr,<br>
> @@ -3845,6 +3912,7 @@ QxlDevice::<wbr>ExecutePresentDisplayOnly(<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::WaitForReleaseRing(<wbr>void)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3878,6 +3946,7 @@ void QxlDevice::WaitForReleaseRing(<wbr>void)<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("%s: <---\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::FlushReleaseRing()<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3910,6 +3979,7 @@ void QxlDevice::FlushReleaseRing()<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::EmptyReleaseRing()<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3921,6 +3991,7 @@ void QxlDevice::EmptyReleaseRing()<br>
>      ReleaseMutex(&m_MemLock, locked);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  UINT64 QxlDevice::ReleaseOutput(<wbr>UINT64 output_id)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3941,6 +4012,7 @@ UINT64 QxlDevice::ReleaseOutput(<wbr>UINT64 output_id)<br>
>      return next;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void *QxlDevice::AllocMem(UINT32 mspace_type, size_t size, BOOL force)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -3990,6 +4062,7 @@ void *QxlDevice::AllocMem(UINT32 mspace_type, size_t size, BOOL force)<br>
>      return ptr;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::FreeMem(UINT32 mspace_type, void *ptr)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4011,6 +4084,7 @@ void QxlDevice::FreeMem(UINT32 mspace_type, void *ptr)<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  QXLDrawable *QxlDevice::GetDrawable()<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4024,6 +4098,7 @@ QXLDrawable *QxlDevice::GetDrawable()<br>
>      return(QXLDrawable *)output->data;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  QXLCursorCmd *QxlDevice::CursorCmd()<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4040,6 +4115,7 @@ QXLCursorCmd *QxlDevice::CursorCmd()<br>
>      return cursor_cmd;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  BOOL QxlDevice::SetClip(const RECT *clip, QXLDrawable *drawable)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4070,6 +4146,7 @@ BOOL QxlDevice::SetClip(const RECT *clip, QXLDrawable *drawable)<br>
>      return TRUE;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::AddRes(QXLOutput *output, Resource *res)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4077,6 +4154,7 @@ void QxlDevice::AddRes(QXLOutput *output, Resource *res)<br>
>      output->resources[output->num_<wbr>res++] = res;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::DrawableAddRes(<wbr>QXLDrawable *drawable, Resource *res)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4086,6 +4164,7 @@ void QxlDevice::DrawableAddRes(<wbr>QXLDrawable *drawable, Resource *res)<br>
>      AddRes(output, res);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::CursorCmdAddRes(<wbr>QXLCursorCmd *cmd, Resource *res)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4095,6 +4174,7 @@ void QxlDevice::CursorCmdAddRes(<wbr>QXLCursorCmd *cmd, Resource *res)<br>
>      AddRes(output, res);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::FreeClipRectsEx(<wbr>Resource *res)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4103,6 +4183,7 @@ void QxlDevice::FreeClipRectsEx(<wbr>Resource *res)<br>
>      pqxl->FreeClipRects(res);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::FreeClipRects(<wbr>Resource *res)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4119,6 +4200,7 @@ void QxlDevice::FreeClipRects(<wbr>Resource *res)<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::FreeBitmapImageEx(<wbr>Resource *res)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4127,6 +4209,7 @@ void QxlDevice::FreeBitmapImageEx(<wbr>Resource *res)<br>
>      pqxl->FreeBitmapImage(res);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::FreeBitmapImage(<wbr>Resource *res)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4147,6 +4230,7 @@ void QxlDevice::FreeBitmapImage(<wbr>Resource *res)<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::FreeCursorEx(<wbr>Resource *res)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4155,6 +4239,7 @@ void QxlDevice::FreeCursorEx(<wbr>Resource *res)<br>
>      pqxl->FreeCursor(res);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::FreeCursor(Resource *res)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4172,6 +4257,7 @@ void QxlDevice::FreeCursor(Resource *res)<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  QXLDrawable *QxlDevice::Drawable(UINT8 type, CONST RECT *area, CONST RECT *clip, UINT32 surface_id)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4200,6 +4286,7 @@ QXLDrawable *QxlDevice::Drawable(UINT8 type, CONST RECT *area, CONST RECT *clip,<br>
>      return drawable;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::PushDrawable(<wbr>QXLDrawable *drawable) {<br>
>      PAGED_CODE();<br>
>      QXLCommand *cmd;<br>
> @@ -4216,6 +4303,7 @@ void QxlDevice::PushDrawable(<wbr>QXLDrawable *drawable) {<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::PushCursorCmd(<wbr>QXLCursorCmd *cursor_cmd)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4234,6 +4322,7 @@ void QxlDevice::PushCursorCmd(<wbr>QXLCursorCmd *cursor_cmd)<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  VOID QxlDevice::SetImageId(<wbr>InternalImage *internal,<br>
>      BOOL cache_me,<br>
>      LONG width,<br>
> @@ -4254,6 +4343,7 @@ VOID QxlDevice::SetImageId(<wbr>InternalImage *internal,<br>
>      }<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  VOID QxlDevice::BltBits (<br>
>      BLT_INFO* pDst,<br>
>      CONST BLT_INFO* pSrc,<br>
> @@ -4355,6 +4445,7 @@ VOID QxlDevice::BltBits (<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +    QXL_PAGED<br>
>  VOID QxlDevice::PutBytesAlign(<wbr>QXLDataChunk **chunk_ptr, UINT8 **now_ptr,<br>
>                              UINT8 **end_ptr, UINT8 *src, int size,<br>
>                              size_t alloc_size, uint32_t alignment)<br>
> @@ -4395,6 +4486,7 @@ VOID QxlDevice::PutBytesAlign(<wbr>QXLDataChunk **chunk_ptr, UINT8 **now_ptr,<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  VOID QxlDevice::BlackOutScreen(<wbr>CURRENT_BDD_MODE* pCurrentBddMod)<br>
>  {<br>
>      QXLDrawable *drawable;<br>
> @@ -4422,6 +4514,7 @@ VOID QxlDevice::BlackOutScreen(<wbr>CURRENT_BDD_MODE* pCurrentBddMod)<br>
>      }<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDevice::HWClose(void)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4430,6 +4523,7 @@ NTSTATUS QxlDevice::HWClose(void)<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS  QxlDevice::SetPointerShape(_<wbr>In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4514,6 +4608,7 @@ NTSTATUS  QxlDevice::SetPointerShape(_<wbr>In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPoi<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDevice::SetPointerPosition(<wbr>_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4538,6 +4633,7 @@ NTSTATUS QxlDevice::SetPointerPosition(<wbr>_In_ CONST DXGKARG_SETPOINTERPOSITION* pS<br>
>      return STATUS_SUCCESS;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDevice::UpdateChildStatus(<wbr>BOOLEAN connect)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4552,6 +4648,7 @@ NTSTATUS QxlDevice::UpdateChildStatus(<wbr>BOOLEAN connect)<br>
>      return Status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDevice::SetCustomDisplay(<wbr>QXLEscapeSetCustomDisplay* custom_display)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4576,6 +4673,7 @@ NTSTATUS QxlDevice::SetCustomDisplay(<wbr>QXLEscapeSetCustomDisplay* custom_display)<br>
>      return status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  void QxlDevice::SetMonitorConfig(<wbr>QXLHead * monitor_config)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4592,6 +4690,7 @@ void QxlDevice::SetMonitorConfig(<wbr>QXLHead * monitor_config)<br>
>      AsyncIo(QXL_IO_MONITORS_<wbr>CONFIG_ASYNC, 0);<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS QxlDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscape)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4633,6 +4732,7 @@ NTSTATUS QxlDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscape)<br>
>      return status;<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  VOID QxlDevice::WaitForCmdRing()<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4650,6 +4750,7 @@ VOID QxlDevice::WaitForCmdRing()<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  VOID QxlDevice::PushCmd()<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4662,6 +4763,7 @@ VOID QxlDevice::PushCmd()<br>
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s notify = %d\n", __FUNCTION__, notify));<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  VOID QxlDevice::WaitForCursorRing(<wbr>VOID)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4685,6 +4787,7 @@ VOID QxlDevice::WaitForCursorRing(<wbr>VOID)<br>
>      }<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  VOID QxlDevice::PushCursor(VOID)<br>
>  {<br>
>      PAGED_CODE();<br>
> @@ -4804,6 +4907,7 @@ D3DDDIFORMAT PixelFormatFromBPP(UINT BPP)<br>
>      }<br>
>  }<br>
><br>
> +QXL_PAGED<br>
>  UINT SpiceFromPixelFormat(<wbr>D3DDDIFORMAT Format)<br>
>  {<br>
>      PAGED_CODE();<br>
> diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h<br>
> index c808eb1..ac33faa 100755<br>
> --- a/qxldod/QxlDod.h<br>
> +++ b/qxldod/QxlDod.h<br>
> @@ -4,6 +4,8 @@<br>
>  #include "qxl_windows.h"<br>
>  #include "mspace.h"<br>
><br>
> +#define QXL_PAGED __declspec(code_seg("PAGE"))<br>
> +<br>
>  #define MAX_CHILDREN               1<br>
>  #define MAX_VIEWS                  1<br>
>  #define BITS_PER_BYTE              8<br>
> @@ -215,12 +217,19 @@ class QxlDod;<br>
><br>
>  class HwDeviceInterface {<br>
>  public:<br>
> +    QXL_PAGED<br>
>      virtual ~HwDeviceInterface() {;}<br>
> +    QXL_PAGED<br>
>      virtual NTSTATUS QueryCurrentMode(PVIDEO_MODE RequestedMode) = 0;<br>
> +    QXL_PAGED<br>
>      virtual NTSTATUS SetCurrentMode(ULONG Mode) = 0;<br>
> +    QXL_PAGED<br>
>      virtual NTSTATUS GetCurrentMode(ULONG* Mode) = 0;<br>
> +    QXL_PAGED<br>
>      virtual NTSTATUS SetPowerState(DEVICE_POWER_<wbr>STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo) = 0;<br>
> +    QXL_PAGED<br>
>      virtual NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo) = 0;<br>
> +    QXL_PAGED<br>
>      virtual NTSTATUS HWClose(void) = 0;<br>
>      virtual BOOLEAN InterruptRoutine(_In_ PDXGKRNL_INTERFACE pDxgkInterface, _In_  ULONG MessageNumber) = 0;<br>
>      virtual VOID DpcRoutine(PVOID) = 0;<br>
> @@ -228,12 +237,19 @@ public:<br>
>      virtual NTSTATUS AcquireFrameBuffer(CURRENT_<wbr>BDD_MODE* pCurrentBddMode) { return STATUS_SUCCESS; }<br>
>      virtual NTSTATUS ReleaseFrameBuffer(CURRENT_<wbr>BDD_MODE* pCurrentBddMode) { return STATUS_SUCCESS; }<br>
><br>
> +    QXL_PAGED<br>
>      virtual ULONG GetModeCount(void) = 0;<br>
> +    QXL_PAGED<br>
>      PVIDEO_MODE_INFORMATION GetModeInfo(UINT idx) {return &m_ModeInfo[idx];}<br>
> +    QXL_PAGED<br>
>      USHORT GetModeNumber(USHORT idx) {return m_ModeNumbers[idx];}<br>
> +    QXL_PAGED<br>
>      USHORT GetCurrentModeIndex(void) {return m_CurrentMode;}<br>
> +    QXL_PAGED<br>
>      VOID SetCurrentModeIndex(USHORT idx) {m_CurrentMode = idx;}<br>
> +    QXL_PAGED<br>
>      virtual BOOLEAN EnablePointer(void) = 0;<br>
> +    QXL_PAGED<br>
>      virtual NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE*             DstAddr,<br>
>                                   _In_ UINT              DstBitPerPixel,<br>
>                                   _In_ BYTE*             SrcAddr,<br>
> @@ -245,13 +261,17 @@ public:<br>
>                                   _In_ RECT*             pDirtyRect,<br>
>                                   _In_ D3DKMDT_VIDPN_PRESENT_PATH_<wbr>ROTATION Rotation,<br>
>                                   _In_ const CURRENT_BDD_MODE* pModeCur) = 0;<br>
> -<br>
> +    QXL_PAGED<br>
>      virtual VOID BlackOutScreen(CURRENT_BDD_<wbr>MODE* pCurrentBddMod) = 0;<br>
> +    QXL_PAGED<br>
>      virtual NTSTATUS SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape) = 0;<br>
> +    QXL_PAGED<br>
>      virtual NTSTATUS SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition) = 0;<br>
> +    QXL_PAGED<br>
>      virtual NTSTATUS Escape(_In_ CONST DXGKARG_ESCAPE* pEscap) = 0;<br>
>      ULONG GetId(void) { return m_Id; }<br>
>  protected:<br>
> +    QXL_PAGED<br>
>      virtual NTSTATUS GetModeList(DXGK_DISPLAY_<wbr>INFORMATION* pDispInfo) = 0;<br>
>  protected:<br>
>      QxlDod* m_pQxlDod;<br>
> @@ -267,16 +287,27 @@ class VgaDevice  :<br>
>      public HwDeviceInterface<br>
>  {<br>
>  public:<br>
> +    QXL_PAGED<br>
>      VgaDevice(_In_ QxlDod* pQxlDod);<br>
> +    QXL_PAGED<br>
>      ~VgaDevice(void);<br>
> +    QXL_PAGED<br>
>      NTSTATUS QueryCurrentMode(PVIDEO_MODE RequestedMode);<br>
> +    QXL_PAGED<br>
>      NTSTATUS SetCurrentMode(ULONG Mode);<br>
> +    QXL_PAGED<br>
>      NTSTATUS GetCurrentMode(ULONG* Mode);<br>
> +    QXL_PAGED<br>
>      ULONG GetModeCount(void) {return m_ModeCount;}<br>
> +    QXL_PAGED<br>
>      NTSTATUS SetPowerState(DEVICE_POWER_<wbr>STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo);<br>
> +    QXL_PAGED<br>
>      NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo);<br>
> +    QXL_PAGED<br>
>      NTSTATUS HWClose(void);<br>
> +    QXL_PAGED<br>
>      BOOLEAN EnablePointer(void) { return TRUE; }<br>
> +    QXL_PAGED<br>
>      NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE*             DstAddr,<br>
>                                   _In_ UINT              DstBitPerPixel,<br>
>                                   _In_ BYTE*             SrcAddr,<br>
> @@ -288,18 +319,24 @@ public:<br>
>                                   _In_ RECT*             pDirtyRect,<br>
>                                   _In_ D3DKMDT_VIDPN_PRESENT_PATH_<wbr>ROTATION Rotation,<br>
>                                   _In_ const CURRENT_BDD_MODE* pModeCur);<br>
> +    QXL_PAGED<br>
>      VOID BlackOutScreen(CURRENT_BDD_<wbr>MODE* pCurrentBddMod);<br>
>      BOOLEAN InterruptRoutine(_In_ PDXGKRNL_INTERFACE pDxgkInterface, _In_  ULONG MessageNumber);<br>
>      VOID DpcRoutine(PVOID);<br>
>      VOID ResetDevice(VOID);<br>
>      NTSTATUS AcquireFrameBuffer(CURRENT_<wbr>BDD_MODE* pCurrentBddMode);<br>
>      NTSTATUS ReleaseFrameBuffer(CURRENT_<wbr>BDD_MODE* pCurrentBddMode);<br>
> +    QXL_PAGED<br>
>      NTSTATUS SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape);<br>
> +    QXL_PAGED<br>
>      NTSTATUS SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition);<br>
> +    QXL_PAGED<br>
>      NTSTATUS Escape(_In_ CONST DXGKARG_ESCAPE* pEscap);<br>
>  protected:<br>
> +    QXL_PAGED<br>
>      NTSTATUS GetModeList(DXGK_DISPLAY_<wbr>INFORMATION* pDispInfo);<br>
>  private:<br>
> +    QXL_PAGED<br>
>      BOOL SetVideoModeInfo(UINT Idx, PVBE_MODEINFO pModeInfo);<br>
>  };<br>
><br>
> @@ -442,16 +479,27 @@ class QxlDevice  :<br>
>      public HwDeviceInterface<br>
>  {<br>
>  public:<br>
> +    QXL_PAGED<br>
>      QxlDevice(_In_ QxlDod* pQxlDod);<br>
> +    QXL_PAGED<br>
>      ~QxlDevice(void);<br>
> +    QXL_PAGED<br>
>      NTSTATUS QueryCurrentMode(PVIDEO_MODE RequestedMode);<br>
> +    QXL_PAGED<br>
>      NTSTATUS SetCurrentMode(ULONG Mode);<br>
> +    QXL_PAGED<br>
>      NTSTATUS GetCurrentMode(ULONG* Mode);<br>
> +    QXL_PAGED<br>
>      ULONG GetModeCount(void) {return m_ModeCount;}<br>
> +    QXL_PAGED<br>
>      NTSTATUS SetPowerState(DEVICE_POWER_<wbr>STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo);<br>
> +    QXL_PAGED<br>
>      NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo);<br>
> +    QXL_PAGED<br>
>      NTSTATUS HWClose(void);<br>
> +    QXL_PAGED<br>
>      BOOLEAN EnablePointer(void) { return FALSE; }<br>
> +    QXL_PAGED<br>
>      NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE*             DstAddr,<br>
>                      _In_ UINT              DstBitPerPixel,<br>
>                      _In_ BYTE*             SrcAddr,<br>
> @@ -463,83 +511,140 @@ public:<br>
>                      _In_ RECT*             pDirtyRect,<br>
>                      _In_ D3DKMDT_VIDPN_PRESENT_PATH_<wbr>ROTATION Rotation,<br>
>                      _In_ const CURRENT_BDD_MODE* pModeCur);<br>
> +    QXL_PAGED<br>
>      VOID BlackOutScreen(CURRENT_BDD_<wbr>MODE* pCurrentBddMod);<br>
>      BOOLEAN InterruptRoutine(_In_ PDXGKRNL_INTERFACE pDxgkInterface, _In_  ULONG MessageNumber);<br>
>      VOID DpcRoutine(PVOID);<br>
>      VOID ResetDevice(VOID);<br>
> +    QXL_PAGED<br>
>      NTSTATUS SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape);<br>
> +    QXL_PAGED<br>
>      NTSTATUS SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition);<br>
> +    QXL_PAGED<br>
>      NTSTATUS Escape(_In_ CONST DXGKARG_ESCAPE* pEscap);<br>
>  protected:<br>
> +    QXL_PAGED<br>
>      NTSTATUS GetModeList(DXGK_DISPLAY_<wbr>INFORMATION* pDispInfo);<br>
> +    QXL_PAGED<br>
>      VOID BltBits (BLT_INFO* pDst,<br>
>                      CONST BLT_INFO* pSrc,<br>
>                      UINT  NumRects,<br>
>                      _In_reads_(NumRects) CONST RECT *pRects,<br>
>                      POINT*   pSourcePoint);<br>
> +    QXL_PAGED<br>
>      QXLDrawable *Drawable(UINT8 type,<br>
>                      CONST RECT *area,<br>
>                      CONST RECT *clip,<br>
>                      UINT32 surface_id);<br>
> +    QXL_PAGED<br>
>      void PushDrawable(QXLDrawable *drawable);<br>
> +    QXL_PAGED<br>
>      void PushCursorCmd(QXLCursorCmd *cursor_cmd);<br>
> +    QXL_PAGED<br>
>      QXLDrawable *GetDrawable();<br>
> +    QXL_PAGED<br>
>      QXLCursorCmd *CursorCmd();<br>
> +    QXL_PAGED<br>
>      void *AllocMem(UINT32 mspace_type, size_t size, BOOL force);<br>
>      VOID UpdateArea(CONST RECT* area, UINT32 surface_id);<br>
> +    QXL_PAGED<br>
>      VOID SetImageId(InternalImage *internal,<br>
>                      BOOL cache_me,<br>
>                      LONG width,<br>
>                      LONG height,<br>
>                      UINT8 format, UINT32 key);<br>
>  private:<br>
> +    QXL_PAGED<br>
>      NTSTATUS QxlInit(DXGK_DISPLAY_<wbr>INFORMATION* pDispInfo);<br>
> +    QXL_PAGED<br>
>      void QxlClose(void);<br>
> +    QXL_PAGED<br>
>      void UnmapMemory(void);<br>
> +    QXL_PAGED<br>
>      BOOL SetVideoModeInfo(UINT Idx, QXLMode* pModeInfo);<br>
> +    QXL_PAGED<br>
>      void UpdateVideoModeInfo(UINT Idx, UINT xres, UINT yres, UINT bpp);<br>
> +    QXL_PAGED<br>
>      BOOL InitMemSlots(void);<br>
> +    QXL_PAGED<br>
>      BOOL CreateMemSlots(void);<br>
> +    QXL_PAGED<br>
>      void DestroyMemSlots(void);<br>
> +    QXL_PAGED<br>
>      void CreatePrimarySurface(PVIDEO_<wbr>MODE_INFORMATION pModeInfo);<br>
> +    QXL_PAGED<br>
>      void DestroyPrimarySurface(void);<br>
> +    QXL_PAGED<br>
>      void SetupHWSlot(UINT8 Idx, MemSlot *pSlot);<br>
> +    QXL_PAGED<br>
>      UINT8 SetupMemSlot(UINT8 Idx, UINT64 pastart, UINT64 paend, UINT64 vastart, UINT64 vaend);<br>
> +    QXL_PAGED<br>
>      BOOL CreateEvents(void);<br>
> +    QXL_PAGED<br>
>      BOOL CreateRings(void);<br>
> +    QXL_PAGED<br>
>      UINT64 VA(QXLPHYSICAL paddr, UINT8 slot_id);<br>
> +    QXL_PAGED<br>
>      QXLPHYSICAL PA(PVOID virt, UINT8 slot_id);<br>
> +    QXL_PAGED<br>
>      void InitDeviceMemoryResources(<wbr>void);<br>
> +    QXL_PAGED<br>
>      void InitMonitorConfig();<br>
> +    QXL_PAGED<br>
>      void InitMspace(UINT32 mspace_type, UINT8 *start, size_t capacity);<br>
> +    QXL_PAGED<br>
>      void FlushReleaseRing();<br>
> +    QXL_PAGED<br>
>      void FreeMem(UINT32 mspace_type, void *ptr);<br>
> +    QXL_PAGED<br>
>      UINT64 ReleaseOutput(UINT64 output_id);<br>
> +    QXL_PAGED<br>
>      void WaitForReleaseRing(void);<br>
> +    QXL_PAGED<br>
>      void EmptyReleaseRing(void);<br>
> +    QXL_PAGED<br>
>      BOOL SetClip(const RECT *clip, QXLDrawable *drawable);<br>
> +    QXL_PAGED<br>
>      void AddRes(QXLOutput *output, Resource *res);<br>
> +    QXL_PAGED<br>
>      void DrawableAddRes(QXLDrawable *drawable, Resource *res);<br>
> +    QXL_PAGED<br>
>      void CursorCmdAddRes(QXLCursorCmd *cmd, Resource *res);<br>
> +    QXL_PAGED<br>
>      void FreeClipRects(Resource *res);<br>
> +    QXL_PAGED<br>
>      void static FreeClipRectsEx(Resource *res);<br>
> +    QXL_PAGED<br>
>      void FreeBitmapImage(Resource *res);<br>
> +    QXL_PAGED<br>
>      void static FreeBitmapImageEx(Resource *res);<br>
> +    QXL_PAGED<br>
>      void static FreeCursorEx(Resource *res);<br>
> +    QXL_PAGED<br>
>      void FreeCursor(Resource *res);<br>
> +    QXL_PAGED<br>
>      void WaitForCmdRing(void);<br>
> +    QXL_PAGED<br>
>      void PushCmd(void);<br>
> +    QXL_PAGED<br>
>      void WaitForCursorRing(void);<br>
> +    QXL_PAGED<br>
>      void PushCursor(void);<br>
> +    QXL_PAGED<br>
>      void PutBytesAlign(QXLDataChunk **chunk_ptr, UINT8 **now_ptr,<br>
>                              UINT8 **end_ptr, UINT8 *src, int size,<br>
>                              size_t alloc_size, uint32_t alignment);<br>
>      BOOLEAN static DpcCallbackEx(PVOID);<br>
>      void DpcCallback(PDPC_CB_CONTEXT);<br>
> +    QXL_PAGED<br>
>      void AsyncIo(UCHAR  Port, UCHAR Value);<br>
> +    QXL_PAGED<br>
>      void SyncIo(UCHAR  Port, UCHAR Value);<br>
> +    QXL_PAGED<br>
>      NTSTATUS UpdateChildStatus(BOOLEAN connect);<br>
> +    QXL_PAGED<br>
>      NTSTATUS SetCustomDisplay(<wbr>QXLEscapeSetCustomDisplay* custom_display);<br>
> +    QXL_PAGED<br>
>      void SetMonitorConfig(QXLHead* monitor_config);<br>
><br>
>  private:<br>
> @@ -610,37 +715,41 @@ private:<br>
>      DWORD m_VgaCompatible;<br>
>      DWORD m_PointerCaps;<br>
>  public:<br>
> +    QXL_PAGED<br>
>      QxlDod(_In_ DEVICE_OBJECT* pPhysicalDeviceObject);<br>
> +    QXL_PAGED<br>
>      ~QxlDod(void);<br>
> -#pragma code_seg(push)<br>
> -#pragma code_seg()<br>
>      BOOLEAN IsDriverActive() const<br>
>      {<br>
>          return m_Flags.DriverStarted;<br>
>      }<br>
> -#pragma code_seg(pop)<br>
> -<br>
> +    QXL_PAGED<br>
>      NTSTATUS StartDevice(_In_  DXGK_START_INFO*   pDxgkStartInfo,<br>
>                           _In_  DXGKRNL_INTERFACE* pDxgkInterface,<br>
>                           _Out_ ULONG*             pNumberOfViews,<br>
>                           _Out_ ULONG*             pNumberOfChildren);<br>
> +    QXL_PAGED<br>
>      NTSTATUS StopDevice(VOID);<br>
>      // Must be Non-Paged<br>
>      VOID ResetDevice(VOID);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS DispatchIoRequest(_In_  ULONG VidPnSourceId,<br>
>                                 _In_  VIDEO_REQUEST_PACKET* pVideoRequestPacket);<br>
> +    QXL_PAGED<br>
>      NTSTATUS SetPowerState(_In_  ULONG HardwareUid,<br>
>                                 _In_  DEVICE_POWER_STATE DevicePowerState,<br>
>                                 _In_  POWER_ACTION       ActionType);<br>
>      // Report back child capabilities<br>
> +    QXL_PAGED<br>
>      NTSTATUS QueryChildRelations(_Out_<wbr>writes_bytes_(<wbr>ChildRelationsSize) DXGK_CHILD_DESCRIPTOR* pChildRelations,<br>
>                                   _In_                             ULONG                  ChildRelationsSize);<br>
> -<br>
> +    QXL_PAGED<br>
>      NTSTATUS QueryChildStatus(_Inout_ DXGK_CHILD_STATUS* pChildStatus,<br>
>                                _In_    BOOLEAN            NonDestructiveOnly);<br>
><br>
>      // Return EDID if previously retrieved<br>
> +    QXL_PAGED<br>
>      NTSTATUS QueryDeviceDescriptor(_In_    ULONG                   ChildUid,<br>
>                                     _Inout_ DXGK_DEVICE_DESCRIPTOR* pDeviceDescriptor);<br>
><br>
> @@ -651,37 +760,53 @@ public:<br>
>      VOID DpcRoutine(VOID);<br>
><br>
>      // Return DriverCaps, doesn't support other queries though<br>
> +    QXL_PAGED<br>
>      NTSTATUS QueryAdapterInfo(_In_ CONST DXGKARG_QUERYADAPTERINFO* pQueryAdapterInfo);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS Escape(_In_ CONST DXGKARG_ESCAPE* pEscape);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS PresentDisplayOnly(_In_ CONST DXGKARG_PRESENT_DISPLAYONLY* pPresentDisplayOnly);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS QueryInterface(_In_ CONST PQUERY_INTERFACE     QueryInterface);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS IsSupportedVidPn(_Inout_ DXGKARG_ISSUPPORTEDVIDPN* pIsSupportedVidPn);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS RecommendFunctionalVidPn(_In_ CONST DXGKARG_<wbr>RECOMMENDFUNCTIONALVIDPN* CONST pRecommendFunctionalVidPn);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS RecommendVidPnTopology(_In_ CONST DXGKARG_<wbr>RECOMMENDVIDPNTOPOLOGY* CONST pRecommendVidPnTopology);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS RecommendMonitorModes(_In_ CONST DXGKARG_RECOMMENDMONITORMODES* CONST pRecommendMonitorModes);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS EnumVidPnCofuncModality(_In_ CONST DXGKARG_<wbr>ENUMVIDPNCOFUNCMODALITY* CONST pEnumCofuncModality);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS SetVidPnSourceVisibility(_In_ CONST DXGKARG_<wbr>SETVIDPNSOURCEVISIBILITY* pSetVidPnSourceVisibility);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS CommitVidPn(_In_ CONST DXGKARG_COMMITVIDPN* CONST pCommitVidPn);<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS UpdateActiveVidPnPresentPath(_<wbr>In_ CONST DXGKARG_<wbr>UPDATEACTIVEVIDPNPRESENTPATH* CONST pUpdateActiveVidPnPresentPath)<wbr>;<br>
><br>
> +    QXL_PAGED<br>
>      NTSTATUS QueryVidPnHWCapability(_Inout_ DXGKARG_<wbr>QUERYVIDPNHWCAPABILITY* pVidPnHWCaps);<br>
><br>
>      // Part of PnPStop (PnP instance only), returns current mode information (which will be passed to fallback instance by dxgkrnl)<br>
> +    QXL_PAGED<br>
>      NTSTATUS StopDeviceAndReleasePostDispla<wbr>yOwnership(_In_  D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId,<br>
>                                                        _Out_ DXGK_DISPLAY_INFORMATION*      pDisplayInfo);<br>
><br>
> @@ -703,39 +828,52 @@ public:<br>
>                                   _In_                                     INT   PositionY);<br>
>      PDXGKRNL_INTERFACE GetDxgkInterface(void) { return &m_DxgkInterface;}<br>
>  private:<br>
> +    QXL_PAGED<br>
>      VOID CleanUp(VOID);<br>
> +    QXL_PAGED<br>
>      NTSTATUS CheckHardware();<br>
> +    QXL_PAGED<br>
>      NTSTATUS WriteHWInfoStr(_In_ HANDLE DevInstRegKeyHandle, _In_ PCWSTR pszwValueName, _In_ PCSTR pszValue);<br>
>      // Set the given source mode on the given path<br>
> +    QXL_PAGED<br>
>      NTSTATUS SetSourceModeAndPath(CONST D3DKMDT_VIDPN_SOURCE_MODE* pSourceMode,<br>
>                                    CONST D3DKMDT_VIDPN_PRESENT_PATH* pPath);<br>
><br>
>      // Add the current mode to the given monitor source mode set<br>
> +    QXL_PAGED<br>
>      NTSTATUS AddSingleMonitorMode(_In_ CONST DXGKARG_RECOMMENDMONITORMODES* CONST pRecommendMonitorModes);<br>
><br>
>      // Add the current mode to the given VidPn source mode set<br>
> +    QXL_PAGED<br>
>      NTSTATUS AddSingleSourceMode(_In_ CONST DXGK_VIDPNSOURCEMODESET_<wbr>INTERFACE* pVidPnSourceModeSetInterface,<br>
>                                   D3DKMDT_HVIDPNSOURCEMODESET hVidPnSourceModeSet,<br>
>                                   D3DDDI_VIDEO_PRESENT_SOURCE_ID SourceId);<br>
><br>
>      // Add the current mode (or the matching to pinned source mode) to the give VidPn target mode set<br>
> +    QXL_PAGED<br>
>      NTSTATUS AddSingleTargetMode(_In_ CONST DXGK_VIDPNTARGETMODESET_<wbr>INTERFACE* pVidPnTargetModeSetInterface,<br>
>                                   D3DKMDT_HVIDPNTARGETMODESET hVidPnTargetModeSet,<br>
>                                   _In_opt_ CONST D3DKMDT_VIDPN_SOURCE_MODE* pVidPnPinnedSourceModeInfo,<br>
>                                   D3DDDI_VIDEO_PRESENT_SOURCE_ID SourceId);<br>
>      D3DDDI_VIDEO_PRESENT_SOURCE_ID FindSourceForTarget(D3DDDI_<wbr>VIDEO_PRESENT_TARGET_ID TargetId, BOOLEAN DefaultToZero);<br>
> +    QXL_PAGED<br>
>      NTSTATUS IsVidPnSourceModeFieldsValid(<wbr>CONST D3DKMDT_VIDPN_SOURCE_MODE* pSourceMode) const;<br>
> +    QXL_PAGED<br>
>      NTSTATUS IsVidPnPathFieldsValid(CONST D3DKMDT_VIDPN_PRESENT_PATH* pPath) const;<br>
> +    QXL_PAGED<br>
>      NTSTATUS RegisterHWInfo(_In_ ULONG Id);<br>
> +    QXL_PAGED<br>
>      NTSTATUS ReadConfiguration();<br>
>  };<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS<br>
>  MapFrameBuffer(<br>
>      _In_                PHYSICAL_ADDRESS    PhysicalAddress,<br>
>      _In_                ULONG               Length,<br>
>      _Outptr_result_bytebuffer_(<wbr>Length) VOID**              VirtualAddress);<br>
><br>
> +QXL_PAGED<br>
>  NTSTATUS<br>
>  UnmapFrameBuffer(<br>
>      _In_reads_bytes_(Length) VOID* VirtualAddress,<br>
> @@ -743,6 +881,7 @@ UnmapFrameBuffer(<br>
><br>
>  UINT BPPFromPixelFormat(<wbr>D3DDDIFORMAT Format);<br>
>  D3DDDIFORMAT PixelFormatFromBPP(UINT BPP);<br>
> +QXL_PAGED<br>
>  UINT SpiceFromPixelFormat(<wbr>D3DDDIFORMAT Format);<br>
><br>
>  VOID CopyBitsGeneric(<br>
> --<br>
> 2.7.4<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> Spice-devel mailing list<br>
> <a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.<wbr>org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/spice-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/spice-devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font size="4" color="#0b5394" face="times new roman, serif">Respectfully,<br></font><div style="font-size:12.8px;color:rgb(136,136,136)"><font size="4" color="#0b5394" face="times new roman, serif"><b><i>Sameeh Jubran</i></b></font></div><div style="font-size:12.8px;color:rgb(136,136,136)"><i style="color:rgb(7,55,99);font-family:"times new roman",serif;font-size:large"><span style="line-height:15px"><a href="https://il.linkedin.com/pub/sameeh-jubran/87/747/a8a" title="View public profile" name="UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_14e2c1de96f8c195_UNIQUE_ID_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_webProfileURL" style="color:rgb(17,85,204);margin:0px;padding:0px;border-width:0px;outline:none;vertical-align:baseline;text-decoration:none" target="_blank">Linkedin</a></span></i><br></div><div style="font-size:12.8px;color:rgb(136,136,136)"><font size="4" face="times new roman, serif" color="#073763"><i>Junior Software Engineer @ <a href="http://www.daynix.com" target="_blank">Daynix</a>.</i></font></div></div></div></div></div></div></div>
</div></div>