如何在没有硬件的情况下访问deviceiocontrol功能? [英] How to access deviceiocontrol function without hardware?

查看:105
本文介绍了如何在没有硬件的情况下访问deviceiocontrol功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们试图通过在Readport / writeport数据(地址范围高达0x7f)函数中使用DeviceIoControl函数来测试没有硬件的DLL /驱动程序软件功能,但是我们无法访问它。任何人都可以为它提供样品。这对我们非常有用。谢谢。



我尝试过的事情:



我们已经尝试过DeviceIoControl函数硬编码,但参数正试图访问硬件(驱动程序)。

we are trying to test the dll/driver software functions without hardware, by using the DeviceIoControl function in Readport/writeport data(address range upto 0x7f) function, but we can't able to access it. can any one give the sample for it. it is very useful for us.thank you.

What I have tried:

we have tried DeviceIoControl function hard code, but the parameters are trying to access the hardware(driver).

推荐答案

所以从你的问题我明白你想要的将IOCTL发送到驱动程序,但在驱动程序代码中,实现不存在。我很有趣你有一个有效的设备句柄。



要进行虚拟植入,你需要更新驱动程序代码,以便用户模式可以有一些虚拟数据。请参阅此链接驱动程序开发第2部分:实施IOCTL简介 [< a href =http://www.codeproject.com/Articles/9575/Driver-Development-Part-Introduction-to-Implementarget =_ blanktitle =New Window> ^ ]一个想法如何实现IOCTL。



在代码部分的大部分时间里,我验证并从用户缓冲区中提取数据并执行DbgPrint并使用IoCompleteRequest完成请求。请记住,如果您没有驱动程序代码,则无法对此进行任何操作,如何与驱动程序作者联系以支持您的IOCTL调用。
So from you question I understand you want to send IOCTL to a driver, but in the driver code the implementation is not there. I am amusing that you have a valid device handle.

To have a dummy implantation you have update the driver code so that user mode can have some dummy data. See this link Driver Development Part 2: Introduction to Implementing IOCTLs[^] to have an idea how to implement IOCTL.

In the code section most of the times I validate and extract the data from user buffer and do DbgPrint and complete the request using IoCompleteRequest. Remember if you don't have the driver code there is nothing much you can do about it, how have contact the driver author to support your IOCTL call.


引用:

如何在没有硬件的情况下访问deviceiocontrol功能?

How to access deviceiocontrol function without hardware?

简答:你没有。

驱动程序只与硬件。对于你做的每一个查询,答案来自硬件,所以没有硬件,没有答案。



如此真实或模拟,你需要一个硬件。

Short answer: You don't.
The driver only make the link with the hardware. For every query you do, the answer comes from the hardware, so no hardware, no answer.

So real or emulated, you need a hardware.


这篇关于如何在没有硬件的情况下访问deviceiocontrol功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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