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

Submitted by Yonit Halperin on Aug. 28, 2011, 3:23 p.m.

Details

Message ID 1314519838-16161-3-git-send-email-yhalperi@redhat.com
State New, archived
Headers show

Not browsing as part of any series.

Commit Message

Yonit Halperin Aug. 28, 2011, 3:23 p.m.
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(-)

Patch hide | download patch | download mbox

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);