[Spice-devel] [PATCH qxl-wddm-dod v4 10/10] Fixing possible BSOD
Sameeh Jubran
sameeh at daynix.com
Sun Sep 11 13:05:29 UTC 2016
Interrupts seem to arrive to the driver before the initialization phase
is over (m_pHWDevice = NULL), in that case we can't handle interrupts yet. Even
when m_pHWDevice isn't NULL, other fields aren't necessarly fully intialized till
the StartDevice function has finished initialization, thus the flag
DriverStarted should be checked upon interrupts.
Note: There is no way provided by microsoft to disable interrupts in WDDM
drivers.
Signed-off-by: Sameeh Jubran <sameeh at daynix.com>
---
qxldod/QxlDod.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 46c1dad..7060439 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -64,6 +64,7 @@ QxlDod::QxlDod(_In_ DEVICE_OBJECT* pPhysicalDeviceObject) : m_pPhysicalDevice(pP
PAGED_CODE();
DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s\n", __FUNCTION__));
*((UINT*)&m_Flags) = 0;
+ m_Flags.DriverStarted = FALSE;
RtlZeroMemory(&m_DxgkInterface, sizeof(m_DxgkInterface));
RtlZeroMemory(&m_DeviceInfo, sizeof(m_DeviceInfo));
RtlZeroMemory(m_CurrentModes, sizeof(m_CurrentModes));
@@ -1663,7 +1664,10 @@ VOID QxlDod::DpcRoutine(VOID)
BOOLEAN QxlDod::InterruptRoutine(_In_ ULONG MessageNumber)
{
DbgPrint(TRACE_LEVEL_INFORMATION, ("<--> 0 %s\n", __FUNCTION__));
- return m_pHWDevice->InterruptRoutine(&m_DxgkInterface, MessageNumber);
+ if (m_Flags.DriverStarted) {
+ return m_pHWDevice ? m_pHWDevice->InterruptRoutine(&m_DxgkInterface, MessageNumber) : FALSE;
+ }
+ return FALSE;
}
VOID QxlDod::ResetDevice(VOID)
--
2.7.4
More information about the Spice-devel
mailing list