# Pragma code_seg ("page ")
This part of code is put into the paging memory for running.
# Pragma code_seg ()
Set the code segment as the default code segment
# Pragma code_seg ("init ")
Loaded to the init memory area. After loading, you can exit the memory.
From: http://blog.csdn.net/whatday/article/details/7100855
Windows requires that some virtual memory can be exchanged to files. Such memory is calledPaging memory
Some virtual memory will never be switched to files.Non-Paging memory
# Define pagedcode code_seg ("page"); // paging memory
# Define lockedcode code_seg (); // non-Paging
# Define initcode code_seg ("init ");
# Define pageddata data_seg ("page ");
# Define lockeddata data_seg ();
# Define initdata data_seg ("init ");
Example:
If you load a function into the paging memory, the following functions are available:
# Pragma pagedcode
Void fun ()
{
Paged_code (); // do something
}
Note:Paged_code () is a macro provided by DDK and takes effect only in the check version. It checks this function.
Indicates whether the number of interrupted requests is lower than dispatch_leval. If the number is equal to or higher than the level of the interrupted request, an asserted is generated. When the program runs on the dispatch_level (including the current layer), the program can only use non-Paging memory; otherwise, the blue screen will crash.
If you load a function into non-Paging memory, the following functions are available:
# Pragma lockedcode
Void fun ()
{
}
A routine needs to load the memory during initialization and can be detached from the memory. For example, in DriverEntry mode, DriverEntry will be large and occupy a large amount of space. In order to save memory, need to detach from memory in time
# Pragma initcode
Ntstatus DriverEntry (
In pdriver_object pdriverobject,
In punicode_string registerpath)
{// Do something}
From: http://blog.chinaunix.net/uid-24504987-id-161192.html