Hi,
I need to process WM_DEVICECHANGE message for handling an audio device loss.
In case of Video device all work correctly: after receiving DBT_DEVICEREMOVECOMPLETE, I see correct video device id in dbcc_name member of DEV_BROADCAST_DEVICEINTERFACE structure. In my case this is a:
L"\\\\?\\USB#VID_046D&PID_082D&MI_00#7&1bfad7d5&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\\{bbefb6c7-2fc4-4139-bb8b-a58bba724083}" string and it's same heading with string that I receive using MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK:
"\\\\?\\usb#vid_046d&pid_082d&mi_00#7&1bfad7d5&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\{bbefb6c7-2fc4-4139-bb8b-a58bba724083}". Heading is L"\\\\?\\usb#vid_046d&pid_082d&mi_00#7&1bfad7d5&0&0000#" here.
In case of Audio device I have problem: after receiving DBT_DEVICEREMOVECOMPLETE, I see audio device id in dbcc_name member of DEV_BROADCAST_DEVICEINTERFACE structure that is different from received from MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_SYMBOLIC_LINK or MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_ENDPOINT_ID. In my case this is a:
L"\\\\?\\USB#VID_046D&PID_082D&MI_02#7&1bfad7d5&0&0002#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\\GLOBAL" string, but I receive "\\\\?\\SWD#MMDEVAPI#{0.0.1.00000000}.{6e254647-6d40-41ab-afa0-1848c4a11bea}#{2eef81be-33fa-4800-9670-1cd474972c3f}" using MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_SYMBOLIC_LINK. Using MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_ENDPOINT_ID is not succeeded too.
In case webcam have mic embedded and after removing camera from system I loss access to Video and Audio device on same time, so I need correct handling of this case.
Could you please describe, how to get WM_DEVICECHANGE compatible device symbolic link in case of removing audio capture device?
Thanks!
I need to process WM_DEVICECHANGE message for handling an audio device loss.
In case of Video device all work correctly: after receiving DBT_DEVICEREMOVECOMPLETE, I see correct video device id in dbcc_name member of DEV_BROADCAST_DEVICEINTERFACE structure. In my case this is a:
L"\\\\?\\USB#VID_046D&PID_082D&MI_00#7&1bfad7d5&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\\{bbefb6c7-2fc4-4139-bb8b-a58bba724083}" string and it's same heading with string that I receive using MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK:
"\\\\?\\usb#vid_046d&pid_082d&mi_00#7&1bfad7d5&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\{bbefb6c7-2fc4-4139-bb8b-a58bba724083}". Heading is L"\\\\?\\usb#vid_046d&pid_082d&mi_00#7&1bfad7d5&0&0000#" here.
In case of Audio device I have problem: after receiving DBT_DEVICEREMOVECOMPLETE, I see audio device id in dbcc_name member of DEV_BROADCAST_DEVICEINTERFACE structure that is different from received from MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_SYMBOLIC_LINK or MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_ENDPOINT_ID. In my case this is a:
L"\\\\?\\USB#VID_046D&PID_082D&MI_02#7&1bfad7d5&0&0002#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\\GLOBAL" string, but I receive "\\\\?\\SWD#MMDEVAPI#{0.0.1.00000000}.{6e254647-6d40-41ab-afa0-1848c4a11bea}#{2eef81be-33fa-4800-9670-1cd474972c3f}" using MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_SYMBOLIC_LINK. Using MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_ENDPOINT_ID is not succeeded too.
In case webcam have mic embedded and after removing camera from system I loss access to Video and Audio device on same time, so I need correct handling of this case.
Could you please describe, how to get WM_DEVICECHANGE compatible device symbolic link in case of removing audio capture device?
Thanks!