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

This commit is contained in:
Alexandre Julliard 2007-12-23 13:55:12 +01:00
parent 28aed6d9c8
commit 201fc77fd6
4 changed files with 11 additions and 7 deletions

View File

@ -773,8 +773,8 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
if (winedos.EmulateInterruptPM) if (winedos.EmulateInterruptPM)
{ {
context->Eip += prefixlen + 2; context->Eip += prefixlen + 2;
winedos.EmulateInterruptPM( context, instr[1] ); if (winedos.EmulateInterruptPM( context, instr[1] )) return ExceptionContinueExecution;
return ExceptionContinueExecution; context->Eip -= prefixlen + 2; /* restore eip */
} }
break; /* Unable to emulate it */ break; /* Unable to emulate it */

View File

@ -135,7 +135,7 @@ extern struct winedos_exports
BOOL (*FreeDosBlock)(void* ptr); BOOL (*FreeDosBlock)(void* ptr);
UINT (*ResizeDosBlock)(void *ptr, UINT size, BOOL exact); UINT (*ResizeDosBlock)(void *ptr, UINT size, BOOL exact);
/* for instr.c */ /* for instr.c */
void (WINAPI *EmulateInterruptPM)( CONTEXT86 *context, BYTE intnum ); BOOL (WINAPI *EmulateInterruptPM)( CONTEXT86 *context, BYTE intnum );
void (WINAPI *CallBuiltinHandler)( CONTEXT86 *context, BYTE intnum ); void (WINAPI *CallBuiltinHandler)( CONTEXT86 *context, BYTE intnum );
DWORD (WINAPI *inport)( int port, int size ); DWORD (WINAPI *inport)( int port, int size );
void (WINAPI *outport)( int port, int size, DWORD val ); void (WINAPI *outport)( int port, int size, DWORD val );

View File

@ -473,7 +473,7 @@ extern void WINAPI EMS_Ioctl_Handler(CONTEXT86*);
/* interrupts.c */ /* interrupts.c */
extern void WINAPI DOSVM_CallBuiltinHandler( CONTEXT86 *, BYTE ); 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 BOOL WINAPI DOSVM_EmulateInterruptRM( CONTEXT86 *, BYTE );
extern FARPROC16 DOSVM_GetPMHandler16( BYTE ); extern FARPROC16 DOSVM_GetPMHandler16( BYTE );
extern FARPROC48 DOSVM_GetPMHandler48( BYTE ); extern FARPROC48 DOSVM_GetPMHandler48( BYTE );

View File

@ -45,6 +45,7 @@ static void WINAPI DOSVM_Int2aHandler(CONTEXT86*);
static void WINAPI DOSVM_Int41Handler(CONTEXT86*); static void WINAPI DOSVM_Int41Handler(CONTEXT86*);
static void WINAPI DOSVM_Int4bHandler(CONTEXT86*); static void WINAPI DOSVM_Int4bHandler(CONTEXT86*);
static void WINAPI DOSVM_Int5cHandler(CONTEXT86*); static void WINAPI DOSVM_Int5cHandler(CONTEXT86*);
static void WINAPI DOSVM_DefaultHandler(CONTEXT86*);
static FARPROC16 DOSVM_Vectors16[256]; static FARPROC16 DOSVM_Vectors16[256];
static FARPROC48 DOSVM_Vectors48[256]; static FARPROC48 DOSVM_Vectors48[256];
@ -75,7 +76,8 @@ static const INTPROC DOSVM_VectorsBuiltin[] =
/* 58 */ 0, 0, 0, 0, /* 58 */ 0, 0, 0, 0,
/* 5C */ DOSVM_Int5cHandler, 0, 0, 0, /* 5C */ DOSVM_Int5cHandler, 0, 0, 0,
/* 60 */ 0, 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 * Pushes interrupt frame to stack and changes instruction
* pointer to interrupt handler. * 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" TRACE_(relay)("Call DOS int 0x%02x ret=%04x:%08x\n"
" eax=%08x ebx=%08x ecx=%08x edx=%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)) else if (wine_ldt_is_system(context->SegCs))
{ {
DOSVM_CallBuiltinHandler( context, intnum ); INTPROC proc = DOSVM_GetBuiltinHandler( intnum );
if (!proc) return FALSE;
} }
else else
{ {
DOSVM_HardwareInterruptPM( context, intnum ); DOSVM_HardwareInterruptPM( context, intnum );
} }
return TRUE;
} }