dionysus77
驱动小牛
驱动小牛
  • 注册日期2006-11-15
  • 最后登录2011-12-18
  • 粉丝0
  • 关注0
  • 积分27分
  • 威望392点
  • 贡献值0点
  • 好评度177点
  • 原创分0分
  • 专家分0分
阅读:1183回复:4

自己的读写irp,flags用什么合适?

楼主#
更多 发布于:2007-04-26 18:40
  我用楚狂人文件中的经典irp->flags=0x43

异步发送用IoBuildAsynchronousFsdRequest时,读写操作无效(Iostatus->status和Iostatus->Information都是0)

同步发送用IoBuildAsynchronousFsdRequest时,直接蓝屏,错误为irpl太高,不能写内存

用toolflat的方法,将irpflags都是cache的,不便于控制读写标志,咋办?
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2007-04-27 12:07
如果是为了防止重入,自己把Irp记入list进行判断即可。或者用shadowDO更简单
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
devia
论坛版主
论坛版主
  • 注册日期2005-05-14
  • 最后登录2016-04-05
  • 粉丝3
  • 关注0
  • 积分1029分
  • 威望712点
  • 贡献值1点
  • 好评度555点
  • 原创分8分
  • 专家分4分
板凳#
发布于:2007-04-27 13:17
1. Flag用什么值和你的意图直接相关;
2. 使用IRP_NONCACHE标志是有条件的,再者0x43是什么意思得搞清楚,不能简单的copy/paste;
人总在矛盾中徘徊。。。
dionysus77
驱动小牛
驱动小牛
  • 注册日期2006-11-15
  • 最后登录2011-12-18
  • 粉丝0
  • 关注0
  • 积分27分
  • 威望392点
  • 贡献值0点
  • 好评度177点
  • 原创分0分
  • 专家分0分
地板#
发布于:2007-04-27 13:41
1。我的意图是越过cache,直接读写磁盘数据。
2。0x43是读写历程中那三个经典flags的组合,我调试发现好像真正disk读写都是0x43。
devia
论坛版主
论坛版主
  • 注册日期2005-05-14
  • 最后登录2016-04-05
  • 粉丝3
  • 关注0
  • 积分1029分
  • 威望712点
  • 贡献值1点
  • 好评度555点
  • 原创分8分
  • 专家分4分
地下室#
发布于:2007-04-27 15:08
使用IRP_NONCACHE标志类似于ZwCreateFile中使用FILE_NO_INTERMEDIATE_BUFFERING标志:
其注意事项如下:

The FILE_NO_INTERMEDIATE_BUFFERING CreateOptions flag prevents the file system from performing any intermediate buffering on behalf of the caller. Specifying this flag places the following restrictions on the caller's parameters to other ZwXxxFile routines.

Any optional ByteOffset passed to ZwReadFile or ZwWriteFile must be a multiple of the sector size.
The Length passed to ZwReadFile or ZwWriteFile must be an integral of the sector size. Note that specifying a read operation to a buffer whose length is exactly the sector size might result in a lesser number of significant bytes being transferred to that buffer if the end of the file was reached during the transfer.
Buffers must be aligned in accordance with the alignment requirement of the underlying device. To obtain this information, call ZwCreateFile to get a handle for the file object that represents the physical device, and pass that handle to ZwQueryInformationFile. For a list of the system's FILE_XXX_ALIGNMENT values, see DEVICE_OBJECT.
Calls to ZwSetInformationFile with the FileInformationClass parameter set to FilePositionInformation must specify an offset that is a multiple of the sector size.
人总在矛盾中徘徊。。。
游客

返回顶部