Write a device driver to make it look like one.
In particular, Windows device drivers process the so-called interrupt requests through the interrupt request protocol, which boils down to a wrapped structure and a set of buffers inside the driver.
Now the next thing you need to know is that many drivers are actually layered or stacked or whatever name you want to use. For example, to write a disk driver, you can associate it with the driver above it (as a disk class), but use the driver below it (for example, the scsi port) to actually send commands to your devices.
How real devices work. Fake devices must meet the requirements of a top-level interface, for example. drive or controller, or mouse, or whatever. However, they can do whatever they like - to return any values they like.
This opens up the possibility of controlling the driver through a user mode application and pretends to be a “device”. To send a driver message, you can DeviceIoControl to it; then to receive these messages you can:
- Configure them in the Irp that this DeviceIoControl composes.
- Ask the driver to read them from the memory area of your process.
Drivers can also access \\Registry\\Machine and various other areas of the registry that are not specific to specific users, so you can exchange data this way.
Finally, there are no claims that you cannot filter an existing IO, and not do it all with a new device. There are many options and ways you can do this.
If you are going to do this, you will need:
Change I am not very knowledgeable about DirectInput. Perhaps there is a way to override the various API controls used by redirecting DLLs and the like, which may be simpler described.
user257111
source share