Map USB Port to DirectSound Device
-
I am having a problem with mapping the USB Port of a USB Device to it's coresponding DirectSound Device. I am doing this in order to associate a specific USB Port with a specific DirectSound Device in order to get the FriendlyName for the DirectSound Device to associate with an audio control. I need to have specific knowledge of the USB Port in order to make sure the endpoint audio device is going to the correct user. I'm working in VS 2005.NET C# and hope this is possible. I've taken a look at the C# version of USBView, which gets you down to the USB Device, and I have also looked at DirectSoundEnumerator, which I can use to search the Interface string for the "USB" substring in order to select the DirectSound USB Audio Devices. From what I can see so far, there is no matching information coming from either side in order to map these two together. Does anyone have any way of doing this? Thanks in advance for any help, which is greatly appreciated.
GrizMan
-
I am having a problem with mapping the USB Port of a USB Device to it's coresponding DirectSound Device. I am doing this in order to associate a specific USB Port with a specific DirectSound Device in order to get the FriendlyName for the DirectSound Device to associate with an audio control. I need to have specific knowledge of the USB Port in order to make sure the endpoint audio device is going to the correct user. I'm working in VS 2005.NET C# and hope this is possible. I've taken a look at the C# version of USBView, which gets you down to the USB Device, and I have also looked at DirectSoundEnumerator, which I can use to search the Interface string for the "USB" substring in order to select the DirectSound USB Audio Devices. From what I can see so far, there is no matching information coming from either side in order to map these two together. Does anyone have any way of doing this? Thanks in advance for any help, which is greatly appreciated.
GrizMan
Here is a further update on what I have done: I have a question about ParentIdPrefix. I am down at the device level for USB devices and I found the DriverKeyName by first setting up a SP_DEVINFO_DATA da = new SP_DEVINFO_DATA() structure and then calling SetupDiEnumDeviceInfo(h,i,ref da) and then using SetupDiGetDeviceRegistryProperty with SPDRP_DRIVER. Now I want to access the ParentIdPrefix at that level and compare it to the ParentIdPrefix I extract from the Interfaces ID string provided by DirectSound. In my code in which I have used the example from USBView to get to the USB Device level. I tried to get the ParentIdPrefix by using CM_Get_Parent with the da.DevInst value I have. The value I received (3042) does not represent the ParentIdPrefix value (string) (7&f4e88d5&0) I can see in the registry. I would like to get the value I see in the registry. Do you know how I would go about this? Thanks in advance for your help.
GrizMan