Detecting UVC video device disconnection (WM_DEVICECHANGE) works on Windows y but fails on Windows 10

烂漫一生 提交于 2019-12-08 03:15:06

问题


I am using the exact same code as this to handle video device loss. I am testing my app with a Logitech C920 webcam.

When the webcam is plugged into a USB2 port on Windows 7 the code works as expected and it detects a camera unplug.

However, the same code fails when the camera is connected to a USB3 port under Windows 10.

The problem is that the value of pDi->dbcc_name only partially matches that of g_pwszSymbolicLink.

I highlight the difference below.

L"\\?\USB#VID_046D&PID_082D&MI_00#7&E9B492F&0&0000#{E5323777-F976-4F5B-9B55-B94699C46E44}\GLOBAL"

L"\\?\USB#VID_046D&PID_082D&MI_00#7&E9B492F&0&0000#{65E8773D-8F56-11D0-A3B9-00A0C9223196}\GLOBAL"

Anyone know why this is? Should the code be corrected to ignore this part of the string?

来源:https://stackoverflow.com/questions/54927290/detecting-uvc-video-device-disconnection-wm-devicechange-works-on-windows-y-bu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!