[wdmaudiodev] Best way for Portclass-Driver-Application communication

  • From: Max K <xaseriii@xxxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Sun, 16 Jun 2013 23:09:22 +0200

Hi again,

once again I'd like to say thank you to Tim Roberts and the other guys from 
this list for supporting me with my virtual Midi driver. Over the last days, I 
got the basic functionality done and the driver already outputs synthetic MIDI 
messages.

Today I read through the various possibilites to communicate between the Driver 
and an Application. I know that this topic has been discussed alot in this 
list, but now I'm wondering which of the possibilites is the best:

- For once, IOCTLs are problematic, as one would have to overwrite the 
portclass handlers and pass IOCTLS on to the port if its meant for him, so 
probably not the best solution.

- One could also exchange data with the driver using Filter, Node or Pin 
Properties by either using predefined properties or defining custom properties. 
This seems to be a valid solution, but it certainly wasn't intended for large 
scale data transfers.

- I thought about just creating more Pins that the client would instantiate and 
defining a custom format for the pin (using KSDATAFORMAT_TYPE_STREAM). But I 
couldn't find a way to get a connection to the pin from usermode, as 
KsCreatePin and others require Kernel-Mode priviliges.

- There are probably even more ways to do this, any comments on more ways are 
welcome.

So I wonder what you guys think about this. I'd use a custom pin, if it was 
possible but this way it's probably using custom properties.

Regards,
Max

PS: A bit of a side topic: In the DMusUart Sample, the SpinLock allocating 
function "consumeEvents" will eventually call itself via "PutMessageLocked". 
Isn't this guaranteed to create a deadlock?
                                          

Other related posts: