OSRLogo
OSRLogoOSRLogoOSRLogo x OSR Custom Development Services
OSRLogo
x

Everything Windows Driver Development

x
x
x
GoToHomePage xLoginx
 
 

    Mon, 10 Dec 2018     118021 members

   Login
   Join


 
 
Contents
  Online Dump Analyzer
OSR Dev Blog
The NT Insider
Downloads
ListServer / Forum
  Express Links
  · The NT Insider Digital Edition - May-June 2016 Now Available!
  · Windows 8.1 Update: VS Express Now Supported
  · HCK Client install on Windows N versions
  · There's a WDFSTRING?
  · When CAN You Call WdfIoQueueP...ously

The WDK Build Environment -- Not Getting Better

Have you tried to build a driver with the new Vista DDK, which is now called the Windows Driver Kit (WDK)?  If you have, I bet you're as annoyed as I am.  If not, you should really give it a try and let me know your opinion.

It's nothing earth-shattering, but it feels like the folks who put the kit together no longer "get it" when it comes to what matters in the build environment for us devs.

Here are a few examples of kind of things I'm talking about:

  • When you build your driver (using the traditional "build -cZ" command or just "bcz"), warnings are no longer displayed in your terminal window.  You can still get to them, of course, but you'll have to find the file named buildchk_wlh_amd64.wrn.

  • Warnings are no longer treated as errors in the checked build environment (as they have been for years), but they are treated as errors in the free build environment.

  • The functions PoCallDriver and PoStartNextPowerIrp have been declared deprecated in the Vista checked build environment, causing all sorts of mess.

In terms of PoCallDriver and PoStartNextPowerIrp, let me start by saying that the Windows power management team has done the driver development world a great service by making these calls unnecessary in Vista (as reported previously in The NT Insider).  In Vista, PoCallDriver just calls IoCallDriver, and PoStartNextPowerIrp does nothing.  So, the changes to Vista rendering these DDIs unnecessary are great, and we owe them a case of beer (or something) as thanks.

What's not so great is the fact that these functions were declared "deprecated."

If you include either PoCallDriver or PoStartNextPowerIrp in your code, you get a warning... in the Vista checked build environment only.  You don't get the warning in the Vista free build environment, or in any of the down-level build environments (free or checked).  The warning:

d:\blahblah\nothingpower.c(442) :
warning C4996: 'PoCallDriver' was declared deprecated

Don't forget that you actually have to find the .wrn file to see this warning, because warnings are no longer displayed by the compiler by default.

That's not so bad, right?  Confusing and untidy, but once you figure out what's going on nothing too much to rant about?  Well, consider that you'll have to just live with the warnings if you want a single version of your driver to build in the Vista build environment but run on Vista and also down-level platforms.

Of course, if you're willing to build multiple versions of your driver (one for Vista, and another for down-level platforms) it gets really ugly.  You wind up with code that looks like the following:

//
// We're not interested in this irp, so we'll start
// the next one and pass this one down.
//
#if (NTDDI_VERSION < NTDDI_LONGHORN)
PoStartNextPowerIrp (Irp);
#endif

IoSkipCurrentIrpStackLocation(Irp);

#if (NTDDI_VERSION < NTDDI_LONGHORN)
status
= PoCallDriver (fdoData->DeviceToSendIrpsTo, Irp);
#else
status
= IoCallDriver (fdoData->DeviceToSendIrpsTo, Irp);
#endif

Let me emphasize here: The only reason the conditionals above are necessary is to eliminate the warnings generated by these functions being deprecated.  There's no actual problem calling PoCallDriver and PoStartNextPowerIrp on Vista, because they were changed to "do the right thing" on that platform, precisely for the purpose of allowing drivers to support a single executable across multiple Windows systems.

To me, this is a big mess.  I calm myself by repeating the phrase "it's a beta, after all" and looking forward to the real release.

User Comments
Rate this article and give us feedback. Do you find anything missing? Share your opinion with the community!
Post Your Comment

"Works great for removing .wrn"
Works great, hopefully post more MS declared deprecated informations.

Such as HalGetBusDataByOffset, etc.

Rating:
22-Mar-06, Billy Chen


"Warnings not working"
In the newest ddk, simply add the w option to your build command.

I.e. your build -cZ becomes build -cZw

A pain that these build options change as time goes on... Or at least that the default behaviour changes!

Rating:
27-Feb-06, Steve Goddyn


Post Your Comments.
Print this article.
Email this article.
bottom nav links