From 6200a48b70b7304eadfe0df5b8413ac491645615 Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Mon, 31 Jul 2000 20:58:31 +0000 Subject: [PATCH] Fixed a few problems. --- loader/dos/dosvm.c | 4 ++-- msdos/int09.c | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/loader/dos/dosvm.c b/loader/dos/dosvm.c index b5fd5446b0f..0dea056bcef 100644 --- a/loader/dos/dosvm.c +++ b/loader/dos/dosvm.c @@ -398,7 +398,7 @@ void DOSVM_Wait( int read_pipe, HANDLE hObject ) int objc; BOOL got_msg = FALSE; - objs[0]=GetStdHandle(STD_INPUT_HANDLE); + objs[0]=lpDosTask->hConInput; objs[1]=hObject; objc=hObject?2:1; do { @@ -684,7 +684,7 @@ void DOSVM_QueueEvent( int irq, int priority, void (*relay)(LPDOSTASK,CONTEXT86* /* callback event, perform it with dummy context */ CONTEXT86 context; memset(&context,0,sizeof(context)); - (*relay)(lpDosTask,&context,data); + (*relay)(NULL,&context,data); } else { ERR_(int)("IRQ without DOS task: should not happen"); } diff --git a/msdos/int09.c b/msdos/int09.c index 0ed10dc27c2..c68f4ca1551 100644 --- a/msdos/int09.c +++ b/msdos/int09.c @@ -14,8 +14,10 @@ DEFAULT_DEBUG_CHANNEL(int) +#define QUEUELEN 31 + typedef struct { - BYTE queuelen,queue[15],ascii[15]; + BYTE queuelen,queue[QUEUELEN],ascii[QUEUELEN]; } KBDSYSTEM; /********************************************************************** @@ -76,6 +78,10 @@ void WINAPI INT_Int09SendScan( BYTE scan, BYTE ascii ) sys = calloc(1,sizeof(KBDSYSTEM)); DOSVM_SetSystemData(0x09,sys); } + if (sys->queuelen == QUEUELEN) { + ERR("keyboard queue overflow\n"); + return; + } /* add scancode to queue */ sys->queue[sys->queuelen] = scan; sys->ascii[sys->queuelen++] = ascii; -- 2.11.4.GIT