Access Printer port pin by dll

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
leoyu1112
Newbie
Newbie
Posts: 2
Joined: Sun May 03, 2009 6:57 pm

Access Printer port pin by dll

Post by leoyu1112 »

Hi there,

Does anyone have the experience of access/control each pins of printer port by calling 3rd party dll file? It works well on windows XP/2000 O.S. but seems have no function under wine (I installed 1.0.1)

Any reply will be high appreciation !
Thank you.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Access Printer port pin by dll

Post by vitamin »

leoyu1112 wrote:Does anyone have the experience of access/control each pins of printer port by calling 3rd party dll file? It works well on windows XP/2000 O.S. but seems have no function under wine (I installed 1.0.1)
You sure you have permissions to access /dev/pl0? Also this might not work at all if this "dll" uses any sort of kernel driver to do it's things.
Gert van den Berg

Access Printer port pin by dll

Post by Gert van den Berg »

On Mon, May 11, 2009 at 03:56, leoyu1112 <[email protected]> wrote:
Hi there,

Does anyone have the experience of access/control each pins of printer port by calling 3rd party dll file? It works well on windows XP/2000 O.S. but seems have no function under wine (I installed 1.0.1)
If it wqorks by using direct IN and OUT commands, you would need to
run an iopl / ioperm call beforehand. This probably requires root
access, and usising direct hardware I/O without a driver in a
multi-user operating system is a bad idea....

Some man pages:
http://linux.die.net/man/2/ioperm
http://linux.die.net/man/2/iopl

The least risky way is probably a wrapper that gets port permissions
as root, drops its root permissions, and executes Wine with the
program.

The second part of this page explains how to get a Linux application
to do Direct I/O.
http://as6edriver.sourceforge.net/Paral ... ssing.html

http://www.faqs.org/docs/Linux-mini/IO- ... html#ss2.1

Gert
leoyu1112
Newbie
Newbie
Posts: 2
Joined: Sun May 03, 2009 6:57 pm

Post by leoyu1112 »

Hi Gert van den Berg,

Thanks for your information, but it seems I have to code some program to do that by myself. I expect to use old 3rd partry's dll directly on my old program -- just like I ran on Windows. Perhaps it's impossible to realsize my wanted function easily, anyway your news lead me to think a solution from another way.
Gert van den Berg

Access Printer port pin by dll

Post by Gert van den Berg »

Does it work as a normal user in XP? Or do you need to be an
administrator? If you need to be an administrator, it probably
interfaces directly with the parallel port, for which you would
probably need a workaround as mentioned above.

Because some of the parallel port programs use some really dodgy
code... (At least for a multi-user / multi-tasking operating system)
They request direct hardware access from the operating system and
ignore the normal way of working through a driver.

Gert
Uwe Bonnes

Access Printer port pin by dll

Post by Uwe Bonnes »

Gert> Does it work as a normal user in XP? Or do you need to be an
Gert> administrator? If you need to be an administrator, it probably
Gert> interfaces directly with the parallel port, for which you would
Gert> probably need a workaround as mentioned above.

Gert> Because some of the parallel port programs use some really dodgy
Gert> code... (At least for a multi-user / multi-tasking operating
Gert> system) They request direct hardware access from the operating
Gert> system and ignore the normal way of working through a driver.

The original poster should run the application with DEBUGMSG=+relay, and
look, what device is accessed. On possibility might be an open of VDMLPT,
which behaves somehow like the linux /dev/ppdev
--
Uwe Bonnes [email protected]

Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Locked