阅读:689回复:0
读取的数据在哪,(下面这句话如何理解)
4:具体的读的数据在那里呢?
Depending on whether the underlying device driver sets up the target device object's Flags with DO_BUFFERED_IO or with DO_DIRECT_IO, data is transferred into one of the following: ·The buffer at Irp->AssociatedIrp.SystemBuffer if the driver uses buffered I/O ·The buffer described by the MDL at Irp->MdlAddress if the underlying device driver uses direct I/O (DMA or PIO) Volume设备出现DO_BUFFERED的情况几乎没有,所以DO_DIRECT_IO表示数据应该返回到 Irp->MdlAddress所指向的MDL所指向的内存.在无标记的情况下,表明数据读好,请返回到 Irp->UseBuffer中即可.Irp->UseBuffer是一个只在当前线程上下文才有效的地址.如果在前面设置的完成例程,和原来的线程不是在一个上下文中的,所以在完成例程序中得到的该地址是不正确的。要么只能从Irp->MdlAddress中得到数据,如果想要回到当前线程上下文,那么就使用前面的方法,通过等待EVENT的方法。 |
|
|