[Wine-patches] [eter-1.0.10 3/7] Add support for working with LPT registers using /dev/port (eterbug #420).
Alexander Morozov
amorozov на etersoft.ru
Вт Июн 30 15:52:39 MSD 2009
----------- следующая часть -----------
From 9afc9412162473ac033773bf21aacb9e73cafd18 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Mon, 29 Jun 2009 17:34:26 +0400
Subject: [eter-1.0.10 3/7] Add support for working with LPT registers using /dev/port (eterbug #420).
---
dlls/kernel32/instr.c | 13 +++++++++++--
include/wine/etersoft.h | 6 ++++++
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/instr.c b/dlls/kernel32/instr.c
index 9014ecf..c1c0cad 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);
@@ -374,7 +377,10 @@ static DWORD INSTR_inport( WORD port, int size, CONTEXT86 *context )
DWORD res = ~0U;
if (!winedos.inport) load_winedos();
- if (winedos.inport) res = winedos.inport( port, size );
+ LOADETER_FUNC( etersoft_read_port );
+ if (size == 1 && etersoft_read_port)
+ res = etersoft_read_port( (UCHAR *)(int)port );
+ else if (winedos.inport) res = winedos.inport( port, size );
if (TRACE_ON(io))
{
@@ -406,7 +412,10 @@ static DWORD INSTR_inport( WORD port, int size, CONTEXT86 *context )
static void INSTR_outport( WORD port, int size, DWORD val, CONTEXT86 *context )
{
if (!winedos.outport) load_winedos();
- if (winedos.outport) winedos.outport( port, size, val );
+ LOADETER_FUNC( etersoft_write_port );
+ if (size == 1 && etersoft_write_port)
+ etersoft_write_port( (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