[wdmaudiodev] Re: Question on MSDN sysvad driver example in combination with Ks Studio; failing pin instantiation.

  • From: Tim Roberts <timr@xxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Tue, 7 Jun 2016 10:15:40 -0700

Koll, Rob wrote:

 

I am quite new to driver development. As starting point I use the MSDN
sysvad source code.

 

First of all, I noted that when building with MSVC professional 2015
update 2 there are issues around the inline use of new and delete
operators. I solved that by copying stdunk.h into my project, removing
the inline code and providing a stdunk.cpp with the now missing
implementations. Please let me know if this is a known issue, and
whether or not my approach is correct.


You can't use bare operator new and delete in the kernel, because you
need to be able to specify the paging requirement.  There is an
implementation of operator new and delete in <kcom.h> that accepts a
paging parameter:

    MY_DATA * myData = new (NonPagedPoolNx) MY_DATA;



After building the sysvad example (on a Win7 machine) I can deploy it
onto a Win 10 target machine. I can see the new device and audio end
points. I can select the sysvad Wave Speaker as default device. Upon
playing music with media player a file is created and written into the
C:\ directory. The volume indicator in the Playback Devices box goes
halfway, and falls back to zero upon ending the playback.


Then you've done very well.


My assumption is that I should be able to instantiate the pin using Ks
Studio (where all devices and end points are visible). The pin
creation fails, with a message indicating that KsCreatePin fails.
There are different codes, depending on how I exactly instantiate the pin.


KsStudio is a handy tool for doing basic validation of a KS driver. 
Using it to create functioning graphs is a guru-level exercise, one that
I have managed very rarely during my two decades with KS drivers. 
Frankly, if your driver is working with the audio engine, you have
already validated WAY more stuff than you can possibly check with KsStudio.

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

Other related posts: