Question about how this was made

My x64 port of InpOut32
Post Reply
Ben321
New User
Posts: 3
Joined: Fri Sep 04, 2015 9:03 pm

Question about how this was made

Post 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 https://msdn.microsoft (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")
User avatar
phil
Site Admin
Posts: 7611
Joined: Sun Apr 06, 2003 11:12 pm

Re: Question about how this was made

Post 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.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
Post Reply