zy530900999 发表于 2017-6-1 13:34:39

IRP结构与理解

<ul class="text" style="margin:0px; padding:0px; list-style:none; font-size:14px; word-wrap:break-word; color:rgb(63,62,60); font-family:'Hiragino Sans GB',微软雅黑,黑体,Arial,sans-serif">

Irp-&gt;AssociatedIrp.SystemBuffer //输入输出缓冲区 使用DO_BUFFER_IO
Irp-&gt;IoStatus.Status //返回给用户层的状态,表示这次通信的结果
Irp-&gt;IoStatus.Information //返回给用户层的大小
Irp-&gt;UserBuffer //USER_BUFFER时的通信
Irp-&gt;MdlAddress //使用MDL映射机制时的通信

PIO_STACK_LOCATION irpStack;
irpStack = IoGetCurrentIrpStackLocation (Irp);//从栈上取IRP信息
irpStack-&gt;Parameters.Read.Length //ReadFile/WriteFile传入的大小
irpStack-&gt;Parameters.Read.ByteOffset //ReadFile/WriteFile从哪读写偏移
irpStack-&gt;Parameters.DeviceIoControl.IoControlCode//控制码
irpStack-&gt;Parameters.DeviceIoControl.InputBufferLength//输入缓冲区大小
irpStack-&gt;Parameters.DeviceIoControl.OutputBufferLength//输出缓冲区大小
irpStack-&gt;MajorFunction//分发函数数组
irpStack-&gt;MinorFunction
irpStack-&gt;DeviceObject
irpStack-&gt;FileObject
页: [1]
查看完整版本: IRP结构与理解