[wdmaudiodev] Re: Interfacing Audio Driver From USER MODE

  • From: timr@xxxxxxxxx
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Sun, 1 Feb 2009 21:45:12 -0800

On Mon, Feb 02, 2009 at 09:51:19AM +0530, Vipin Kumar wrote:
>    i wrote a few drivers for file system filter(before minifilter was given
> say year 2002), so i would prefer IOCTL method than KS Property.After almost
> 6 yrs, i am writing once again a driver( audio)

Well, what you prefer isn't really the most important criteria.
You need to work with the model for your driver type.  Audio drivers,
like all KS drivers, use the kernel streaming mechanisms to communicate.
That means using properties for miscellaneous requests.

> This is my first audio driver so i am confused.

No doubt.  Many people think audio drivers must be easy, but it's not

> yes, i am adding IOCTL after PcInitializeAdapter.
> Since, right now i am not handling MJ_CREATE correctly, i am just dbgprint
> fileobject to look at irp_INFO, for some calls it's NULL,
> I am still not able to open it using createfile( though i get an MJ_CREATE
> but file object is NULL)
> So what to do ??  a  code sample demonstrating MJ_CREATE & MJ_CLOSE handling
> would be a great help for newbies (like me).

You can't do this.  If you expect your driver to work as an audio driver, 
then you must let the port class driver handle IRP_MJ_CREATE.  When 
audio applications open your driver, they pass extra information in the
file name (an "instance string") that the port class driver uses to help
configure the filter.  It is the port class driver that handles the
dispatching and gives the audio driver its personality.  You can't
cut it out of the process.

If you want to access an audio driver, then you must use the same rules.
You can't just open a file and start blasting ioctls.  If you save the
original IRP_MJ_DEVICE_CONTROL handler and substitute your own, you can
get a first shot at the ioctls, but you must hass the IRPs back to the
port class handler so it continues to work as an audio driver.
Tim Roberts, timr@xxxxxxxxx
Providenza & Boeklheide, Inc.

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx


Other related posts: