[Wine-patches] [eterhack 1/2] Add support for working with LPT registers using /dev/port (eterbug #420).

Alexander Morozov amorozov на etersoft.ru
Чт Июн 18 12:48:09 MSD 2009


----------- следующая часть -----------
From e344738975542da852ea718fa0f64c0a85153463 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Tue, 16 Jun 2009 18:02:45 +0400
Subject: [eterhack 1/2] Add support for working with LPT registers using /dev/port (eterbug #420).

---
 dlls/kernel32/instr.c   |   17 +++++++++++++++--
 include/wine/etersoft.h |    6 ++++++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/instr.c b/dlls/kernel32/instr.c
index a035884..733bc47 100644
--- a/dlls/kernel32/instr.c
+++ b/dlls/kernel32/instr.c
@@ -37,6 +37,9 @@
 #include "kernel16_private.h"
 #include "wine/exception.h"
 
+#define ETERSOFT_FUNC_PORT
+#include "wine/etersoft.h"
+
 WINE_DEFAULT_DEBUG_CHANNEL(int);
 WINE_DECLARE_DEBUG_CHANNEL(io);
 
@@ -409,7 +412,12 @@ static DWORD INSTR_inport( WORD port, int size, CONTEXT86 *context )
 
     if (!winedos.inport) load_winedos();
     if (!parport_flag) init_parport();
-    if (pp_read && size == 1) res = pp_read( (UCHAR *)(int)port );
+    LOADETER_FUNC( etersoft_read_port );
+    if (size == 1)
+    {
+        if (etersoft_read_port) res = etersoft_read_port( (UCHAR *)(int)port );
+        else if (pp_read) res = pp_read( (UCHAR *)(int)port );
+    }
     else if (winedos.inport) res = winedos.inport( port, size );
 
     if (TRACE_ON(io))
@@ -443,7 +451,12 @@ static void INSTR_outport( WORD port, int size, DWORD val, CONTEXT86 *context )
 {
     if (!winedos.outport) load_winedos();
     if (!parport_flag) init_parport();
-    if (pp_write && size == 1) pp_write( (UCHAR *)(int)port, val );
+    LOADETER_FUNC( etersoft_write_port );
+    if (size == 1)
+    {
+        if (etersoft_write_port) etersoft_write_port( (UCHAR *)(int)port, val );
+        else if (pp_write) pp_write( (UCHAR *)(int)port, val );
+    }
     else if (winedos.outport) winedos.outport( port, size, val );
 
     if (TRACE_ON(io))
diff --git a/include/wine/etersoft.h b/include/wine/etersoft.h
index 44245b7..aceccce 100644
--- a/include/wine/etersoft.h
+++ b/include/wine/etersoft.h
@@ -161,6 +161,12 @@ static int (*etersoft_getwm)(void);
 static void (*etersoft_fix_driver)(unsigned long code, void *out_buffer,
         unsigned long out_size, long *status, unsigned long *info);
 
+#ifdef ETERSOFT_FUNC_PORT
+static unsigned char (*etersoft_read_port)(unsigned char *port);
+
+static void (*etersoft_write_port)(unsigned char *port, unsigned char value);
+#endif
+
 #ifdef ETERSOFT_FUNC_LSTR
 static int (*etersoft_ischaralnum)(unsigned int cp, char x);
 
-- 
1.6.3.2



Подробная информация о списке рассылки Wine-patches