From f31a3204ca9c05199d375b74ffb19d51ca29c704 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Tue, 24 Feb 2004 00:59:19 +0000 Subject: [PATCH] IO_pp_outp: Allow to switch direction of the printer port. --- dlls/winedos/ppdev.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/winedos/ppdev.c b/dlls/winedos/ppdev.c index 2ec336707b0..2bca1e5cfcd 100644 --- a/dlls/winedos/ppdev.c +++ b/dlls/winedos/ppdev.c @@ -300,7 +300,16 @@ BOOL IO_pp_outp(int port, DWORD* res) case 0: return IO_pp_do_access(idx,PPWDATA,res); case 2: - return IO_pp_do_access(idx,PPWCONTROL,res); + { + /* We can't switch port direction via PPWCONTROL, + so do it via PPDATADIR + */ + DWORD mode = *res & 0x20; + IO_pp_do_access(idx,PPDATADIR,&mode); + mode = (*res & ~0x20); + return IO_pp_do_access(idx,PPWCONTROL,&mode); + } + case 1: case 0x400: case 0x402: