Click here to Skip to main content
14,696,432 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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).
Posted
Updated 31-Aug-16 5:53am
v3
Comments
Richard MacCutchan 19-Aug-16 5:01am
   
DeviceIOControl will always pass the parameters to the driver, that is its purpose. And if you do not have the hardware then you need to install a driver emulator to catch the messages.
Member 10059192 20-Aug-16 6:59am
   
thanks for the reply, in our case Memread MemWrite data and RegRead and Regwrite data both we are getting, but in writeport data should come in Readport by using DeviceIOControl function without hardware for software testing.

Quote:
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.
   
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.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900