The short answer is you do not want to do this. If you are using C++
you cannot be sure where code the compiler generates such as
constructors and destructors will be placed so using any page able
sections is a bad idea. This is one of the down sides of using C++ in
the kernel, you are wasting non-paged memory.
Now that I have warned you off, the actual effort is:
#pragma alloc_text( INIT, DriverEntry )
Where INIT could be replaced by PAGED and DriverEntry by any function
name.
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
-----Original Message-----
From: Robert Randall [mailto:xxxxx@gmail.com]
Posted At: Tuesday, June 29, 2010 10:45 AM
Posted To: ntfsd
Conversation: [ntdev] C++ functions, init and paged code…
Subject: [ntdev] C++ functions, init and paged code…I’m sure this question has been answered many times but my search
engine
skills appear to be a bit less than adequate…How do I get the linker to put a C++ function into the INIT section or
the
PAGED code section?Thanks,
Robert.–
Robert Randall | xxxxx@gmail.com__________ Information from ESET Smart Security, version of virus
signature
database 5237 (20100629) __________The message was checked by ESET Smart Security.