[wdmaudiodev] Re: Using user defined IOCTL calls in MSVAD

  • From: Tim Roberts <timr@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Wed, 21 Mar 2007 10:05:46 -0700

AsHwAtH wrote:
> I want to know how do i define the new IOCTL's in the MSVAD driver,
> using CTL_CODE? I tried this but the <type> has to match that of KS
> type...right?
> After adding the new IOCTL's i should be able to still use Winamp and
> other applications but only my application should have additional
> IOCTL support.
> Say, after defining this IOCTL, how do i call? DeviceIoControl needs a
> handle for the device and where do i get that.

Basically, you use the SetupDi APIs (like SetupDiEnumDeviceInfo) to scan
through all of the devices in whatever KSCATEGORY your driver exposes,
until you find your own, usually by looking for the device's "friendly
name".  That gives you the official file name, which you can then pass
to CreateFile to get the device handle.

There are lots of examples of this process.  Many of the DirectShow
sample apps use this technique to find capture drivers.  The AC97
control panel sample in the DDK (src\audio\ac97\cpl) also uses it to
search for a topology driver.

Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, 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: