Commit d41581db authored by Jukka Heinonen's avatar Jukka Heinonen Committed by Alexandre Julliard

DeviceIoControl now calls winedos interrupt handlers.

Fixed RawModeSwitch.
parent c702ae8a
...@@ -103,6 +103,8 @@ void WINAPI DOSVM_EmulateInterruptPM( CONTEXT86 *context, BYTE intnum ) ...@@ -103,6 +103,8 @@ void WINAPI DOSVM_EmulateInterruptPM( CONTEXT86 *context, BYTE intnum )
if(context->SegCs == DOSVM_dpmi_segments->int48_sel) if(context->SegCs == DOSVM_dpmi_segments->int48_sel)
islong = FALSE; islong = FALSE;
else if(context->SegCs == DOSVM_dpmi_segments->dpmi_sel)
islong = FALSE;
else if(DOSVM_IsDos32()) else if(DOSVM_IsDos32())
islong = TRUE; islong = TRUE;
else if(IS_SELECTOR_32BIT(context->SegCs)) { else if(IS_SELECTOR_32BIT(context->SegCs)) {
...@@ -256,3 +258,14 @@ INTPROC DOSVM_GetBuiltinHandler( BYTE intnum ) ...@@ -256,3 +258,14 @@ INTPROC DOSVM_GetBuiltinHandler( BYTE intnum )
WARN("int%x not implemented, returning dummy handler\n", intnum ); WARN("int%x not implemented, returning dummy handler\n", intnum );
return DOSVM_DefaultHandler; return DOSVM_DefaultHandler;
} }
/**********************************************************************
* DOSVM_CallBuiltinHandler
*
* Execute Wine interrupt handler procedure.
*/
void WINAPI DOSVM_CallBuiltinHandler( CONTEXT86 *context, BYTE intnum )
{
INTPROC proc = DOSVM_GetBuiltinHandler( intnum );
proc( context );
}
@ stdcall LoadDosExe(str long) MZ_LoadImage @ stdcall LoadDosExe(str long) MZ_LoadImage
@ stdcall EmulateInterruptPM(ptr long) DOSVM_EmulateInterruptPM @ stdcall EmulateInterruptPM(ptr long) DOSVM_EmulateInterruptPM
@ stdcall CallBuiltinHandler(ptr long) DOSVM_CallBuiltinHandler
# DPMI functions # DPMI functions
@ stdcall CallRMInt(ptr) DOSVM_CallRMInt @ stdcall CallRMInt(ptr) DOSVM_CallRMInt
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
typedef struct { typedef struct {
void (WINAPI *LoadDosExe)( LPCSTR filename, HANDLE hFile ); void (WINAPI *LoadDosExe)( LPCSTR filename, HANDLE hFile );
void (WINAPI *EmulateInterruptPM)( CONTEXT86 *context, BYTE intnum ); void (WINAPI *EmulateInterruptPM)( CONTEXT86 *context, BYTE intnum );
void (WINAPI *CallBuiltinHandler)( CONTEXT86 *context, BYTE intnum );
/* DPMI functions */ /* DPMI functions */
void (WINAPI *CallRMInt)( CONTEXT86 *context ); void (WINAPI *CallRMInt)( CONTEXT86 *context );
......
...@@ -75,6 +75,7 @@ BOOL DPMI_LoadDosSystem(void) ...@@ -75,6 +75,7 @@ BOOL DPMI_LoadDosSystem(void)
GET_ADDR(outport); GET_ADDR(outport);
GET_ADDR(ASPIHandler); GET_ADDR(ASPIHandler);
GET_ADDR(EmulateInterruptPM); GET_ADDR(EmulateInterruptPM);
GET_ADDR(CallBuiltinHandler);
#undef GET_ADDR #undef GET_ADDR
return TRUE; return TRUE;
} }
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "stackframe.h" #include "stackframe.h"
#include "wine/server.h" #include "wine/server.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "callback.h"
/* int 13 stuff */ /* int 13 stuff */
#ifdef HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H
...@@ -1573,9 +1574,13 @@ static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbI ...@@ -1573,9 +1574,13 @@ static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbI
if(dwIoControlCode==IFS_IOCTL_21) if(dwIoControlCode==IFS_IOCTL_21)
{ {
DOS3Call(&cxt); /* Call int 21h */ if(Dosvm.CallBuiltinHandler || DPMI_LoadDosSystem())
} else { Dosvm.CallBuiltinHandler( &cxt, 0x21 );
INT_Int2fHandler(&cxt); /* Call int 2Fh */ }
else
{
if(Dosvm.CallBuiltinHandler || DPMI_LoadDosSystem())
Dosvm.CallBuiltinHandler( &cxt, 0x2f );
} }
CONTEXT_2_win32apieq(&cxt,pOut); CONTEXT_2_win32apieq(&cxt,pOut);
...@@ -1640,7 +1645,8 @@ static DWORD VxDCall_VWin32( DWORD service, CONTEXT86 *context ) ...@@ -1640,7 +1645,8 @@ static DWORD VxDCall_VWin32( DWORD service, CONTEXT86 *context )
SET_AX( context, callnum ); SET_AX( context, callnum );
SET_CX( context, parm ); SET_CX( context, parm );
INT_Int31Handler(context); if(Dosvm.CallBuiltinHandler || DPMI_LoadDosSystem())
Dosvm.CallBuiltinHandler( context, 0x31 );
return LOWORD(context->Eax); return LOWORD(context->Eax);
} }
...@@ -1983,6 +1989,7 @@ static BOOL DeviceIo_VWin32(DWORD dwIoControlCode, ...@@ -1983,6 +1989,7 @@ static BOOL DeviceIo_VWin32(DWORD dwIoControlCode,
CONTEXT86 cxt; CONTEXT86 cxt;
DIOC_REGISTERS *pIn = (DIOC_REGISTERS *)lpvInBuffer; DIOC_REGISTERS *pIn = (DIOC_REGISTERS *)lpvInBuffer;
DIOC_REGISTERS *pOut = (DIOC_REGISTERS *)lpvOutBuffer; DIOC_REGISTERS *pOut = (DIOC_REGISTERS *)lpvOutBuffer;
BYTE intnum = 0;
TRACE( "Control '%s': " TRACE( "Control '%s': "
"eax=0x%08lx, ebx=0x%08lx, ecx=0x%08lx, " "eax=0x%08lx, ebx=0x%08lx, ecx=0x%08lx, "
...@@ -1998,17 +2005,25 @@ static BOOL DeviceIo_VWin32(DWORD dwIoControlCode, ...@@ -1998,17 +2005,25 @@ static BOOL DeviceIo_VWin32(DWORD dwIoControlCode,
switch (dwIoControlCode) switch (dwIoControlCode)
{ {
case VWIN32_DIOC_DOS_IOCTL: DOS3Call( &cxt ); break; /* Call int 21h */ case VWIN32_DIOC_DOS_IOCTL: /* Call int 21h */
case VWIN32_DIOC_DOS_INT13: INT_Int13Handler( &cxt ); break;
case 0x10: /* Int 0x21 call, call it VWIN_DIOC_INT21 ? */ case 0x10: /* Int 0x21 call, call it VWIN_DIOC_INT21 ? */
DOS3Call( &cxt ); break; case VWIN32_DIOC_DOS_DRIVEINFO: /* Call int 21h 730x */
case VWIN32_DIOC_DOS_INT25: INT_Int25Handler( &cxt ); break; intnum = 0x21;
case VWIN32_DIOC_DOS_INT26: INT_Int26Handler( &cxt ); break; break;
case VWIN32_DIOC_DOS_INT25:
intnum = 0x25;
break;
case VWIN32_DIOC_DOS_INT26:
intnum = 0x26;
break;
case 0x29: /* Int 0x31 call, call it VWIN_DIOC_INT31 ? */ case 0x29: /* Int 0x31 call, call it VWIN_DIOC_INT31 ? */
INT_Int31Handler( &cxt ); break; intnum = 0x31;
case VWIN32_DIOC_DOS_DRIVEINFO: DOS3Call( &cxt ); break; /* Call int 21h 730x */ break;
} }
if(Dosvm.CallBuiltinHandler || DPMI_LoadDosSystem())
Dosvm.CallBuiltinHandler( &cxt, intnum );
CONTEXT_2_DIOCRegs( &cxt, pOut ); CONTEXT_2_DIOCRegs( &cxt, pOut );
} }
break; break;
......
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