[wdmaudiodev] Re: Interfacing Audio Driver From USER MODE

  • From: Vipin Kumar <vipin@xxxxxxxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Mon, 2 Feb 2009 11:40:24 +0530

thanks tim,

   But Mr. Mathew told me
                if you want to handle IRP_MJ_DEVICE_CONTROL,  you will have
to handle the MJ_CREATE & MJ_CLOSE.

i just want some data to be passed from user mode to the audio driver, and i
really don't want to make a mess out of the driver by putting highly
complicated code.

i have registered my driver, using ioregisterinterface and  then

IoSetDeviceInterfaceState(&InstanceString,TRUE);


I use   SetupDiEnumDeviceInterfaces, SetupDiGetDeviceInterfaceDetail
to get my instance in user mode.

but createfile returns me Filenotfound err code 2.


now let me try your approach, Kernel streaming one

Now, i have opened up msvad simple, and i would like receive some data(
2KB)  from the user mode,
So my questions are,
      (i) Any samples available to transfer data from usermode to kernel
mode.please point me
      (ii)  Do i have to define a new KSPROPERTY
     (iii) How to do the user mode part  , what should be done from user
mode to send the calls?



Any code snippets are welcome.

Thanks.
Regards,
Vipin





On Mon, Feb 2, 2009 at 11:15 AM, <timr@xxxxxxxxx> wrote:

> 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
> true.
>
> > 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
>
> URL to WDMAUDIODEV page:
> http://www.wdmaudiodev.com/
>
>

Other related posts: