Paged pool memory or Nonpaged pool memory ?? (windows driver development)

孤者浪人 提交于 2019-12-03 16:12:14

Depends. The Non paged pool should be reserved for memory that must stay in RAM so if you are doing something critical that would affected by a memory page from disk operation then use non paged.

See here for more info.

Looking at this (though it discusses c++ as opposed to C) it would seem that by default the globals can be located in either by #pragma. Also on p22 of this we see how to do this. Finally this discuss here we see that the data segment should be non pagagable by default.

Global variables in a kernel mode driver are allocated from NonPagedPool.

You can also use the device extension (when you call IoCreateDevice), it is always allocated from NonPaged memory.

I hope this helps, Martin

Another good answer that I find is: "Nonpaged pool is kernel memory which can't be paged out into the pagefile when Windows runs out of free physical memory. It is used by drivers to allocate memory which they need." from here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!