[wdmaudiodev] Re: Custom Device Interface - which interface on IRP?

  • From: Tim Roberts <timr@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Wed, 21 Oct 2020 10:35:49 -0700

On Oct 21, 2020, at 10:01 AM, wdmaudiodev@xxxxxxxxxxxxxx wrote:


I realized that in my existing audio driver, I'm already intercepting 
IRP_MJ_PNP requests by doing the following in DriverEntry:

    pDriverObject->MajorFunction[IRP_MJ_PNP] = DispatchPnp;

...so, I can intercept IRP_MJ_WRITE, IRP_MJ_DEVICE_CONTROL, etc, the same 
way. For any requests I don't want to handle, I can call PcDispatchIrp.

One thing I don't understand: if my driver supports both KSCATEGORY_AUDIO and 
a custom Device Interface, how do I tell which IRP_MJ_XXXXXX requests are for 
my custom interface and which just get forwarded to PortCls?

You can’t.  So, you just handle all the ioctls you recognize, and pass 
everything else to PcDispatchIrp.
— 
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.

Other related posts: