This is a crossposting from this 400-Points question in Hardware, because it's not only HW-related:
By default LPT1 seems to be mapped to port 0x378. But the user can change this. How do you programmatically detect which port is behind LPT1? (LPT2/LPT3?)
Under DOS it seems you can get a list from memory location 0x40..0x4F. But I didn't find a way to do this programmatically under Windows (NT/2K/XP, if possible also 98/ME) and the values in memory don't seem to be correct on my PC if I do it manually.
Does anybody know how to detect this? (For details see the link.)