阅读:1174回复:1
请教页面换出的问题
如下两个模块:
A.c main() { …… } B.c int gVar = 0; void func() { …… } 在main中先获得保护fVar的锁(ERESOURSE,IRQL提升到DPC),然后访问fVar偶尔会出现访问已换出页的错误。请问,变量gVar是分配在可换出页还是不可换出页里? 如果是在可换出页,这个问题应该如何解决?在NonPaged Pool中动态分配?还是使用其他的锁机制? 谢谢。 |
|
沙发#
发布于:2007-09-11 00:57
Don't quite understand your question. What you showed here is a typical user mode application, why you care about ERESOURCE and IRQL? Also ERESOURCE should be acquired at IRQL <= APC.
In kernel, MmProbeAndLockPages() can be called to make pageable memory resident and prevent it from paging out. Don't forget to call MmUnlockPages() after you done with it. |
|