简体   繁体   English

使用虚拟桌面时串行鼠标设备崩溃

[英]Serial Mouse device crashes using virtual desktop

I have some old serial based USB touchscreen systems that would be expensive to replace with new hardware. 我有一些旧的基于串行的USB触摸屏系统,要用新的硬件替换会很昂贵。

They are connected in the following manner: 它们以以下方式连接:

Serial Mouse -> Serial to USB adapter -> Thin Client -> Virtual Machine 串行鼠标->串行USB适配器->瘦客户端->虚拟机

Everything works great with one issue. 一件事情一切都很好。 I'm experiencing a driver crash everything user either logs off, shutdown, or reboots. 我遇到了一个驱动程序崩溃,导致所有用户注销,关机或重新引导。 The current workaround has been to disable the serial mouse device before logging off which is a real pain. 当前的解决方法是在注销之前禁用串行鼠标设备,这确实很麻烦。 As long as the device is disabled, everything works great. 只要禁用该设备,一切都会很好。

I did a lot of research on this issue by taking memory dumps of the crash virtual machines. 我对崩溃虚拟机的内存转储进行了很多研究。

It seems like when the user logs off, the USB device is abruptly disconnected and then Windows tries to disable the device gracefully and waits until it is confirmed, thus hanging forever. 似乎当用户注销时,USB设备突然断开连接,然后Windows尝试从容地禁用该设备并等待,直到确认为止,从而永久挂起。 In assembly it appears to call a .sys file that never returns back. 在汇编中,它似乎调用了一个永不返回的.sys文件。

Is there anything that can be done with an issue like that? 有什么可以解决的问题吗? Can you change the device shutdown order? 您可以更改设备关机顺序吗? Or perhaps tell Windows to not ensure the plug and play device is shutdown? 还是告诉Windows不要确保即插即用设备已关闭? I doubt the vendor would be willing to change their driver. 我怀疑供应商是否愿意更改其驱动程序。

I wrote a custom solution to this problem. 我针对此问题编写了自定义解决方案。

The application uses the ShutdownBlockReasonCreate API call to block Windows from shutting down. 该应用程序使用ShutdownBlockReasonCreate API调用来阻止Windows关闭。 It then listens for reboots or logoffs using the WM_QUERYENDSESSION API call. 然后,它使用WM_QUERYENDSESSION API调用侦听重新引导或注销。 When it gets this, it disabled the devices and then destroys the shutdown block created. 收到此消息后,它将禁用设备,然后销毁创建的关闭块。

A real pain but it works 真正的痛苦,但有效

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM