[Spice-devel] [PATCH qxl-win v2 2/6] display: not reset devices on DrvDisableDriver, RHBZ #731644

Yonit Halperin yhalperi at redhat.com
Sun Aug 28 01:23:54 PDT 2011


When several sessions of the display driver are alive,
DrvDisableDriver can be called for the older session while the newer session has already started.
It happens when you switch users on a dual monitor XP guest. Reseting the devices in DrvDisableDriver
while they are used by another session leads to a BSOD.
---
 display/driver.c |    1 -
 display/res.c    |   20 --------------------
 display/res.h    |    1 -
 3 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/display/driver.c b/display/driver.c
index 00dd7ec..252d429 100644
--- a/display/driver.c
+++ b/display/driver.c
@@ -256,7 +256,6 @@ BOOL DrvEnableDriver(ULONG engine_version, ULONG enable_data_size, PDRVENABLEDAT
 VOID DrvDisableDriver(VOID)
 {
     DEBUG_PRINT((NULL, 1, "%s\n", __FUNCTION__));
-    ResetAllDevices();
     ResDestroyGlobals();
     CleanGlobalRes();
 }
diff --git a/display/res.c b/display/res.c
index 5d28184..850d35a 100644
--- a/display/res.c
+++ b/display/res.c
@@ -3512,23 +3512,3 @@ void CheckAndSetSSE2()
 }
 
 #endif
-
-void ResetAllDevices()
-{
-    UINT32 i;
-    EngAcquireSemaphore(res_sem);
-
-    for (i = 0; i < num_global_res; i++) {
-        if (global_res[i] && global_res[i]->driver) {
-            DWORD length;
-            if (EngDeviceIoControl(global_res[i]->driver, IOCTL_VIDEO_RESET_DEVICE,
-                                   NULL, 0, NULL, 0, &length)) {
-                DEBUG_PRINT((NULL, 0, "%s: reset to device failed 0x%lx\n",
-                            __FUNCTION__, global_res[i]->driver));
-                
-            }
-        }
-    }
-
-    EngReleaseSemaphore(res_sem);
-}
diff --git a/display/res.h b/display/res.h
index 1feadb0..d447cee 100644
--- a/display/res.h
+++ b/display/res.h
@@ -70,7 +70,6 @@ void ResDestroyGlobals();
 #ifndef _WIN64
 void CheckAndSetSSE2();
 #endif
-void ResetAllDevices();
 void EmptyReleaseRing(PDev *pdev);
 void InitDeviceMemoryResources(PDev *pdev);
 void ReleaseCacheDeviceMemoryResources(PDev *pdev);
-- 
1.7.4.4



More information about the Spice-devel mailing list