Author Topic: How to find a match between SPDRP_HARDWAREID and device index in audiodevices?  (Read 5756 times)

pethead

  • Posts: 27
I need to restrict access to some devices from device list of record devices.

I enumerate their SPDRP_HARDWAREID by...

SetupDiGetClassDescription(GUID, @Buffer[0], Length(Buffer), BufSize);
aGUID:=GUID;
PnPHandle := SetupDiGetClassDevs(@aGUID, nil, 0, DIGCF_PRESENT);
DevData.cbSize := SizeOf(DevData);
res:=SetupDiEnumDeviceInfo(PnPHandle, i, DevData);
S:=GetDeviceName(PnPHandle, DevData,SPDRP_HARDWAREID);

after above S contains an USB\Vid_...\Pid value.

but waveInGetDevCaps (enumerated by waveInGetNumDevs) returns names and indexes of devices that don't match to SPDRP_HARDWAREID.

subj or other words how to set a record device defined by SPDRP_HARDWAREID?

I found similar topic but there's no anwser
http://thedailyreviewer.com/windowsos/view/how-to-link-usb-audio-device-id-hardware-midpid-10783267

for a while...
I found that BASS_RecordGetDeviceInfo returns in BASS_DEVICEINFO a driver signature (how it did that?).
I found in registry what is device has that ID driver, from that hive I may find vid\pid of hardware device. right?

BASS_DEVICEINFO returns other data in Windows XP and Win7... :(

in win7 I get BASS_DEVICEINFO.driver as {0.0.1.00000000}.{6a2e51b5-1e22-4d3a-8d2b-a2e1152f4e2d}
in winxp it returns as usbaudio.sys w\o any GUID of driver...
but why?
« Last Edit: 17 Feb '11 - 08:37 by pethead »