Dear all

How to communication with parallel port device under user mode?

Any API can do this? or it's need comunication in kernel mode

Not directly to I/O port

Just like "PC Anywhere" can connect 2 computers by parallel cable
Posted on 2004-06-11 03:20:34 by jordanc
Hi

Use Porttalk v2.0 from beyondlogics.org
or GiveIO or AccessIO and search google.
Posted on 2004-06-11 09:11:54 by KSA
Or just use CreateFile with "LPT1"
Posted on 2004-06-11 09:44:21 by Sephiroth3
Dear KSA
The PortTalk is directly to I/O port, so it's not 100% meet my request

Dear Sephiroth3
I had try this way, but always get error when CreateFile, and return error code =2
do you have any example codes

thanks to all
Posted on 2004-06-14 21:14:46 by jordanc
hey,
from what i've found, i think this is pretty hard and you need some sort of drivers, so i just used a package that installs the drivers, and then you can read/write with a simple api call.
i think this is the one i used
http://www.driverlinx.com/DownLoad/DlPortIO.htm
hope this helps
Posted on 2004-06-15 07:07:06 by someone
This should work:
xor eax,eax

push eax
push eax
push 3 ; OPEN_EXISTING
push eax
push eax
push 0c0000000h ; GENERIC_READ|GENERIC_WRITE
push offset Lpt1
call CreateFile
...
Lpt1 db "LPT1",0
Posted on 2004-06-15 07:44:43 by Sephiroth3
this code doesnt work in WinXP


invoke CreateFile,addr szLPT1,GENERIC_READ|GENERIC_WRITE,0,0,OPEN_EXISTING,0,0
mov edi,eax
push eax
invoke WriteFile,edi,addr szBuffer,1,esp,0 ;it's locked ? ? ?
pop eax
invoke CloseHandle,edi


Driver based solution:
http://www.logix4u.net/inpout32.htm
Posted on 2004-06-15 08:14:33 by Criminal2
lpNumberOfBytesWritten will point to the lpOverlapped parameter, but I don't know if that makes a difference...
Posted on 2004-06-15 11:20:21 by Sephiroth3