[wdmaudiodev] Re: silly question about pin property and filter property

  • From: Tim Roberts <timr@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Mon, 26 Feb 2007 09:43:51 -0800

Yong Liu wrote:
> I am new to WDM audio driver, and I am puzzled in using filter
> property and pin property in developing the driver. Hope I can get
> help here. I want to communicate with the driver from user mode
> application through IOCTL_KS_PROPERTY. In the application, I used
> setupdixxx and createfile to get the handle to the driver, then used
> deviceiocontrol to set the property of the pin. In the driver, I
> declared the automation table in pin descriptor. But calling to
> deviceiocontrol failed. In the document of DDK, it is said "When a
> client sends a KS property request (that is, an IOCTL_KS_PROPERTY
> I/O-control IRP) to a filter handle or pin handle, the KS system
> driver ( /ks.sys/) delivers the request to the port driver for the
> filter object or pin object." I am wondering in my application, I only
> get the filter handle through setupdixxx and createfile, so the
> request could not be delivered to pin object, is that right? If so,
> how can I get the handle to the pin or send the request to the pin object?

It's not a silly question, but it's a somewhat complicated one. 
CreateFile gets you the WDM device object, not the filter or pin.  The
standard Win32 APIs don't know anything about kernel streaming.  In
order to talk to the pin, someone has to have asked the device to create
a filter, then asked the filter to create pins, and presumably hooked
them up in a graph somewhere.

The usual way for an application to get in touch with the filter or pin
is as part of a DirectShow filter graph.  Ksproxy will wrap your driver
and make its KS filters and pins appear as DirectShow filters and pins. 
You find the capture source in your filter graph, find its output pin,
and use the IKsProperty COM interface to send the IRP.

How are you using the audio driver?

-- 
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.

Other related posts: