Crossposting: Who is LPT1?

This is a crossposting from this 400-Points question in Hardware, because it's not only HW-related:
http://www.experts-exchange.com/Hardware/Q_21418797.html

The question:
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.)

Thomas
ThomasHolzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
furqanchandioCommented:
hi

you may find a program user port useful

for complete info click on th elink below

http://www.mattjustice.com/parport/par_nt.html

cheers
0
 
havman56Commented:


see u cannot access LPT1 port dirctly in windwos

u shd use createfile( LPT1 ...)
every port can be accessed by file in windows.

Under DOS u can use bios calls using interrupt u can access it if ur using turboc

int86(0x13 , ,,...) access serial and parallel port


0
 
ThomasHolzAuthor Commented:
Actually I don't need to access the port. That is already done and solved. (Ironic, isn't it?) I just want to make a configuration dialog a bit better documented. But that seems to be difficult, as we're not talking about DOS here...
0
 
PositCommented:
Under Windows, the following will place the address of LPT1 in the 'address' variable.

     DWORD address;
     GetPhysLong((PBYTE)0x408, &address);

You may, however, run into problems when using it under Windows XP.  Since Windows XP abstracts away a lot of the low-level hardware details, the address returned may part of Windows XP's DOS emulator (kind of a virtual machine), which may or may not correspond to the actual physical address.
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
ThomasHolzAuthor Commented:
@Posit:
Not what I dreamt of (since it requires an extra driver and yields wrong results at least on my strange PC) but it's as close as I can get, it seems.

If you post a comment on that page, I'll accept it as answer to the main question:
http://www.experts-exchange.com/Hardware/Q_21418797.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.