Dynamic add virtual audio devices

Hi,everyone.
The situation is that I am a newer to windows kernel driver and I want to dynamic add subdevices a pair of mic and speaker.I have a app to send custom IOCTL code to the driver ,and when driver receive the code will add a pair of subdevices.But when I want to add the sixth pair of subdevices the API PcRegisterSubdevice failed with STATUS_ALLOTTED_SPACE_EXCEEDED.I think i pass valid parameters to PcRegisterSubdevice.
I am not sure is this issue caused by the subdevices name is same or other reasion,I wanna change the subdevices name, but like I said I am a newer to Windows kernel I do not find a way to make subdevices name unique. Is anybody can help me figure out what shoud I do?


When you called PcAddAdapterDevice what value did you provide for MaxObjects?

1 Like

@Mark_Roddy said:
When you called PcAddAdapterDevice what value did you provide for MaxObjects?

OMG,Your advice was amazing. I ignored the basics.Thank you so much.I should be more careful in the future.

@Mark_Roddy said:
When you called PcAddAdapterDevice what value did you provide for MaxObjects?

I have anthoer issue is how to set the subdevice name when driver register the deivces,Do you have any idea?

@Slim said:

@Mark_Roddy said:
When you called PcAddAdapterDevice what value did you provide for MaxObjects?

I have another issue is how to set the subdevice name when driver register the deivces,Do you have any idea?

The concept of “name” is quite ambiguous in the audio device world. What, exactly, do you mean by that?

@Tim_Roberts said:
The concept of “name” is quite ambiguous in the audio device world. What, exactly, do you mean by that?

Sorry,My question is not detailed enough.
When the driver create virtual audio device is a pair,a mic and a speaker.Now the device name is “麦克风 (Virtual Audio Device)” and “扬声器 (Virtual Audio Device)”.I want to change the name like this:“Mic 1 (Virtual Audio Device)” and “Speaker 1 (Virtual Audio Device)”
“Mic 2 (Virtual Audio Device)” and “Speaker 2 (Virtual Audio Device)”
“Mic 3 (Virtual Audio Device)” and “Speaker 3 (Virtual Audio Device)”
.
.
.
“Mic N (Virtual Audio Device)” and “Speaker N (Virtual Audio Device)”
“Mic N+1 (Virtual Audio Device)” and “Speaker N+1 (Virtual Audio Device)”
Here’s what I’m looking for.What should I do.Can you give me some advices?Thank you very much.