[Spice-devel] [PATCH v3 14/28] Code Analysis clean up

Sameeh Jubran sameeh at daynix.com
Wed Sep 7 13:10:32 UTC 2016


Based on a patch by Sandy Stutsman <sstutsma at redhat.com>

Signed-off-by: Sameeh Jubran <sameeh at daynix.com>
---
 qxldod/QxlDod.cpp | 471 ++++++++++++++++++++++++++++++------------------------
 1 file changed, 260 insertions(+), 211 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 05c6eb9..a6b7d65 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -3,7 +3,7 @@
 #include "qxl_windows.h"
 
 #pragma code_seg(push)
-#pragma code_seg()
+#pragma code_seg("PAGE")
 
 #define WIN_QXL_INT_MASK ((QXL_INTERRUPT_DISPLAY) | \
                           (QXL_INTERRUPT_CURSOR) | \
@@ -61,6 +61,7 @@ QxlDod::QxlDod(_In_ DEVICE_OBJECT* pPhysicalDeviceObject) : m_pPhysicalDevice(pP
                                                             m_MonitorPowerState(PowerDeviceD0),
                                                             m_AdapterPowerState(PowerDeviceD0)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s\n", __FUNCTION__));
     *((UINT*)&m_Flags) = 0;
     RtlZeroMemory(&m_DxgkInterface, sizeof(m_DxgkInterface));
@@ -242,6 +243,7 @@ DbgDevicePowerString(
     __in DEVICE_POWER_STATE Type
     )
 {
+    PAGED_CODE();
     switch (Type)
     {
     case PowerDeviceUnspecified:
@@ -266,6 +268,7 @@ DbgPowerActionString(
     __in POWER_ACTION Type
     )
 {
+    PAGED_CODE();
     switch (Type)
     {
     case PowerActionNone:
@@ -1466,7 +1469,7 @@ NTSTATUS QxlDod::CommitVidPn(_In_ CONST DXGKARG_COMMITVIDPN* CONST pCommitVidPn)
 
 CommitVidPnExit:
 
-    NTSTATUS TempStatus;
+    NTSTATUS TempStatus(STATUS_SUCCESS);
     UNREFERENCED_PARAMETER(TempStatus);
 
     if ((pVidPnSourceModeSetInterface != NULL) &&
@@ -1656,7 +1659,7 @@ NTSTATUS QxlDod::UpdateActiveVidPnPresentPath(_In_ CONST DXGKARG_UPDATEACTIVEVID
 //
 // Non-Paged Code
 //
-#pragma code_seg(push)
+#pragma code_seg(push)  //Non-Paged Code
 #pragma code_seg()
 
 VOID QxlDod::DpcRoutine(VOID)
@@ -1827,7 +1830,7 @@ NTSTATUS QxlDod::WriteHWInfoStr(_In_ HANDLE DevInstRegKeyHandle, _In_ PCWSTR psz
     return Status;
 }
 
-NTSTATUS QxlDod::RegisterHWInfo(ULONG Id)
+NTSTATUS QxlDod::RegisterHWInfo(_In_ ULONG Id)
 {
     PAGED_CODE();
 
@@ -1960,7 +1963,7 @@ NTSTATUS QxlDod::ReadConfiguration()
 //
 // Non-Paged Code
 //
-#pragma code_seg(push)
+#pragma code_seg(push) //Non-Paged
 #pragma code_seg()
 D3DDDI_VIDEO_PRESENT_SOURCE_ID QxlDod::FindSourceForTarget(D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId, BOOLEAN DefaultToZero)
 {
@@ -1976,122 +1979,40 @@ D3DDDI_VIDEO_PRESENT_SOURCE_ID QxlDod::FindSourceForTarget(D3DDDI_VIDEO_PRESENT_
     return DefaultToZero ? 0 : D3DDDI_ID_UNINITIALIZED;
 }
 
-#pragma code_seg(pop) // End Non-Paged Code
-
-//
-// Frame buffer map/unmap
-//
-
-NTSTATUS
-MapFrameBuffer(
-    _In_                       PHYSICAL_ADDRESS    PhysicalAddress,
-    _In_                       ULONG               Length,
-    _Outptr_result_bytebuffer_(Length) VOID**              VirtualAddress)
+VOID GetPitches(_In_ CONST BLT_INFO* pBltInfo, _Out_ LONG* pPixelPitch, _Out_ LONG* pRowPitch)
 {
-    PAGED_CODE();
-
-    //
-    // Check for parameters
-    //
-    if ((PhysicalAddress.QuadPart == (ULONGLONG)0) ||
-        (Length == 0) ||
-        (VirtualAddress == NULL))
+    switch (pBltInfo->Rotation) {
+    case D3DKMDT_VPPR_IDENTITY:
     {
-        DbgPrint(TRACE_LEVEL_ERROR, ("One of PhysicalAddress.QuadPart (0x%I64x), Length (%lu), VirtualAddress (%p) is NULL or 0\n",
-                        PhysicalAddress.QuadPart, Length, VirtualAddress));
-        return STATUS_INVALID_PARAMETER;
+        *pPixelPitch = (pBltInfo->BitsPerPel / BITS_PER_BYTE);
+        *pRowPitch = pBltInfo->Pitch;
+        return;
     }
-
-    *VirtualAddress = MmMapIoSpace(PhysicalAddress,
-                                   Length,
-                                   MmWriteCombined);
-    if (*VirtualAddress == NULL)
+    case D3DKMDT_VPPR_ROTATE90:
     {
-        // The underlying call to MmMapIoSpace failed. This may be because, MmWriteCombined
-        // isn't supported, so try again with MmNonCached
-
-        *VirtualAddress = MmMapIoSpace(PhysicalAddress,
-                                       Length,
-                                       MmNonCached);
-        if (*VirtualAddress == NULL)
-        {
-            DbgPrint(TRACE_LEVEL_ERROR, ("MmMapIoSpace returned a NULL buffer when trying to allocate %lu bytes", Length));
-            return STATUS_NO_MEMORY;
-        }
+        *pPixelPitch = -((LONG) pBltInfo->Pitch);
+        *pRowPitch = (pBltInfo->BitsPerPel / BITS_PER_BYTE);
+        return;
     }
-
-    return STATUS_SUCCESS;
-}
-
-NTSTATUS
-UnmapFrameBuffer(
-    _In_reads_bytes_(Length) VOID* VirtualAddress,
-    _In_                ULONG Length)
-{
-    PAGED_CODE();
-
-
-    //
-    // Check for parameters
-    //
-    if ((VirtualAddress == NULL) && (Length == 0))
+    case D3DKMDT_VPPR_ROTATE180:
     {
-        // Allow this function to be called when there's no work to do, and treat as successful
-        return STATUS_SUCCESS;
+        *pPixelPitch = -((LONG) pBltInfo->BitsPerPel / BITS_PER_BYTE);
+        *pRowPitch = -((LONG) pBltInfo->Pitch);
+        return;
     }
-    else if ((VirtualAddress == NULL) || (Length == 0))
+    case D3DKMDT_VPPR_ROTATE270:
     {
-        DbgPrint(TRACE_LEVEL_ERROR, ("Only one of Length (%lu), VirtualAddress (%p) is NULL or 0",
-                        Length, VirtualAddress));
-        return STATUS_INVALID_PARAMETER;
+        *pPixelPitch = pBltInfo->Pitch;
+        *pRowPitch = -((LONG) pBltInfo->BitsPerPel / BITS_PER_BYTE);
+        return;
     }
-
-    MmUnmapIoSpace(VirtualAddress,
-                   Length);
-
-    return STATUS_SUCCESS;
-}
-
-
-
-
-// HW specific code
-
-VOID GetPitches(_In_ CONST BLT_INFO* pBltInfo, _Out_ LONG* pPixelPitch, _Out_ LONG* pRowPitch)
-{
-    switch (pBltInfo->Rotation)
+    default:
     {
-        case D3DKMDT_VPPR_IDENTITY:
-        {
-            *pPixelPitch = (pBltInfo->BitsPerPel / BITS_PER_BYTE);
-            *pRowPitch = pBltInfo->Pitch;
-            return;
-        }
-        case D3DKMDT_VPPR_ROTATE90:
-        {
-            *pPixelPitch = -((LONG)pBltInfo->Pitch);
-            *pRowPitch = (pBltInfo->BitsPerPel / BITS_PER_BYTE);
-            return;
-        }
-        case D3DKMDT_VPPR_ROTATE180:
-        {
-            *pPixelPitch = -((LONG)pBltInfo->BitsPerPel / BITS_PER_BYTE);
-            *pRowPitch = -((LONG)pBltInfo->Pitch);
-            return;
-        }
-        case D3DKMDT_VPPR_ROTATE270:
-        {
-            *pPixelPitch = pBltInfo->Pitch;
-            *pRowPitch = -((LONG)pBltInfo->BitsPerPel / BITS_PER_BYTE);
-            return;
-        }
-        default:
-        {
-            QXL_LOG_ASSERTION1("Invalid rotation (0x%I64x) specified", pBltInfo->Rotation);
-            *pPixelPitch = 0;
-            *pRowPitch = 0;
-            return;
-        }
+        QXL_LOG_ASSERTION1("Invalid rotation (0x%I64x) specified", pBltInfo->Rotation);
+        *pPixelPitch = 0;
+        *pRowPitch = 0;
+        return;
+    }
     }
 }
 
@@ -2101,61 +2022,60 @@ BYTE* GetRowStart(_In_ CONST BLT_INFO* pBltInfo, CONST RECT* pRect)
     LONG OffLeft = pRect->left + pBltInfo->Offset.x;
     LONG OffTop = pRect->top + pBltInfo->Offset.y;
     LONG BytesPerPixel = (pBltInfo->BitsPerPel / BITS_PER_BYTE);
-    switch (pBltInfo->Rotation)
+    switch (pBltInfo->Rotation) {
+    case D3DKMDT_VPPR_IDENTITY:
     {
-        case D3DKMDT_VPPR_IDENTITY:
-        {
-            pRet = ((BYTE*)pBltInfo->pBits +
-                           OffTop * pBltInfo->Pitch +
-                           OffLeft * BytesPerPixel);
-            break;
-        }
-        case D3DKMDT_VPPR_ROTATE90:
-        {
-            pRet = ((BYTE*)pBltInfo->pBits +
-                           (pBltInfo->Height - 1 - OffLeft) * pBltInfo->Pitch +
-                           OffTop * BytesPerPixel);
-            break;
-        }
-        case D3DKMDT_VPPR_ROTATE180:
-        {
-            pRet = ((BYTE*)pBltInfo->pBits +
-                           (pBltInfo->Height - 1 - OffTop) * pBltInfo->Pitch +
-                           (pBltInfo->Width - 1 - OffLeft) * BytesPerPixel);
-            break;
-        }
-        case D3DKMDT_VPPR_ROTATE270:
-        {
-            pRet = ((BYTE*)pBltInfo->pBits +
-                           OffLeft * pBltInfo->Pitch +
-                           (pBltInfo->Width - 1 - OffTop) * BytesPerPixel);
-            break;
-        }
-        default:
-        {
-            QXL_LOG_ASSERTION1("Invalid rotation (0x%I64x) specified", pBltInfo->Rotation);
-            break;
-        }
+        pRet = ((BYTE*) pBltInfo->pBits +
+            OffTop * pBltInfo->Pitch +
+            OffLeft * BytesPerPixel);
+        break;
+    }
+    case D3DKMDT_VPPR_ROTATE90:
+    {
+        pRet = ((BYTE*) pBltInfo->pBits +
+            (pBltInfo->Height - 1 - OffLeft) * pBltInfo->Pitch +
+            OffTop * BytesPerPixel);
+        break;
+    }
+    case D3DKMDT_VPPR_ROTATE180:
+    {
+        pRet = ((BYTE*) pBltInfo->pBits +
+            (pBltInfo->Height - 1 - OffTop) * pBltInfo->Pitch +
+            (pBltInfo->Width - 1 - OffLeft) * BytesPerPixel);
+        break;
+    }
+    case D3DKMDT_VPPR_ROTATE270:
+    {
+        pRet = ((BYTE*) pBltInfo->pBits +
+            OffLeft * pBltInfo->Pitch +
+            (pBltInfo->Width - 1 - OffTop) * BytesPerPixel);
+        break;
+    }
+    default:
+    {
+        QXL_LOG_ASSERTION1("Invalid rotation (0x%I64x) specified", pBltInfo->Rotation);
+        break;
+    }
     }
 
     return pRet;
 }
 
 /****************************Internal*Routine******************************\
- * CopyBitsGeneric
- *
- *
- * Blt function which can handle a rotated dst/src, offset rects in dst/src
- * and bpp combinations of:
- *   dst | src
- *    32 | 32   // For identity rotation this is much faster in CopyBits32_32
- *    32 | 24
- *    32 | 16
- *    24 | 32
- *    16 | 32
- *     8 | 32
- *    24 | 24   // untested
- *
+* CopyBitsGeneric
+*
+*
+* Blt function which can handle a rotated dst/src, offset rects in dst/src
+* and bpp combinations of:
+*   dst | src
+*    32 | 32   // For identity rotation this is much faster in CopyBits32_32
+*    32 | 24
+*    32 | 16
+*    24 | 32
+*    16 | 32
+*     8 | 32
+*    24 | 24   // untested
+*
 \**************************************************************************/
 
 VOID CopyBitsGeneric(
@@ -2169,13 +2089,12 @@ VOID CopyBitsGeneric(
     LONG SrcPixelPitch = 0;
     LONG SrcRowPitch = 0;
 
-    DbgPrint(TRACE_LEVEL_VERBOSE , ("---> %s NumRects = %d Dst = %p Src = %p\n", __FUNCTION__, NumRects, pDst->pBits, pSrc->pBits));
+    DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s NumRects = %d Dst = %p Src = %p\n", __FUNCTION__, NumRects, pDst->pBits, pSrc->pBits));
 
     GetPitches(pDst, &DstPixelPitch, &DstRowPitch);
     GetPitches(pSrc, &SrcPixelPitch, &SrcRowPitch);
 
-    for (UINT iRect = 0; iRect < NumRects; iRect++)
-    {
+    for (UINT iRect = 0; iRect < NumRects; iRect++) {
         CONST RECT* pRect = &pRects[iRect];
 
         NT_ASSERT(pRect->right >= pRect->left);
@@ -2187,57 +2106,47 @@ VOID CopyBitsGeneric(
         BYTE* pDstRow = GetRowStart(pDst, pRect);
         CONST BYTE* pSrcRow = GetRowStart(pSrc, pRect);
 
-        for (UINT y=0; y < NumRows; y++)
-        {
+        for (UINT y = 0; y < NumRows; y++) {
             BYTE* pDstPixel = pDstRow;
             CONST BYTE* pSrcPixel = pSrcRow;
 
-            for (UINT x=0; x < NumPixels; x++)
-            {
+            for (UINT x = 0; x < NumPixels; x++) {
                 if ((pDst->BitsPerPel == 24) ||
-                    (pSrc->BitsPerPel == 24))
-                {
+                    (pSrc->BitsPerPel == 24)) {
                     pDstPixel[0] = pSrcPixel[0];
                     pDstPixel[1] = pSrcPixel[1];
                     pDstPixel[2] = pSrcPixel[2];
                     // pPixel[3] is the alpha channel and is ignored for whichever of Src/Dst is 32bpp
                 }
-                else if (pDst->BitsPerPel == 32)
-                {
-                    if (pSrc->BitsPerPel == 32)
-                    {
-                        UINT32* pDstPixelAs32 = (UINT32*)pDstPixel;
-                        UINT32* pSrcPixelAs32 = (UINT32*)pSrcPixel;
+                else if (pDst->BitsPerPel == 32) {
+                    if (pSrc->BitsPerPel == 32) {
+                        UINT32* pDstPixelAs32 = (UINT32*) pDstPixel;
+                        UINT32* pSrcPixelAs32 = (UINT32*) pSrcPixel;
                         *pDstPixelAs32 = *pSrcPixelAs32;
                     }
-                    else if (pSrc->BitsPerPel == 16)
-                    {
-                        UINT32* pDstPixelAs32 = (UINT32*)pDstPixel;
-                        UINT16* pSrcPixelAs16 = (UINT16*)pSrcPixel;
+                    else if (pSrc->BitsPerPel == 16) {
+                        UINT32* pDstPixelAs32 = (UINT32*) pDstPixel;
+                        UINT16* pSrcPixelAs16 = (UINT16*) pSrcPixel;
 
                         *pDstPixelAs32 = CONVERT_16BPP_TO_32BPP(*pSrcPixelAs16);
                     }
-                    else
-                    {
+                    else {
                         // Invalid pSrc->BitsPerPel on a pDst->BitsPerPel of 32
                         NT_ASSERT(FALSE);
                     }
                 }
-                else if (pDst->BitsPerPel == 16)
-                {
+                else if (pDst->BitsPerPel == 16) {
                     NT_ASSERT(pSrc->BitsPerPel == 32);
 
-                    UINT16* pDstPixelAs16 = (UINT16*)pDstPixel;
+                    UINT16* pDstPixelAs16 = (UINT16*) pDstPixel;
                     *pDstPixelAs16 = CONVERT_32BPP_TO_16BPP(pSrcPixel);
                 }
-                else if (pDst->BitsPerPel == 8)
-                {
+                else if (pDst->BitsPerPel == 8) {
                     NT_ASSERT(pSrc->BitsPerPel == 32);
 
                     *pDstPixel = CONVERT_32BPP_TO_8BPP(pSrcPixel);
                 }
-                else
-                {
+                else {
                     // Invalid pDst->BitsPerPel
                     NT_ASSERT(FALSE);
                 }
@@ -2265,8 +2174,7 @@ VOID CopyBits32_32(
 
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 
-    for (UINT iRect = 0; iRect < NumRects; iRect++)
-    {
+    for (UINT iRect = 0; iRect < NumRects; iRect++) {
         CONST RECT* pRect = &pRects[iRect];
 
         NT_ASSERT(pRect->right >= pRect->left);
@@ -2275,15 +2183,14 @@ VOID CopyBits32_32(
         UINT NumPixels = pRect->right - pRect->left;
         UINT NumRows = pRect->bottom - pRect->top;
         UINT BytesToCopy = NumPixels * 4;
-        BYTE* pStartDst = ((BYTE*)pDst->pBits +
-                          (pRect->top + pDst->Offset.y) * pDst->Pitch +
-                          (pRect->left + pDst->Offset.x) * 4);
-        CONST BYTE* pStartSrc = ((BYTE*)pSrc->pBits +
-                                (pRect->top + pSrc->Offset.y) * pSrc->Pitch +
-                                (pRect->left + pSrc->Offset.x) * 4);
-
-        for (UINT i = 0; i < NumRows; ++i)
-        {
+        BYTE* pStartDst = ((BYTE*) pDst->pBits +
+            (pRect->top + pDst->Offset.y) * pDst->Pitch +
+            (pRect->left + pDst->Offset.x) * 4);
+        CONST BYTE* pStartSrc = ((BYTE*) pSrc->pBits +
+            (pRect->top + pSrc->Offset.y) * pSrc->Pitch +
+            (pRect->left + pSrc->Offset.x) * 4);
+
+        for (UINT i = 0; i < NumRows; ++i) {
             RtlCopyMemory(pStartDst, pStartSrc, BytesToCopy);
             pStartDst += pDst->Pitch;
             pStartSrc += pSrc->Pitch;
@@ -2293,7 +2200,7 @@ VOID CopyBits32_32(
 }
 
 
-VOID BltBits (
+VOID BltBits(
     BLT_INFO* pDst,
     CONST BLT_INFO* pSrc,
     UINT  NumRects,
@@ -2303,30 +2210,102 @@ VOID BltBits (
     // This usage is redundant in the sample driver since it is already being used for MmProbeAndLockPages. However, it is very important
     // to have this in place and to make sure developers don't miss it, it is in these two locations.
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
-    __try
-    {
+    __try {
         if (pDst->BitsPerPel == 32 &&
             pSrc->BitsPerPel == 32 &&
             pDst->Rotation == D3DKMDT_VPPR_IDENTITY &&
-            pSrc->Rotation == D3DKMDT_VPPR_IDENTITY)
-        {
+            pSrc->Rotation == D3DKMDT_VPPR_IDENTITY) {
             // This is by far the most common copy function being called
             CopyBits32_32(pDst, pSrc, NumRects, pRects);
         }
-        else
-        {
+        else {
             CopyBitsGeneric(pDst, pSrc, NumRects, pRects);
         }
     }
-    #pragma prefast(suppress: __WARNING_EXCEPTIONEXECUTEHANDLER, "try/except is only able to protect against user-mode errors and these are the only errors we try to catch here");
-    __except(EXCEPTION_EXECUTE_HANDLER)
+#pragma prefast(suppress: __WARNING_EXCEPTIONEXECUTEHANDLER, "try/except is only able to protect against user-mode errors and these are the only errors we try to catch here");
+    __except (EXCEPTION_EXECUTE_HANDLER)
     {
         DbgPrint(TRACE_LEVEL_ERROR, ("Either dst (0x%I64x) or src (0x%I64x) bits encountered exception during access.\n", pDst->pBits, pSrc->pBits));
     }
 }
 
+//
+// Frame buffer map/unmap
+//
+
+NTSTATUS
+MapFrameBuffer(
+    _In_                       PHYSICAL_ADDRESS    PhysicalAddress,
+    _In_                       ULONG               Length,
+    _Outptr_result_bytebuffer_(Length) VOID**              VirtualAddress)
+{
+    PAGED_CODE();
+
+    //
+    // Check for parameters
+    //
+    if ((PhysicalAddress.QuadPart == (ULONGLONG)0) ||
+        (Length == 0) ||
+        (VirtualAddress == NULL))
+    {
+        DbgPrint(TRACE_LEVEL_ERROR, ("One of PhysicalAddress.QuadPart (0x%I64x), Length (%lu), VirtualAddress (%p) is NULL or 0\n",
+                        PhysicalAddress.QuadPart, Length, VirtualAddress));
+        return STATUS_INVALID_PARAMETER;
+    }
+
+    *VirtualAddress = MmMapIoSpaceEx(PhysicalAddress,
+                                   Length,
+                                   PAGE_WRITECOMBINE | PAGE_READWRITE);
+    if (*VirtualAddress == NULL)
+    {
+        // The underlying call to MmMapIoSpace failed. This may be because, MmWriteCombined
+        // isn't supported, so try again with MmNonCached
+
+        *VirtualAddress = MmMapIoSpaceEx(PhysicalAddress,
+                                       Length,
+                                     (ULONG) (PAGE_NOCACHE | PAGE_READWRITE));
+        if (*VirtualAddress == NULL)
+        {
+            DbgPrint(TRACE_LEVEL_ERROR, ("MmMapIoSpace returned a NULL buffer when trying to allocate %lu bytes", Length));
+            return STATUS_NO_MEMORY;
+        }
+    }
+
+    return STATUS_SUCCESS;
+}
+
+NTSTATUS
+UnmapFrameBuffer(
+    _In_reads_bytes_(Length) VOID* VirtualAddress,
+    _In_                ULONG Length)
+{
+    PAGED_CODE();
+
+
+    //
+    // Check for parameters
+    //
+    if ((VirtualAddress == NULL) && (Length == 0))
+    {
+        // Allow this function to be called when there's no work to do, and treat as successful
+        return STATUS_SUCCESS;
+    }
+    else if ((VirtualAddress == NULL) || (Length == 0))
+    {
+        DbgPrint(TRACE_LEVEL_ERROR, ("Only one of Length (%lu), VirtualAddress (%p) is NULL or 0",
+                        Length, VirtualAddress));
+        return STATUS_INVALID_PARAMETER;
+    }
+
+    MmUnmapIoSpace(VirtualAddress,
+                   Length);
+
+    return STATUS_SUCCESS;
+}
+
 VgaDevice::VgaDevice(_In_ QxlDod* pQxlDod) : HwDeviceInterface(pQxlDod)
 {
+    PAGED_CODE();
     m_pQxlDod = pQxlDod;
     m_ModeInfo = NULL;
     m_ModeCount = 0;
@@ -2337,6 +2316,7 @@ VgaDevice::VgaDevice(_In_ QxlDod* pQxlDod) : HwDeviceInterface(pQxlDod)
 
 VgaDevice::~VgaDevice(void)
 {
+    PAGED_CODE();
     HWClose();
     delete [] reinterpret_cast<BYTE*>(m_ModeInfo);
     delete [] reinterpret_cast<BYTE*>(m_ModeNumbers);
@@ -2577,6 +2557,7 @@ NTSTATUS VgaDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
 
 NTSTATUS VgaDevice::QueryCurrentMode(PVIDEO_MODE RequestedMode)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
     NTSTATUS Status = STATUS_SUCCESS;
     UNREFERENCED_PARAMETER(RequestedMode);
@@ -2586,6 +2567,8 @@ NTSTATUS VgaDevice::QueryCurrentMode(PVIDEO_MODE RequestedMode)
 
 NTSTATUS VgaDevice::SetCurrentMode(ULONG Mode)
 {
+    PAGED_CODE();
+
     NTSTATUS Status = STATUS_SUCCESS;
     DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s Mode = %x\n", __FUNCTION__, Mode));
     X86BIOS_REGISTERS regs = {0};
@@ -2602,6 +2585,8 @@ NTSTATUS VgaDevice::SetCurrentMode(ULONG Mode)
 
 NTSTATUS VgaDevice::GetCurrentMode(ULONG* pMode)
 {
+    PAGED_CODE();
+
     NTSTATUS Status = STATUS_SUCCESS;
     DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s\n", __FUNCTION__));
     X86BIOS_REGISTERS regs = {0};
@@ -2618,6 +2603,8 @@ NTSTATUS VgaDevice::GetCurrentMode(ULONG* pMode)
 
 NTSTATUS VgaDevice::HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo)
 {
+    PAGED_CODE();
+
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     UNREFERENCED_PARAMETER(pResList);
     UNREFERENCED_PARAMETER(pDispInfo);
@@ -2627,13 +2614,17 @@ NTSTATUS VgaDevice::HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION*
 
 NTSTATUS VgaDevice::HWClose(void)
 {
+    PAGED_CODE();
+
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
     return STATUS_SUCCESS;
 }
 
-NTSTATUS VgaDevice::SetPowerState(_In_  DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo)
+NTSTATUS VgaDevice::SetPowerState(DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo)
 {
+    PAGED_CODE();
+
     DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s\n", __FUNCTION__));
 
     X86BIOS_REGISTERS regs = {0};
@@ -2925,18 +2916,21 @@ VOID VgaDevice::ResetDevice(VOID)
 
 NTSTATUS  VgaDevice::SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape)
 {
+    PAGED_CODE();
     UNREFERENCED_PARAMETER(pSetPointerShape);
     return STATUS_NOT_SUPPORTED;
 }
 
 NTSTATUS VgaDevice::SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition)
 {
+    PAGED_CODE();
     UNREFERENCED_PARAMETER(pSetPointerPosition);
     return STATUS_SUCCESS;
 }
 
 NTSTATUS VgaDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscap)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
     return STATUS_NOT_IMPLEMENTED;
@@ -2944,6 +2938,7 @@ NTSTATUS VgaDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscap)
 
 QxlDevice::QxlDevice(_In_ QxlDod* pQxlDod) : HwDeviceInterface(pQxlDod)
 {
+    PAGED_CODE();
     m_pQxlDod = pQxlDod;
     m_ModeInfo = NULL;
     m_ModeCount = 0;
@@ -2956,6 +2951,7 @@ QxlDevice::QxlDevice(_In_ QxlDod* pQxlDod) : HwDeviceInterface(pQxlDod)
 
 QxlDevice::~QxlDevice(void)
 {
+    PAGED_CODE();
     HWClose();
     delete [] reinterpret_cast<BYTE*>(m_ModeInfo);
     delete [] reinterpret_cast<BYTE*>(m_ModeNumbers);
@@ -3129,6 +3125,7 @@ NTSTATUS QxlDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
 
 NTSTATUS QxlDevice::QueryCurrentMode(PVIDEO_MODE RequestedMode)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
     NTSTATUS Status = STATUS_SUCCESS;
     UNREFERENCED_PARAMETER(RequestedMode);
@@ -3165,8 +3162,9 @@ NTSTATUS QxlDevice::GetCurrentMode(ULONG* pMode)
     return Status;
 }
 
-NTSTATUS QxlDevice::SetPowerState(_In_ DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo)
+NTSTATUS QxlDevice::SetPowerState(DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     switch (DevicePowerState)
     {
@@ -3182,6 +3180,7 @@ NTSTATUS QxlDevice::SetPowerState(_In_ DEVICE_POWER_STATE DevicePowerState, DXGK
 
 NTSTATUS QxlDevice::HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     PDXGKRNL_INTERFACE pDxgkInterface = m_pQxlDod->GetDxgkInterface();
     UINT pci_range = QXL_RAM_RANGE_INDEX;
@@ -3329,6 +3328,7 @@ NTSTATUS QxlDevice::HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION*
 
 NTSTATUS QxlDevice::QxlInit(DXGK_DISPLAY_INFORMATION* pDispInfo)
 {
+    PAGED_CODE();
     NTSTATUS Status = STATUS_SUCCESS;
 
     if (!InitMemSlots()) {
@@ -3356,11 +3356,13 @@ NTSTATUS QxlDevice::QxlInit(DXGK_DISPLAY_INFORMATION* pDispInfo)
 
 void QxlDevice::QxlClose()
 {
+    PAGED_CODE();
     DestroyMemSlots();
 }
 
 void QxlDevice::UnmapMemory(void)
 {
+    PAGED_CODE();
     PDXGKRNL_INTERFACE pDxgkInterface = m_pQxlDod->GetDxgkInterface();
     if (m_IoMapped && m_IoBase)
     {
@@ -3388,6 +3390,7 @@ void QxlDevice::UnmapMemory(void)
 
 BOOL QxlDevice::InitMemSlots(void)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     m_NumMemSlots = m_RomHdr->slots_end;
     m_SlotGenBits = m_RomHdr->slot_gen_bits;
@@ -3407,6 +3410,7 @@ BOOL QxlDevice::InitMemSlots(void)
 
 void QxlDevice::DestroyMemSlots(void)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     delete [] reinterpret_cast<BYTE*>(m_MemSlots);
     m_MemSlots = NULL;
@@ -3438,6 +3442,7 @@ void QxlDevice::CreatePrimarySurface(PVIDEO_MODE_INFORMATION pModeInfo)
 
 void QxlDevice::DestroyPrimarySurface(void)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 //    AsyncIo(QXL_IO_DESTROY_PRIMARY_ASYNC, 0);
     SyncIo(QXL_IO_DESTROY_PRIMARY, 0);
@@ -3446,6 +3451,7 @@ void QxlDevice::DestroyPrimarySurface(void)
 
 _inline QXLPHYSICAL QxlDevice::PA(PVOID virt, UINT8 slot_id)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("<--> %s\n", __FUNCTION__));
     MemSlot *pSlot = &m_MemSlots[slot_id];;
     return pSlot->high_bits | ((UINT64)virt - pSlot->start_virt_addr);
@@ -3453,6 +3459,7 @@ _inline QXLPHYSICAL QxlDevice::PA(PVOID virt, UINT8 slot_id)
 
 _inline UINT64 QxlDevice::VA(QXLPHYSICAL paddr, UINT8 slot_id)
 {
+    PAGED_CODE();
     UINT64 virt;
     MemSlot *pSlot = &m_MemSlots[slot_id];;
 
@@ -3465,6 +3472,7 @@ _inline UINT64 QxlDevice::VA(QXLPHYSICAL paddr, UINT8 slot_id)
 
 void QxlDevice::SetupHWSlot(UINT8 Idx, MemSlot *pSlot)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     m_RamHdr->mem_slot.mem_start = pSlot->start_phys_addr;
     m_RamHdr->mem_slot.mem_end = pSlot->end_phys_addr;
@@ -3474,6 +3482,7 @@ void QxlDevice::SetupHWSlot(UINT8 Idx, MemSlot *pSlot)
 
 BOOL QxlDevice::CreateEvents()
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     KeInitializeEvent(&m_DisplayEvent,
                       SynchronizationEvent,
@@ -3495,6 +3504,7 @@ BOOL QxlDevice::CreateEvents()
 
 BOOL QxlDevice::CreateRings()
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     m_CommandRing = &(m_RamHdr->cmd_ring);
     m_CursorRing = &(m_RamHdr->cursor_ring);
@@ -3505,6 +3515,7 @@ BOOL QxlDevice::CreateRings()
 
 void QxlDevice::AsyncIo(UCHAR  Port, UCHAR Value)
 {
+    PAGED_CODE();
     LARGE_INTEGER timeout;
     BOOLEAN locked = FALSE;
     locked = WaitForObject(&m_IoLock, NULL);
@@ -3516,6 +3527,7 @@ void QxlDevice::AsyncIo(UCHAR  Port, UCHAR Value)
 
 void QxlDevice::SyncIo(UCHAR  Port, UCHAR Value)
 {
+    PAGED_CODE();
     BOOLEAN locked = FALSE;
     locked = WaitForObject(&m_IoLock, NULL);
     WRITE_PORT_UCHAR(m_IoBase + Port, Value);
@@ -3524,6 +3536,7 @@ void QxlDevice::SyncIo(UCHAR  Port, UCHAR Value)
 
 UINT8 QxlDevice::SetupMemSlot(UINT8 Idx, UINT64 pastart, UINT64 paend, UINT64 vastart, UINT64 vaend)
 {
+    PAGED_CODE();
     UINT64 high_bits;
     MemSlot *pSlot;
     UINT8 slot_index;
@@ -3549,6 +3562,7 @@ UINT8 QxlDevice::SetupMemSlot(UINT8 Idx, UINT64 pastart, UINT64 paend, UINT64 va
 
 BOOL QxlDevice::CreateMemSlots(void)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s 3\n", __FUNCTION__));
     UINT64 len = m_RomHdr->surface0_area_size + m_RomHdr->num_pages * PAGE_SIZE;
     m_MainMemSlot = SetupMemSlot(0,
@@ -3588,6 +3602,7 @@ void QxlDevice::InitMonitorConfig(void)
 
 void QxlDevice::InitMspace(UINT32 mspace_type, UINT8 *start, size_t capacity)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s type = %d, start = %p, capacity = %d\n", __FUNCTION__, mspace_type, start, capacity));
     m_MSInfo[mspace_type]._mspace = create_mspace_with_base(start, capacity, 0, this);
     m_MSInfo[mspace_type].mspace_start = start;
@@ -3787,6 +3802,7 @@ QxlDevice::ExecutePresentDisplayOnly(
 
 void QxlDevice::WaitForReleaseRing(void)
 {
+    PAGED_CODE();
     int wait;
 
     DbgPrint(TRACE_LEVEL_VERBOSE, ("--->%s\n", __FUNCTION__));
@@ -3819,6 +3835,7 @@ void QxlDevice::WaitForReleaseRing(void)
 
 void QxlDevice::FlushReleaseRing()
 {
+    PAGED_CODE();
     UINT64 output;
     int notify;
     int num_to_release = 50;
@@ -3850,6 +3867,7 @@ void QxlDevice::FlushReleaseRing()
 
 void QxlDevice::EmptyReleaseRing()
 {
+    PAGED_CODE();
     BOOLEAN locked = FALSE;
     locked = WaitForObject(&m_MemLock, NULL);
     while (m_FreeOutputs || !SPICE_RING_IS_EMPTY(m_ReleaseRing)) {
@@ -3860,6 +3878,7 @@ void QxlDevice::EmptyReleaseRing()
 
 UINT64 QxlDevice::ReleaseOutput(UINT64 output_id)
 {
+    PAGED_CODE();
     QXLOutput *output = (QXLOutput *)output_id;
     Resource **now;
     Resource **end;
@@ -3879,6 +3898,7 @@ UINT64 QxlDevice::ReleaseOutput(UINT64 output_id)
 
 void *QxlDevice::AllocMem(UINT32 mspace_type, size_t size, BOOL force)
 {
+    PAGED_CODE();
     PVOID ptr;
     BOOLEAN locked = FALSE;
 
@@ -3927,6 +3947,7 @@ void *QxlDevice::AllocMem(UINT32 mspace_type, size_t size, BOOL force)
 
 void QxlDevice::FreeMem(UINT32 mspace_type, void *ptr)
 {
+    PAGED_CODE();
     ASSERT(m_MSInfo[mspace_type]._mspace);
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 
@@ -3947,6 +3968,7 @@ void QxlDevice::FreeMem(UINT32 mspace_type, void *ptr)
 
 QXLDrawable *QxlDevice::GetDrawable()
 {
+    PAGED_CODE();
     QXLOutput *output;
 
     output = (QXLOutput *)AllocMem(MSPACE_TYPE_DEVRAM, sizeof(QXLOutput) + sizeof(QXLDrawable), TRUE);
@@ -3959,6 +3981,7 @@ QXLDrawable *QxlDevice::GetDrawable()
 
 QXLCursorCmd *QxlDevice::CursorCmd()
 {
+    PAGED_CODE();
     QXLCursorCmd *cursor_cmd;
     QXLOutput *output;
 
@@ -3974,6 +3997,7 @@ QXLCursorCmd *QxlDevice::CursorCmd()
 
 BOOL QxlDevice::SetClip(const RECT *clip, QXLDrawable *drawable)
 {
+    PAGED_CODE();
     Resource *rects_res;
 
     if (clip == NULL) {
@@ -4003,12 +4027,14 @@ BOOL QxlDevice::SetClip(const RECT *clip, QXLDrawable *drawable)
 
 void QxlDevice::AddRes(QXLOutput *output, Resource *res)
 {
+    PAGED_CODE();
     res->refs++;
     output->resources[output->num_res++] = res;
 }
 
 void QxlDevice::DrawableAddRes(QXLDrawable *drawable, Resource *res)
 {
+    PAGED_CODE();
     QXLOutput *output;
 
     output = (QXLOutput *)((UINT8 *)drawable - sizeof(QXLOutput));
@@ -4017,6 +4043,7 @@ void QxlDevice::DrawableAddRes(QXLDrawable *drawable, Resource *res)
 
 void QxlDevice::CursorCmdAddRes(QXLCursorCmd *cmd, Resource *res)
 {
+    PAGED_CODE();
     QXLOutput *output;
 
     output = (QXLOutput *)((UINT8 *)cmd - sizeof(QXLOutput));
@@ -4025,6 +4052,7 @@ void QxlDevice::CursorCmdAddRes(QXLCursorCmd *cmd, Resource *res)
 
 void QxlDevice::FreeClipRectsEx(Resource *res)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("<--> %s\n", __FUNCTION__));
     QxlDevice* pqxl = (QxlDevice*)res->ptr;
     pqxl->FreeClipRects(res);
@@ -4032,6 +4060,7 @@ void QxlDevice::FreeClipRectsEx(Resource *res)
 
 void QxlDevice::FreeClipRects(Resource *res)
 {
+    PAGED_CODE();
     QXLPHYSICAL chunk_phys;
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 
@@ -4047,6 +4076,7 @@ void QxlDevice::FreeClipRects(Resource *res)
 
 void QxlDevice::FreeBitmapImageEx(Resource *res)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("<--> %s\n", __FUNCTION__));
     QxlDevice* pqxl = (QxlDevice*)res->ptr;
     pqxl->FreeBitmapImage(res);
@@ -4054,6 +4084,7 @@ void QxlDevice::FreeBitmapImageEx(Resource *res)
 
 void QxlDevice::FreeBitmapImage(Resource *res)
 {
+    PAGED_CODE();
     InternalImage *internal;
     QXLPHYSICAL chunk_phys;
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
@@ -4073,6 +4104,7 @@ void QxlDevice::FreeBitmapImage(Resource *res)
 
 void QxlDevice::FreeCursorEx(Resource *res)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("<--> %s\n", __FUNCTION__));
     QxlDevice* pqxl = (QxlDevice*)res->ptr;
     pqxl->FreeCursor(res);
@@ -4080,6 +4112,7 @@ void QxlDevice::FreeCursorEx(Resource *res)
 
 void QxlDevice::FreeCursor(Resource *res)
 {
+    PAGED_CODE();
     QXLPHYSICAL chunk_phys;
 
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
@@ -4096,6 +4129,7 @@ void QxlDevice::FreeCursor(Resource *res)
 
 QXLDrawable *QxlDevice::Drawable(UINT8 type, CONST RECT *area, CONST RECT *clip, UINT32 surface_id)
 {
+    PAGED_CODE();
     QXLDrawable *drawable;
 
     ASSERT(area);
@@ -4121,7 +4155,9 @@ QXLDrawable *QxlDevice::Drawable(UINT8 type, CONST RECT *area, CONST RECT *clip,
     return drawable;
 }
 
-void QxlDevice::PushDrawable(QXLDrawable *drawable) {
+void QxlDevice::PushDrawable(QXLDrawable *drawable)
+{
+    PAGED_CODE();
     QXLCommand *cmd;
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 
@@ -4138,6 +4174,7 @@ void QxlDevice::PushDrawable(QXLDrawable *drawable) {
 
 void QxlDevice::PushCursorCmd(QXLCursorCmd *cursor_cmd)
 {
+    PAGED_CODE();
     QXLCommand *cmd;
 
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
@@ -4159,6 +4196,7 @@ VOID QxlDevice::SetImageId(InternalImage *internal,
     LONG height,
     UINT8 format, UINT32 key)
 {
+    PAGED_CODE();
     UINT32 image_info = IMAGE_HASH_INIT_VAL(width, height, format);
 
     if (cache_me) {
@@ -4178,6 +4216,7 @@ VOID QxlDevice::BltBits (
     UINT  NumRects,
     _In_reads_(NumRects) CONST RECT *pRects)
 {
+    PAGED_CODE();
     QXLDrawable *drawable;
     Resource *image_res;
     InternalImage *internal;
@@ -4275,6 +4314,7 @@ VOID QxlDevice::PutBytesAlign(QXLDataChunk **chunk_ptr, UINT8 **now_ptr,
                             UINT8 **end_ptr, UINT8 *src, int size,
                             size_t alloc_size, uint32_t alignment)
 {
+    PAGED_CODE();
     QXLDataChunk *chunk = *chunk_ptr;
     UINT8 *now = *now_ptr;
     UINT8 *end = *end_ptr;
@@ -4339,6 +4379,7 @@ VOID QxlDevice::BlackOutScreen(CURRENT_BDD_MODE* pCurrentBddMod)
 
 NTSTATUS QxlDevice::HWClose(void)
 {
+    PAGED_CODE();
     QxlClose();
     UnmapMemory();
     return STATUS_SUCCESS;
@@ -4346,6 +4387,7 @@ NTSTATUS QxlDevice::HWClose(void)
 
 NTSTATUS  QxlDevice::SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s flag = %x\n", __FUNCTION__, pSetPointerShape->Flags.Value));
     DbgPrint(TRACE_LEVEL_INFORMATION, ("<--> %s flag = %d pitch = %d, pixels = %p, id = %d, w = %d, h = %d, x = %d, y = %d\n", __FUNCTION__,
                                  pSetPointerShape->Flags.Value,
@@ -4427,6 +4469,7 @@ NTSTATUS  QxlDevice::SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPoi
 
 NTSTATUS QxlDevice::SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition)
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     DbgPrint(TRACE_LEVEL_INFORMATION, ("<--> %s flag = %d id = %d, x = %d, y = %d\n", __FUNCTION__,
                                  pSetPointerPosition->Flags.Value,
@@ -4545,6 +4588,7 @@ NTSTATUS QxlDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscape)
 
 VOID QxlDevice::WaitForCmdRing()
 {
+    PAGED_CODE();
     int wait;
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 
@@ -4561,6 +4605,7 @@ VOID QxlDevice::WaitForCmdRing()
 
 VOID QxlDevice::PushCmd()
 {
+    PAGED_CODE();
     int notify;
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     SPICE_RING_PUSH(m_CommandRing, notify);
@@ -4572,6 +4617,7 @@ VOID QxlDevice::PushCmd()
 
 VOID QxlDevice::WaitForCursorRing(VOID)
 {
+    PAGED_CODE();
     int wait;
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 
@@ -4594,6 +4640,7 @@ VOID QxlDevice::WaitForCursorRing(VOID)
 
 VOID QxlDevice::PushCursor(VOID)
 {
+    PAGED_CODE();
     int notify;
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     SPICE_RING_PUSH(m_CursorRing, notify);
@@ -4667,7 +4714,7 @@ VOID QxlDevice::UpdateArea(CONST RECT* area, UINT32 surface_id)
     DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
 }
 
-BOOLEAN QxlDevice:: DpcCallbackEx(PVOID ptr)
+BOOLEAN QxlDevice::DpcCallbackEx(PVOID ptr)
 {
     DbgPrint(TRACE_LEVEL_VERBOSE, ("<--> %s\n", __FUNCTION__));
     PDPC_CB_CONTEXT ctx = (PDPC_CB_CONTEXT) ptr;
@@ -4712,6 +4759,7 @@ D3DDDIFORMAT PixelFormatFromBPP(UINT BPP)
 
 UINT SpiceFromPixelFormat(D3DDDIFORMAT Format)
 {
+    PAGED_CODE();
     switch (Format)
     {
         case D3DDDIFMT_UNKNOWN:
@@ -4723,3 +4771,4 @@ UINT SpiceFromPixelFormat(D3DDDIFORMAT Format)
         default: QXL_LOG_ASSERTION1("Unknown D3DDDIFORMAT 0x%I64x", Format); return 0;
     }
 }
+#pragma code_seg(pop)
\ No newline at end of file
-- 
2.7.0.windows.1



More information about the Spice-devel mailing list