Ports
May 19, 2013, 06:26:26 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Pages: [1]
  Print  
Author Topic: Parallel port in Windows XP issue  (Read 1568 times)
Henny
Member
*
Posts: 1


« on: November 08, 2011, 03:40:35 pm »

Hi Jan,
 
I used the “int GetAddressLptPortInTheMemory(int myPort)” function as described in http://www.lvr.com/jansfaq.htm
in a Cbuilder5 project running in Windows 98 and it works fine there.
Now I would like to apply the same code in the same CBuilder 5 application but running in Windows XP.

But:
         int portAddresses[]={0,0,0,0,0};
         BOOL rtn=0;
         DWORD cbLen=0;
         rtn = myProcPointer
         (0,
         (LPCVOID *) 0x408,
         portAddresses,
         8,
         NULL) ;
 
==>>    rtn results in 0 in Windows XP
 
I read in the same article:
Q: If a logic 1 is written to the Control Port, bit 0, (Strobe), the PC clears all of the port bits once every five seconds for about a minute.
A: Some versions of Windows XP look for devices by periodically writing to the port. A registry key can disable this behavior.
   The following registry setting disables the port writes:
      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Parport\Parameters]"DisableWarmPoll"=dword:00000001
   The following registry setting enables the port writes:
      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Parport\Parameters]"DisableWarmPoll"=dword:00000000
 
Indeed RegEdit tells me”:      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Parport\Parameters]"DisableWarmPoll"=dword:00000001
 
My question: if I change this to
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Parport\Parameters]"DisableWarmPoll"=dword:00000000

I might misinterpret that text but do you mean with that, that the “int GetAddressLptPortInTheMemory(int myPort)” function workes fine then?
 
I’m willing to change the regsitry ONLY when I’m sure that it is necessary and safe.
 
Vriendelijke groeten / Bien cordialement / Best regards, Henny Barten
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1625


WWW
« Reply #1 on: November 08, 2011, 03:58:06 pm »

Setting the value to zero may cause the OS to periodically write to the port to look for attached devices. It won't help you find the port address.

The code you referred to predates WinXP. It's not my code, and I haven't tested it on XP. But because XP is most like NT, I would try the code in:

GetAddressLptPortInTheRegistry

Jan
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!