[fpc-pascal] Finding Port Addresses

James Richters james at productionautomation.net
Sat Sep 5 20:26:40 CEST 2020


Does anyone know how I can use FreePascal to obtain all the installed Serial and Parallel Port addresses on Windows 10?

I have a program that reads registry keys at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM that I can then looks up the port name in HKEY_LOCAL_MACHINE\\System\CurrentControlSet\Enum\   but that procedure just doesn't work for parallel ports... and while it tells me the Com designation (Com1... etc) it doesn't actually give be the starting address of the port.

I would like to get the name of the port listed in device manager, the port designation (LPT1... etc)  and the starting address of the port for both serial and parallel ports.

Does anyone know how this can be done?

James



More information about the fpc-pascal mailing list