Moved the int 9 (keyboard) handler to dlls/winedos.

This commit is contained in:
Ove Kaaven 2001-11-08 17:06:40 +00:00 committed by Alexandre Julliard
parent daf347ac8b
commit e2c477b21a
7 changed files with 27 additions and 12 deletions

View File

@ -8,6 +8,7 @@ IMPORTS = user32 kernel32 ntdll
C_SRCS = \
dosvm.c \
int09.c \
module.c
@MAKE_DLL_RULES@

View File

@ -693,3 +693,18 @@ void WINAPI DOSVM_QueueEvent( INT irq, INT priority, DOSRELAY relay, LPVOID data
}
#endif
BOOL WINAPI DOSVM_Init( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
{
TRACE_(module)("(0x%08x,%ld,%p)\n", hinstDLL, fdwReason, lpvReserved);
if (fdwReason == DLL_PROCESS_ATTACH) {
INT_SetWineHandler(9, INT_Int09Handler);
}
else if (fdwReason == DLL_PROCESS_DETACH)
{
INT_SetWineHandler(9, NULL);
}
return TRUE;
}

View File

@ -42,13 +42,10 @@ void WINAPI INT_Int09Handler( CONTEXT86 *context )
ch[0] = ascii;
cnt = 1;
} else {
#if 0 /* FIXME: cannot call USER functions here */
UINT vkey = MapVirtualKeyA(scan&0x7f, 1);
/* as in TranslateMessage, windows/input.c */
cnt = ToAscii(vkey, scan, QueueKeyStateTable, (LPWORD)ch, 0);
#else
cnt = 0;
#endif
BYTE keystate[256];
GetKeyboardState(keystate);
cnt = ToAscii(vkey, scan, keystate, (LPWORD)ch, 0);
}
if (cnt>0) {
for (c2=0; c2<cnt; c2++)

View File

@ -1,5 +1,6 @@
name winedos
type win32
init DOSVM_Init
import user32.dll
import kernel32.dll
@ -20,3 +21,5 @@ debug_channels (int module relay)
@ stdcall OutPIC(long long) DOSVM_PIC_ioport_out
@ stdcall SetTimer(long) DOSVM_SetTimer
@ stdcall GetTimer() DOSVM_GetTimer
@ stdcall KbdReadScan(ptr) INT_Int09ReadScan

View File

@ -12,7 +12,6 @@ C_SRCS = \
dosmem.c \
dpmi.c \
xms.c \
int09.c \
int10.c \
int11.c \
int12.c \

View File

@ -16,7 +16,7 @@ DEFAULT_DEBUG_CHANNEL(int);
static INTPROC INT_WineHandler[256] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, INT_Int09Handler, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
INT_Int10Handler, INT_Int11Handler, INT_Int12Handler, INT_Int13Handler,
0, INT_Int15Handler, INT_Int16Handler, INT_Int17Handler,
0, 0, INT_Int1aHandler, 0, 0, 0, 0, 0,

View File

@ -37,9 +37,9 @@ static struct {
BYTE ctrlbyte_ch;
WORD oldval;
} tmr_8253[3] = {
{0xFFFF, FALSE, 0, FALSE, 0x06, 0},
{0x0012, FALSE, 0, FALSE, 0x44, 0},
{0x0001, FALSE, 0, FALSE, 0x86, 0},
{0xFFFF, FALSE, 0, FALSE, 0x36, 0},
{0x0012, FALSE, 0, FALSE, 0x74, 0},
{0x0001, FALSE, 0, FALSE, 0xB6, 0},
};
static int dummy_ctr = 0;
@ -345,7 +345,7 @@ DWORD IO_inport( int port, int size )
}
break;
case 0x60:
res = INT_Int09ReadScan(NULL);
res = Dosvm.KbdReadScan ? Dosvm.KbdReadScan(NULL) : 0;
#if 0 /* what's this port got to do with parport ? */
res = (DWORD)parport_8255[0];
#endif