标签:order ref alt color family aging hand san sts
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.
假设过滤驱动没有在下发分页的 IRP 之前设置 DO_POWER_PAGABLE 位,它可能违反以下的这些条件:
假设移除这个页面文件的请求成功运行,过滤驱动将会去做,假设请求失败,过滤驱动可以恢复它的标志的原始状态,仅仅须要在完毕这个 IRP 之前简单地清除一下 DO_POWER_PAGABLE 位就可以。
由于页面文件请求是序列化的。即使其他线程在过滤驱动最后改变它之后又改动了这个位,这也是没有危急的。
标签:order ref alt color family aging hand san sts
原文地址:http://www.cnblogs.com/clnchanpin/p/6903082.html