Commit 201fc77f authored by Alexandre Julliard's avatar Alexandre Julliard

winedos: Add the possibility of refusing to emulate some interrupts.

parent 28aed6d9
......@@ -773,8 +773,8 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
if (winedos.EmulateInterruptPM)
{
context->Eip += prefixlen + 2;
winedos.EmulateInterruptPM( context, instr[1] );
return ExceptionContinueExecution;
if (winedos.EmulateInterruptPM( context, instr[1] )) return ExceptionContinueExecution;
context->Eip -= prefixlen + 2; /* restore eip */
}
break; /* Unable to emulate it */
......
......@@ -135,7 +135,7 @@ extern struct winedos_exports
BOOL (*FreeDosBlock)(void* ptr);
UINT (*ResizeDosBlock)(void *ptr, UINT size, BOOL exact);
/* for instr.c */
void (WINAPI *EmulateInterruptPM)( CONTEXT86 *context, BYTE intnum );
BOOL (WINAPI *EmulateInterruptPM)( CONTEXT86 *context, BYTE intnum );
void (WINAPI *CallBuiltinHandler)( CONTEXT86 *context, BYTE intnum );
DWORD (WINAPI *inport)( int port, int size );
void (WINAPI *outport)( int port, int size, DWORD val );
......
......@@ -473,7 +473,7 @@ extern void WINAPI EMS_Ioctl_Handler(CONTEXT86*);
/* interrupts.c */
extern void WINAPI DOSVM_CallBuiltinHandler( CONTEXT86 *, BYTE );
extern void WINAPI DOSVM_EmulateInterruptPM( CONTEXT86 *, BYTE );
extern BOOL WINAPI DOSVM_EmulateInterruptPM( CONTEXT86 *, BYTE );
extern BOOL WINAPI DOSVM_EmulateInterruptRM( CONTEXT86 *, BYTE );
extern FARPROC16 DOSVM_GetPMHandler16( BYTE );
extern FARPROC48 DOSVM_GetPMHandler48( BYTE );
......
......@@ -45,6 +45,7 @@ static void WINAPI DOSVM_Int2aHandler(CONTEXT86*);
static void WINAPI DOSVM_Int41Handler(CONTEXT86*);
static void WINAPI DOSVM_Int4bHandler(CONTEXT86*);
static void WINAPI DOSVM_Int5cHandler(CONTEXT86*);
static void WINAPI DOSVM_DefaultHandler(CONTEXT86*);
static FARPROC16 DOSVM_Vectors16[256];
static FARPROC48 DOSVM_Vectors48[256];
......@@ -75,7 +76,8 @@ static const INTPROC DOSVM_VectorsBuiltin[] =
/* 58 */ 0, 0, 0, 0,
/* 5C */ DOSVM_Int5cHandler, 0, 0, 0,
/* 60 */ 0, 0, 0, 0,
/* 64 */ 0, 0, 0, DOSVM_Int67Handler
/* 64 */ 0, 0, 0, DOSVM_Int67Handler,
/* 68 */ DOSVM_DefaultHandler
};
......@@ -257,7 +259,7 @@ static void DOSVM_PushFlags( CONTEXT86 *context, BOOL islong, BOOL isstub )
* Pushes interrupt frame to stack and changes instruction
* pointer to interrupt handler.
*/
void WINAPI DOSVM_EmulateInterruptPM( CONTEXT86 *context, BYTE intnum )
BOOL WINAPI DOSVM_EmulateInterruptPM( CONTEXT86 *context, BYTE intnum )
{
TRACE_(relay)("Call DOS int 0x%02x ret=%04x:%08x\n"
" eax=%08x ebx=%08x ecx=%08x edx=%08x\n"
......@@ -326,12 +328,14 @@ void WINAPI DOSVM_EmulateInterruptPM( CONTEXT86 *context, BYTE intnum )
}
else if (wine_ldt_is_system(context->SegCs))
{
DOSVM_CallBuiltinHandler( context, intnum );
INTPROC proc = DOSVM_GetBuiltinHandler( intnum );
if (!proc) return FALSE;
}
else
{
DOSVM_HardwareInterruptPM( context, intnum );
}
return TRUE;
}
......
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