Commit 83655771 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Don't share some protected mode interrupts in winedos.

parent 7b7efbe0
......@@ -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) );
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;
}
}
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment