问题
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