king00star
驱动牛犊
驱动牛犊
  • 注册日期2006-08-17
  • 最后登录2014-04-19
  • 粉丝0
  • 关注0
  • 积分9分
  • 威望92点
  • 贡献值0点
  • 好评度15点
  • 原创分0分
  • 专家分0分
阅读:1437回复:0

驱动的代码和数据默认都是放到非分页内存中吧?

楼主#
更多 发布于:2008-09-19 21:29
修改了passthru,在有的机器上总是蓝屏

看了这个帖子 http://bbs.driverdevelop.com/htm_data/10/0705/102172.html
我也是自定义了一个函数,其中定义了一个100的数组,然后 NdisMoveMemory,
为什么最后的回复说    分配的数组是Paged Memory,所以可能会产生缺页而蓝屏

DDK的帮助文档说默认是放到非分页中吧,数组所在的内核堆栈难道能放到分页中?

DDK:
By default, the code for kernel-mode drivers is not pageable, nor is the global memory used by kernel-mode drivers pageable. You can make code pageable by adding the #pragma alloc_text compiler directive at the top of the file containing the code. The driver can then lock and unlock the code dynamically at run time by calling memory manager routines MmLockPagableCodeSection and MmUnlockPagableImageSection. For more information, see Locking Pageable Code or Data.

游客

返回顶部