Unless you use a pragma to change it, all statics and globals in a driver
are loaded non-paged.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply
wrote in message news:xxxxx@ntdev…
Say I write some code, and compile it into a library.
In libraryfile.cpp:
char Stuff[5] = {0,1,2,3,4};
void blah(void)
{
char a;
// Do some access to Stuff structure, etc here… i.e.,
a = Stuff[1];
}
Then, I link this library into my driver, and run it in kernel mode. In
what memory pool (Paged
/ NonPaged) will the linker put the static array “Stuff”? Can I specify
it to be non paged pool
somehow? Is “blah” safe to call from a DPC? Will a #pragma
code_seg(“CODE”) ensure it?
Also, is there a debugger command that I can use on a memory location that
will tell me whether or
not that memory is pageable or not? In this way during run time, I could
do a quick debugger check
on the Stuff array, and know for sure that it was allocated in non paged
pool?
Thanks!
James
Legal Disclaimer******
“This email may contain confidential and privileged material for the sole
use of the intended recipient. Any unauthorized review, use or distribution
by others is strictly prohibited. If you have received the message in
error, please advise the sender by reply email and delete the message. Thank
you.”
**********************************************************************