I have an HP/Compaq nx9010 Laptop running Windows XP. I am working with a proprietary device that uses bi-directional communication through the parallel port. I am interfacing this device using Microsoft Visual Studio .NET VC++. Traditionally I have used the c functions inp() and outp() to communicate with the port, but Windows XP does not allow user mode programs to directly access ports. So I have been using a parallel port driver called "inpout32.dll" in conjunction with my program to allow access to these ports.

The problem I am having deals specifically with the laptop when it is plugged in to AC power. For some reason when the laptop is plugged into AC power the driver "hangs" and I must restart my program to get it working again. This solution is short lived because the driver will "hang" again so long as the AC cord is plugged into the laptop. Testing on a desktop with Windows XP or when the laptop is on batteries causes no problems.

I have tried numerous drivers, changing interrupts, changing port addresses, changing BIOS port settings(bi-directional, EPP, ECP), disabling certain power management features, etc... all to no avail. The current port setting on the laptop that works with batteries only is ECP, address 0x378 - 0x38F and
0x778 - 0x77F, DMA 00. Never use and Interupt is selected as well.

Any solutions or ideas would be very much appreciated.