From 8365577125beb56933fc4c006a1b3e787cb711ac Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Wed, 8 Oct 2003 19:07:45 +0000 Subject: [PATCH] Don't share some protected mode interrupts in winedos. --- dlls/winedos/interrupts.c | 70 +++++++++++++++++++++++++++++++++++++-- include/task.h | 14 ++++---- 2 files changed, 75 insertions(+), 9 deletions(-) diff --git a/dlls/winedos/interrupts.c b/dlls/winedos/interrupts.c index 5bfc6f0e8a4..bddbeda7d78 100644 --- a/dlls/winedos/interrupts.c +++ b/dlls/winedos/interrupts.c @@ -25,6 +25,7 @@ #include "wine/winbase16.h" #include "thread.h" +#include "task.h" WINE_DEFAULT_DEBUG_CHANNEL(int); WINE_DECLARE_DEBUG_CHANNEL(relay); @@ -562,9 +563,42 @@ void DOSVM_SetRMHandler( BYTE intnum, FARPROC16 handler ) */ FARPROC16 DOSVM_GetPMHandler16( BYTE intnum ) { + TDB *pTask; + FARPROC16 proc = 0; + + pTask = GlobalLock16(GetCurrentTask()); + if (pTask) + { + switch( intnum ) + { + case 0x00: + proc = pTask->int0; + break; + case 0x02: + proc = pTask->int2; + break; + case 0x04: + proc = pTask->int4; + break; + case 0x06: + proc = pTask->int6; + break; + case 0x07: + proc = pTask->int7; + break; + case 0x3e: + proc = pTask->int3e; + break; + case 0x75: + proc = pTask->int75; + break; + } + if( proc ) + return proc; + } if (!DOSVM_Vectors16[intnum]) { - FARPROC16 proc = (FARPROC16)MAKESEGPTR( DOSVM_dpmi_segments->int16_sel, + proc = (FARPROC16)MAKESEGPTR( DOSVM_dpmi_segments->int16_sel, DOSVM_STUB_PM16 * intnum ); DOSVM_Vectors16[intnum] = proc; } @@ -579,9 +613,41 @@ FARPROC16 DOSVM_GetPMHandler16( BYTE intnum ) */ void DOSVM_SetPMHandler16( BYTE intnum, FARPROC16 handler ) { + TDB *pTask; + TRACE("Set protected mode interrupt vector %02x <- %04x:%04x\n", intnum, HIWORD(handler), LOWORD(handler) ); - DOSVM_Vectors16[intnum] = handler; + + pTask = GlobalLock16(GetCurrentTask()); + if (!pTask) + return; + switch( intnum ) + { + case 0x00: + pTask->int0 = handler; + break; + case 0x02: + pTask->int2 = handler; + break; + case 0x04: + pTask->int4 = handler; + break; + case 0x06: + pTask->int6 = handler; + break; + case 0x07: + pTask->int7 = handler; + break; + case 0x3e: + pTask->int3e = handler; + break; + case 0x75: + pTask->int75 = handler; + break; + default: + DOSVM_Vectors16[intnum] = handler; + break; + } } diff --git a/include/task.h b/include/task.h index 67b80d31f68..3003d867a91 100644 --- a/include/task.h +++ b/include/task.h @@ -98,13 +98,13 @@ typedef struct _TDB FARPROC16 sighandler WINE_PACKED; /* 26 Signal handler */ FARPROC16 userhandler WINE_PACKED; /* 2a USER signal handler */ FARPROC16 discardhandler WINE_PACKED; /* 2e Handler for GlobalNotify() */ - DWORD int0 WINE_PACKED; /* 32 int 0 (divide by 0) handler */ - DWORD int2 WINE_PACKED; /* 36 int 2 (NMI) handler */ - DWORD int4 WINE_PACKED; /* 3a int 4 (INTO) handler */ - DWORD int6 WINE_PACKED; /* 3e int 6 (invalid opc) handler */ - DWORD int7 WINE_PACKED; /* 42 int 7 (coprocessor) handler */ - DWORD int3e WINE_PACKED; /* 46 int 3e (80x87 emu) handler */ - DWORD int75 WINE_PACKED; /* 4a int 75 (80x87 error) handler */ + FARPROC16 int0 WINE_PACKED; /* 32 int 0 (divide by 0) handler */ + FARPROC16 int2 WINE_PACKED; /* 36 int 2 (NMI) handler */ + FARPROC16 int4 WINE_PACKED; /* 3a int 4 (INTO) handler */ + FARPROC16 int6 WINE_PACKED; /* 3e int 6 (invalid opc) handler */ + FARPROC16 int7 WINE_PACKED; /* 42 int 7 (coprocessor) handler */ + FARPROC16 int3e WINE_PACKED; /* 46 int 3e (80x87 emu) handler */ + FARPROC16 int75 WINE_PACKED; /* 4a int 75 (80x87 error) handler */ DWORD compat_flags WINE_PACKED; /* 4e Compatibility flags */ BYTE unused4[2]; /* 52 */ struct _TEB *teb; /* 54 Pointer to thread database */