[Spice-devel] [PATCH qxl-wddm-dod v4 04/10] Code Analysis fix

Sameeh Jubran sameeh at daynix.com
Sun Sep 11 13:05:23 UTC 2016


The PAGED_CODE macro ensures that the calling thread is running at an
IRQL that is low enough to permit paging. A call to this macro should
be made at the beginning of every driver routine that either contains
pageable code or accesses pageable code.

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

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

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 93fd8c6..5659e87 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));
@@ -245,6 +246,7 @@ DbgDevicePowerString(
     __in DEVICE_POWER_STATE Type
     )
 {
+    PAGED_CODE();
     switch (Type)
     {
     case PowerDeviceUnspecified:
@@ -269,6 +271,7 @@ DbgPowerActionString(
     __in POWER_ACTION Type
     )
 {
+    PAGED_CODE();
     switch (Type)
     {
     case PowerActionNone:
@@ -1473,7 +1476,7 @@ NTSTATUS QxlDod::CommitVidPn(_In_ CONST DXGKARG_COMMITVIDPN* CONST pCommitVidPn)
 
 CommitVidPnExit:
 
-    NTSTATUS TempStatus;
+    NTSTATUS TempStatus(STATUS_SUCCESS);
     UNREFERENCED_PARAMETER(TempStatus);
 
     if ((pVidPnSourceModeSetInterface != NULL) &&
@@ -1834,7 +1837,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();
 
@@ -1983,8 +1986,6 @@ 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
 //
@@ -2334,6 +2335,7 @@ VOID BltBits (
 
 VgaDevice::VgaDevice(_In_ QxlDod* pQxlDod)
 {
+    PAGED_CODE();
     m_pQxlDod = pQxlDod;
     m_ModeInfo = NULL;
     m_ModeCount = 0;
@@ -2344,6 +2346,7 @@ VgaDevice::VgaDevice(_In_ QxlDod* pQxlDod)
 
 VgaDevice::~VgaDevice(void)
 {
+    PAGED_CODE();
     HWClose();
     delete [] reinterpret_cast<BYTE*>(m_ModeInfo);
     delete [] reinterpret_cast<BYTE*>(m_ModeNumbers);
@@ -2584,6 +2587,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);
@@ -2593,6 +2597,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};
@@ -2609,6 +2615,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};
@@ -2625,6 +2633,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);
@@ -2634,13 +2644,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};
@@ -2932,18 +2946,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;
@@ -2951,6 +2968,7 @@ NTSTATUS VgaDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscap)
 
 QxlDevice::QxlDevice(_In_ QxlDod* pQxlDod)
 {
+    PAGED_CODE();
     m_pQxlDod = pQxlDod;
     m_ModeInfo = NULL;
     m_ModeCount = 0;
@@ -2963,6 +2981,7 @@ QxlDevice::QxlDevice(_In_ QxlDod* pQxlDod)
 
 QxlDevice::~QxlDevice(void)
 {
+    PAGED_CODE();
     HWClose();
     delete [] reinterpret_cast<BYTE*>(m_ModeInfo);
     delete [] reinterpret_cast<BYTE*>(m_ModeNumbers);
@@ -3136,6 +3155,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);
@@ -3172,8 +3192,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)
     {
@@ -3189,6 +3210,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;
@@ -3336,6 +3358,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()) {
@@ -3363,11 +3386,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)
     {
@@ -3395,6 +3420,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;
@@ -3414,6 +3440,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;
@@ -3445,6 +3472,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);
@@ -3453,6 +3481,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);
@@ -3460,6 +3489,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];;
 
@@ -3472,6 +3502,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;
@@ -3481,6 +3512,7 @@ void QxlDevice::SetupHWSlot(UINT8 Idx, MemSlot *pSlot)
 
 BOOL QxlDevice::CreateEvents()
 {
+    PAGED_CODE();
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     KeInitializeEvent(&m_DisplayEvent,
                       SynchronizationEvent,
@@ -3502,6 +3534,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);
@@ -3512,6 +3545,7 @@ BOOL QxlDevice::CreateRings()
 
 void QxlDevice::AsyncIo(UCHAR  Port, UCHAR Value)
 {
+    PAGED_CODE();
     LARGE_INTEGER timeout;
     BOOLEAN locked = FALSE;
     locked = WaitForObject(&m_IoLock, NULL);
@@ -3523,6 +3557,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);
@@ -3531,6 +3566,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;
@@ -3556,6 +3592,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,
@@ -3595,6 +3632,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;
@@ -3800,6 +3838,7 @@ QxlDevice::ExecutePresentDisplayOnly(
 
 void QxlDevice::WaitForReleaseRing(void)
 {
+    PAGED_CODE();
     int wait;
 
     DbgPrint(TRACE_LEVEL_VERBOSE, ("--->%s\n", __FUNCTION__));
@@ -3832,6 +3871,7 @@ void QxlDevice::WaitForReleaseRing(void)
 
 void QxlDevice::FlushReleaseRing()
 {
+    PAGED_CODE();
     UINT64 output;
     int notify;
     int num_to_release = 50;
@@ -3863,6 +3903,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)) {
@@ -3873,6 +3914,7 @@ void QxlDevice::EmptyReleaseRing()
 
 UINT64 QxlDevice::ReleaseOutput(UINT64 output_id)
 {
+    PAGED_CODE();
     QXLOutput *output = (QXLOutput *)output_id;
     Resource **now;
     Resource **end;
@@ -3892,6 +3934,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;
 
@@ -3940,6 +3983,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__));
 
@@ -3960,6 +4004,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);
@@ -3972,6 +4017,7 @@ QXLDrawable *QxlDevice::GetDrawable()
 
 QXLCursorCmd *QxlDevice::CursorCmd()
 {
+    PAGED_CODE();
     QXLCursorCmd *cursor_cmd;
     QXLOutput *output;
 
@@ -3987,6 +4033,7 @@ QXLCursorCmd *QxlDevice::CursorCmd()
 
 BOOL QxlDevice::SetClip(const RECT *clip, QXLDrawable *drawable)
 {
+    PAGED_CODE();
     Resource *rects_res;
 
     if (clip == NULL) {
@@ -4016,12 +4063,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));
@@ -4030,6 +4079,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));
@@ -4038,6 +4088,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);
@@ -4045,6 +4096,7 @@ void QxlDevice::FreeClipRectsEx(Resource *res)
 
 void QxlDevice::FreeClipRects(Resource *res)
 {
+    PAGED_CODE();
     QXLPHYSICAL chunk_phys;
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 
@@ -4060,6 +4112,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);
@@ -4067,6 +4120,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__));
@@ -4086,6 +4140,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);
@@ -4093,6 +4148,7 @@ void QxlDevice::FreeCursorEx(Resource *res)
 
 void QxlDevice::FreeCursor(Resource *res)
 {
+    PAGED_CODE();
     QXLPHYSICAL chunk_phys;
 
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
@@ -4109,6 +4165,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);
@@ -4134,7 +4191,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__));
 
@@ -4151,6 +4210,7 @@ void QxlDevice::PushDrawable(QXLDrawable *drawable) {
 
 void QxlDevice::PushCursorCmd(QXLCursorCmd *cursor_cmd)
 {
+    PAGED_CODE();
     QXLCommand *cmd;
 
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
@@ -4172,6 +4232,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) {
@@ -4192,6 +4253,7 @@ VOID QxlDevice::BltBits (
     _In_reads_(NumRects) CONST RECT *pRects,
     POINT*   pSourcePoint)
 {
+    PAGED_CODE();
     QXLDrawable *drawable;
     Resource *image_res;
     InternalImage *internal;
@@ -4289,6 +4351,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;
@@ -4353,6 +4416,7 @@ VOID QxlDevice::BlackOutScreen(CURRENT_BDD_MODE* pCurrentBddMod)
 
 NTSTATUS QxlDevice::HWClose(void)
 {
+    PAGED_CODE();
     QxlClose();
     UnmapMemory();
     return STATUS_SUCCESS;
@@ -4360,6 +4424,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,
@@ -4443,6 +4508,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,
@@ -4520,6 +4586,7 @@ void QxlDevice::SetMonitorConfig(QXLHead * monitor_config)
 
 NTSTATUS QxlDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscape)
 {
+    PAGED_CODE();
     size_t          data_size(sizeof(uint32_t));
     QXLEscape*     pQXLEscape((QXLEscape*) pEscape->pPrivateDriverData);
     NTSTATUS        status(STATUS_SUCCESS);
@@ -4560,6 +4627,7 @@ NTSTATUS QxlDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscape)
 
 VOID QxlDevice::WaitForCmdRing()
 {
+    PAGED_CODE();
     int wait;
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 
@@ -4576,6 +4644,7 @@ VOID QxlDevice::WaitForCmdRing()
 
 VOID QxlDevice::PushCmd()
 {
+    PAGED_CODE();
     int notify;
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
     SPICE_RING_PUSH(m_CommandRing, notify);
@@ -4587,6 +4656,7 @@ VOID QxlDevice::PushCmd()
 
 VOID QxlDevice::WaitForCursorRing(VOID)
 {
+    PAGED_CODE();
     int wait;
     DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 
@@ -4609,6 +4679,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);
@@ -4727,6 +4798,7 @@ D3DDDIFORMAT PixelFormatFromBPP(UINT BPP)
 
 UINT SpiceFromPixelFormat(D3DDDIFORMAT Format)
 {
+    PAGED_CODE();
     switch (Format)
     {
         case D3DDDIFMT_UNKNOWN:
@@ -4738,3 +4810,4 @@ UINT SpiceFromPixelFormat(D3DDDIFORMAT Format)
         default: QXL_LOG_ASSERTION1("Unknown D3DDDIFORMAT 0x%I64x", Format); return 0;
     }
 }
+#pragma code_seg(pop)
-- 
2.7.4



More information about the Spice-devel mailing list