从驱动程序接收应用程序中的IRP数据结构 [英] receiving An IRP data structure in the application coming from driver

查看:98
本文介绍了从驱动程序接收应用程序中的IRP数据结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上,我做了一个总线挂钩驱动程序来捕获IRP.
然后,我想将捕获的IRP从驱动程序发送到用户模式应用程序.

RtlCopyMemory(outBuf,& MyIrp,sizeof(IRP)); //驱动程序代码,
//并且我在应用程序中使用了DeviceIoControl.

因此,我需要定义IRP的结构才能在应用程序中接收数据.
但是我做不到.在仅包含wdm.h的应用程序中使用IRP会导致很多错误.
而且IRP的结构太复杂,无法由我自己定义.
我该怎么办?

对不起,我的英语不好.
谢谢您的帮助.

In fact,I did a bus hook driver for capturing IRP.
And then I want to send the captured IRP from my driver to user mode application.

RtlCopyMemory(outBuf,&MyIrp,sizeof(IRP)); //driver code,
//and I used DeviceIoControl in the application.

So I need to define an structure of IRP to receive data in the application.
But I fail to do it.In the application only including wdm.h to use IRP will cause a lot of errors.
And the structure of IRP is too complex to define by myself.
How can I do?

Sorry for my poor English.
Thank you for you help.

推荐答案

IRP包含指向在用户空间中不可访问的成员的指针.

您需要在驱动程序中处理这些数据包,然后将其转换为用户模式应用程序可以处理的形式.

通过这样做,您可以定义可以在驱动程序和应用程序之间共享的结构.
The IRP contains pointers to members that won''t be accessible in user space.

You''ll need to process these packets in your driver and then convert them to a form that can be processed by your user mode application.

By doing this, you can define structures that can be shared between your driver and your application.


这篇关于从驱动程序接收应用程序中的IRP数据结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆