1. The following explains why the DO_POWER_PAGABLE bit must be set on the way down and not on the way up:

    The power requirements state that if any lower device object sets the DO_POWER_PAGABLE bit, all higher-level drivers must do the same. If the filter
    driver fails to set the DO_POWER_PAGABLE bit prior to sending the paging request IRP down the stack, it could violate this condition as follows:

    Suppose the filter driver does not set the DO_POWER_PAGABLE bit in its Filter DO before forwarding the paging request IRP to the drivers beneath it
    in the driver stack. Next suppose that a lower driver sets the DO_POWER_PAGABLE bit in its own DO. Finally, suppose that prior to the completion
    of the IRP by the filter driver a power IRP occurs. At that point, the DO_POWER_PAGABLE bit would be cleared in the Filter DO but would be set in
    the DO of the lower-level driver, causing a system crash.

    It is safe to set the DO_POWER_PAGABLE bit before forwarding a paging request down the stack, because there is no longer an active paging file on
    the filter driver's device, and therefore no more paging I/O will occur on it. If the request to remove this paging file succeeds, the filter driver will be done. If the request fails, the filter driver can restore the original state of its flags by simply
    clearing the DO_POWER_PAGABLE bit prior to completing the IRP. Because the paging file requests are serialized, there is no danger that some other
    thread will have modified this bit since the filter driver last altered it.

    译文为:
            电源管理的需求规定了假设一个更低层的设备对象设置了 DO_POWER_PAGABLE 位。那么全部的更高层驱动也必须这么做。

    假设过滤驱动没有在下发分页的 IRP 之前设置 DO_POWER_PAGABLE
    位,它可能违反以下的这些条件:

            如果过滤驱动没有在下发分页 IRP 之前设置 DO_POWER_PAGABLE 位, 再如果下层驱动设置了自己的设备对象的 DO_POWER_PAGABLE 位。最后,如果在这个过滤驱动的 IRP 完毕之前。一个电源 IRP 发生了。这个时候,DO_POWER_PAGABLE
    位将被该过滤驱动清除,但它又被更低层的驱动设置了。就引起了一个系统崩溃。

           在一个分页请求下发之前设置 DO_POWER_PAGABLE 位是安全的。由于这里不再有一个活跃的分页文件在这个过滤驱动的设备上,因此也不会有分页 I/O 在上面发生。

    假设移除这个页面文件的请求成功运行,过滤驱动将会去做,假设请求失败,过滤驱动可以恢复它的标志的原始状态,仅仅须要在完毕这个 IRP
    之前简单地清除一下 DO_POWER_PAGABLE 位就可以。

    由于页面文件请求是序列化的。即使其他线程在过滤驱动最后改变它之后又改动了这个位,这也是没有危急的。


    原文链接: http://msdn.microsoft.com/zh-cn/ff554992

最新文章

  1. 前端学习实践笔记--JavaScript深入【3】
  2. Java -- 找不到或无法加载主类
  3. 用Time Machine做更换电脑工具
  4. 详解SSH框架的原理和优点
  5. COJ 0015 20602铁轨
  6. B - The Accomodation of Students - hdu 2444(最大匹配)
  7. Vue爬坑之vuex初识
  8. vue 基础-->进阶 教程(3):组件嵌套、组件之间的通信、路由机制
  9. Sublime Text保存文件时自动去掉行末空格
  10. 常用JS小知识汇总
  11. 第九章——运行tensorflow(Up and Running with TensorFlow)
  12. thymeleaf : input/select/radio回显
  13. 查询文章的上下篇Sql语句
  14. javaweb开发.eclipse使用小常识
  15. 困惑2----(已经OK)
  16. 一道简单的HashMap面试题所想到的...
  17. 【魔改】莫队算法+组合数公式 杭电多校赛4 Problem B. Harvest of Apples
  18. 带参数EXE
  19. arp协议分析&python编程实现arp欺骗抓图片
  20. Agile Development敏捷软件开发之何为敏捷开发

热门文章

  1. WordPress极简主题Small Cat详细介绍
  2. python加载不了cookirlib模块的问题
  3. Oracle中的COALESCE,NVL,NVL2,NULLIF函数
  4. videojs
  5. 09js、MySQL相关
  6. SIMD学习 -- 用SSE2指令作点乘和累加计算
  7. Python学习第二阶段Day2(json/pickle)、 shelve、xml、PyYAML、configparser、hashlib模块
  8. python下载网络文件
  9. js之获取html标签的值
  10. ndk编译libpcap 1.7.4(最终解决方法)