qintangtao

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2014年1月10日

摘要: #pragma alloc_text编译时控制分页能力有时,驱动程序的某些部分必须驻留内存而另一些可以被分页,这就需要一种能控制代码和数据是否分页的方法。通过指导编译器的段分配可以实现这个目的。在运行时,装入器通过检查驱动程序中的段名, 把段放到你指定的内存池中。此外在运行时调用内存管理器的例程也能实现这个目的。需要注意的是:--------------------------------------------------------------------------------(1)Win32 执行文件,包括内核模式驱动程序,在内部都是由一个或多个段组合而成。段可以包含代码或数据,通常还 阅读全文
posted @ 2014-01-10 10:32 qintangtao 阅读(1423) 评论(0) 推荐(0) 编辑

摘要: By default, the kernel loader will load all driver executables and any global data that you may have defined in your driver into nonpaged memory. Therefore, if you want your driver to reside in nonpaged memory, there is nothing further you need to do besides compiling, linking, and loading the drive 阅读全文
posted @ 2014-01-10 10:09 qintangtao 阅读(919) 评论(0) 推荐(0) 编辑

摘要: #if DBG#define PAGED_CODE() \ if (VideoPortGetCurrentIrql() > 1 /*APC_LEVEL*/) { \ VideoPortDebugPrint(0, "Video: Pageable code called at IRQL %d\n", VideoPortGetCurrentIrql() ); \ ASSERT(FALSE); \ }#else#define PAGED_CODE()#endif 阅读全文
posted @ 2014-01-10 09:47 qintangtao 阅读(376) 评论(0) 推荐(0) 编辑