DRIVER_PORTION_MUST_BE_NONPAGED and Visual Studio 2012

Hi

If I am bulding my driver for a 64 bit windows 7 using the old WDK 7600 my driver works fine.

If I am building my driver for a 64 bit windows 7 using the new windows 8 driver kit and Visual Studio 2012 my driver fails with the bugcheck code DRIVER_PORTION_MUST_BE_NONPAGED. It is complaining about a DbgPrint command in the addDevice function. How can a hardcoded text string be paged out?

Anyone now anything about this.

Regards
Bent

If the linker is combining constant strings with the code section (which some environments do), and that code section is paged, so will the constant strings. I’d have to look at the linker options and a linkmap to decide if Win 8 WDK kernel code is arranged this way. You might look at the link maps for a WDK 7 build of your driver and a WDK 8 build. I know the WDK 8 has compiler changes related to code segment placement, like for C++ autogenerated code.

If you run prefast/code analysis on it, does it say anything?

Could it be one of the DbgPrint arguments to format is in pagable memory? Do you have the stop code, the parameters will give more details. Do you have !analyzed output? Are you doing something like holding a spinlock (which raises your IRQL level) and then doing some operation on a Unicode string that requires access to the translation table, like outputting a Unicode string in DbgPrint? If you copy the suspect string to a some non-paged pool, and use that, does it still fail in the same way?

Jan

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@napatech.com
Sent: Thursday, July 11, 2013 4:54 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] DRIVER_PORTION_MUST_BE_NONPAGED and Visual Studio 2012

Hi

If I am bulding my driver for a 64 bit windows 7 using the old WDK 7600 my driver works fine.

If I am building my driver for a 64 bit windows 7 using the new windows 8 driver kit and Visual Studio 2012 my driver fails with the bugcheck code DRIVER_PORTION_MUST_BE_NONPAGED. It is complaining about a DbgPrint command in the addDevice function. How can a hardcoded text string be paged out?

Anyone now anything about this.

Regards
Bent


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

What does the debugger command show:

!analyze -v