Page 1 of 1

Question about how this was made

Posted: Thu Mar 10, 2016 10:24 am
by Ben321
How did you make a device driver that is not tied to any specific device? It allows you to send commands to any port by number (allowing access to any and all devices that can be referenced by port number). Don't Windows drivers normally require being associated with a specific hardware device, such as a printer, or graphics card, or mouse? Even here on MSDN where it shows the structure of an INF file used to install a driver (dot) com/en-us/library/windows/hardware/ff548687%28v=vs.85%29.aspx it shows that a specific device is being named (in the example the device is HID\Vid_045E&Pid_0009.DeviceDesc = "Microsoft USB Intellimouse")

Re: Question about how this was made

Posted: Thu Mar 10, 2016 10:59 am
by phil
Firstly, I did not make it, I simply took the code from Logix4U and ported it to 64bit.

Secondly, if your interested in how it works, take a look at the code for the driver - its freely available and not all that complicated if you have access to MSDN (or google) to lookup the functions it calls.

Thirdly, I think the answer is rather simple. Generally a driver is tied to a specific device ID etc using an INF file, so that windows can look at the device ID in the hardware and "find" an appropriate driver t load. However, you can override that by selecting "Have disk" and browsing for any driver and trying to use it with the device - this clearly wont have any successful impact unless the thing you browse to is actually for that device.

InpOut32 "simply" uses the IOControl functions to hit the port number passed in by the function. There is NO INF file. The driver is loaded/installed by the DLL and is not tied to any hardware IDs.