Commit 5e0fd340 authored by Alexandre Julliard's avatar Alexandre Julliard

krnl386: Remove support for running DOS executables.

parent a87b55d9
......@@ -9,7 +9,6 @@ C_SRCS = \
dma.c \
dosaspi.c \
dosdev.c \
dosexe.c \
dosmem.c \
dosvm.c \
error.c \
......
......@@ -33,15 +33,6 @@
#define MAX_DOS_DRIVES 26
struct _DOSEVENT;
typedef struct {
PAPCFUNC proc;
ULONG_PTR arg;
} DOS_SPC;
extern pid_t dosvm_pid DECLSPEC_HIDDEN;
/* amount of space reserved for relay stack */
#define DOSVM_RELAY_DATA_SIZE 4096
......@@ -78,10 +69,6 @@ extern WORD DOSVM_psp DECLSPEC_HIDDEN; /* psp of current DOS task */
extern WORD DOSVM_retval DECLSPEC_HIDDEN; /* return value of previous DOS task */
extern struct DPMI_segments *DOSVM_dpmi_segments DECLSPEC_HIDDEN;
#if defined(linux) && defined(__i386__) && defined(HAVE_SYS_VM86_H)
# define MZ_SUPPORTED
#endif /* linux-i386 */
/*
* Declare some CONTEXT.EFlags bits.
* IF_MASK is only pushed into real mode stack.
......@@ -333,19 +320,11 @@ typedef struct
RMCBPROC interrupt;
} WINEDEV;
/* dosexe.c */
extern BOOL MZ_Exec( CONTEXT *context, LPCSTR filename, BYTE func, LPVOID paramblk ) DECLSPEC_HIDDEN;
extern void MZ_Exit( CONTEXT *context, BOOL cs_psp, WORD retval ) DECLSPEC_HIDDEN;
extern BOOL MZ_Current( void ) DECLSPEC_HIDDEN;
extern void MZ_AllocDPMITask( void ) DECLSPEC_HIDDEN;
extern void MZ_RunInThread( PAPCFUNC proc, ULONG_PTR arg ) DECLSPEC_HIDDEN;
extern BOOL DOSVM_IsWin16(void) DECLSPEC_HIDDEN;
extern void DOSVM_Exit( WORD retval ) DECLSPEC_HIDDEN;
/* dosvm.c */
extern void DOSVM_SendQueuedEvents( CONTEXT * ) DECLSPEC_HIDDEN;
extern void WINAPI DOSVM_AcknowledgeIRQ( CONTEXT * ) DECLSPEC_HIDDEN;
extern INT DOSVM_Enter( CONTEXT *context ) DECLSPEC_HIDDEN;
extern void DOSVM_Exit( WORD retval ) DECLSPEC_HIDDEN;
extern void DOSVM_Wait( CONTEXT * ) DECLSPEC_HIDDEN;
extern DWORD DOSVM_Loop( HANDLE hThread ) DECLSPEC_HIDDEN;
extern void DOSVM_QueueEvent( INT irq, INT priority, DOSRELAY relay, LPVOID data ) DECLSPEC_HIDDEN;
......@@ -442,7 +421,6 @@ extern void EMS_Ioctl_Handler(CONTEXT*) DECLSPEC_HIDDEN;
extern void __wine_call_int_handler( CONTEXT *, BYTE ) DECLSPEC_HIDDEN;
extern void DOSVM_CallBuiltinHandler( CONTEXT *, BYTE ) DECLSPEC_HIDDEN;
extern BOOL DOSVM_EmulateInterruptPM( CONTEXT *, BYTE ) DECLSPEC_HIDDEN;
extern BOOL DOSVM_EmulateInterruptRM( CONTEXT *, BYTE ) DECLSPEC_HIDDEN;
extern FARPROC16 DOSVM_GetPMHandler16( BYTE ) DECLSPEC_HIDDEN;
extern FARPROC48 DOSVM_GetPMHandler48( BYTE ) DECLSPEC_HIDDEN;
extern FARPROC16 DOSVM_GetRMHandler( BYTE ) DECLSPEC_HIDDEN;
......
......@@ -583,7 +583,7 @@ static WORD INT21_GetHeapSelector( CONTEXT *context )
{
INT21_HEAP *heap = INT21_GetHeapPointer();
if (!ISV86(context) && DOSVM_IsWin16())
if (!ISV86(context))
return heap->misc_selector;
else
return heap->misc_segment;
......@@ -2377,7 +2377,7 @@ static void INT21_GetPSP( CONTEXT *context )
* FIXME: should we return the original DOS PSP upon
* Windows startup ?
*/
if (!ISV86(context) && DOSVM_IsWin16())
if (!ISV86(context))
SET_BX( context, LOWORD(GetCurrentPDB16()) );
else
SET_BX( context, DOSVM_psp );
......@@ -4170,12 +4170,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT *context )
{
case 0x00: /* TERMINATE PROGRAM */
TRACE("TERMINATE PROGRAM\n");
if (DOSVM_IsWin16())
DOSVM_Exit( 0 );
else if(ISV86(context))
MZ_Exit( context, FALSE, 0 );
else
ERR( "Called from DOS protected mode\n" );
DOSVM_Exit( 0 );
break;
case 0x01: /* READ CHARACTER FROM STANDARD INPUT, WITH ECHO */
......@@ -4266,13 +4261,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT *context )
*/
while (*p != '$') p++;
if (DOSVM_IsWin16())
WriteFile( DosFileHandleToWin32Handle(1),
data, p - data, &w, NULL );
else
for(; data != p; data++)
DOSVM_PutChar( *data );
WriteFile( DosFileHandleToWin32Handle(1), data, p - data, &w, NULL );
SET_AL( context, '$' ); /* yes, '$' (0x24) gets returned in AL */
}
break;
......@@ -4458,7 +4447,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT *context )
TRACE("SET INTERRUPT VECTOR 0x%02x\n",AL_reg(context));
{
FARPROC16 ptr = (FARPROC16)MAKESEGPTR( context->SegDs, DX_reg(context) );
if (!ISV86(context) && DOSVM_IsWin16())
if (!ISV86(context))
DOSVM_SetPMHandler16( AL_reg(context), ptr );
else
DOSVM_SetRMHandler( AL_reg(context), ptr );
......@@ -4655,7 +4644,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT *context )
TRACE("GET INTERRUPT VECTOR 0x%02x\n",AL_reg(context));
{
FARPROC16 addr;
if (!ISV86(context) && DOSVM_IsWin16())
if (!ISV86(context))
addr = DOSVM_GetPMHandler16( AL_reg(context) );
else
addr = DOSVM_GetRMHandler( AL_reg(context) );
......@@ -4784,13 +4773,8 @@ void WINAPI DOSVM_Int21Handler( CONTEXT *context )
context->Edx );
/* Some programs pass a count larger than the allocated buffer */
if (DOSVM_IsWin16())
{
DWORD maxcount = GetSelectorLimit16( context->SegDs )
- DX_reg(context) + 1;
if (count > maxcount)
count = maxcount;
}
DWORD maxcount = GetSelectorLimit16( context->SegDs ) - DX_reg(context) + 1;
if (count > maxcount) count = maxcount;
/*
* FIXME: Reading from console (BX=1) in DOS mode
......@@ -4798,13 +4782,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT *context )
*/
RESET_CFLAG(context); /* set if error */
if (!DOSVM_IsWin16() && BX_reg(context) == 0)
{
result = INT21_BufferedInput( context, buffer, count );
SET_AX( context, (WORD)result );
}
else if (ReadFile( DosFileHandleToWin32Handle(BX_reg(context)),
buffer, count, &result, NULL ))
if (ReadFile( DosFileHandleToWin32Handle(BX_reg(context)), buffer, count, &result, NULL ))
SET_AX( context, (WORD)result );
else
bSetDOSExtendedError = TRUE;
......@@ -4817,27 +4795,14 @@ void WINAPI DOSVM_Int21Handler( CONTEXT *context )
BX_reg(context), CX_reg(context) );
{
char *ptr = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx);
if (!DOSVM_IsWin16() &&
(BX_reg(context) == 1 || BX_reg(context) == 2))
{
int i;
for(i=0; i<CX_reg(context); i++)
DOSVM_PutChar(ptr[i]);
SET_AX(context, CX_reg(context));
RESET_CFLAG(context);
}
HFILE handle = (HFILE)DosFileHandleToWin32Handle(BX_reg(context));
LONG result = _hwrite( handle, ptr, CX_reg(context) );
if (result == HFILE_ERROR)
bSetDOSExtendedError = TRUE;
else
{
HFILE handle = (HFILE)DosFileHandleToWin32Handle(BX_reg(context));
LONG result = _hwrite( handle, ptr, CX_reg(context) );
if (result == HFILE_ERROR)
bSetDOSExtendedError = TRUE;
else
{
SET_AX( context, (WORD)result );
RESET_CFLAG(context);
}
SET_AX( context, (WORD)result );
RESET_CFLAG(context);
}
}
break;
......@@ -4938,7 +4903,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT *context )
WORD selector = 0;
DWORD bytes = (DWORD)BX_reg(context) << 4;
if (!ISV86(context) && DOSVM_IsWin16())
if (!ISV86(context))
{
DWORD rv = GlobalDOSAlloc16( bytes );
selector = LOWORD( rv );
......@@ -4965,7 +4930,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT *context )
{
BOOL ok;
if (!ISV86(context) && DOSVM_IsWin16())
if (!ISV86(context))
{
ok = !GlobalDOSFree16( context->SegEs );
......@@ -4991,7 +4956,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT *context )
{
DWORD newsize = (DWORD)BX_reg(context) << 4;
if (!ISV86(context) && DOSVM_IsWin16())
if (!ISV86(context))
{
FIXME( "Resize memory block - unsupported under Win16\n" );
SET_CFLAG(context);
......@@ -5020,42 +4985,23 @@ void WINAPI DOSVM_Int21Handler( CONTEXT *context )
case 0x4b: /* "EXEC" - LOAD AND/OR EXECUTE PROGRAM */
{
char *program = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx);
BYTE *paramblk = CTX_SEG_OFF_TO_LIN(context, context->SegEs, context->Ebx);
HINSTANCE16 instance;
TRACE( "EXEC %s\n", program );
RESET_CFLAG(context);
if (DOSVM_IsWin16())
instance = WinExec16( program, SW_NORMAL );
if (instance < 32)
{
HINSTANCE16 instance = WinExec16( program, SW_NORMAL );
if (instance < 32)
{
SET_CFLAG( context );
SET_AX( context, instance );
}
}
else
{
if (!MZ_Exec( context, program, AL_reg(context), paramblk))
bSetDOSExtendedError = TRUE;
SET_CFLAG( context );
SET_AX( context, instance );
}
}
break;
case 0x4c: /* "EXIT" - TERMINATE WITH RETURN CODE */
TRACE( "EXIT with return code %d\n", AL_reg(context) );
if (DOSVM_IsWin16())
DOSVM_Exit( AL_reg(context) );
else if(ISV86(context))
MZ_Exit( context, FALSE, AL_reg(context) );
else
{
/*
* Exit from DPMI.
*/
ULONG_PTR rv = AL_reg(context);
RaiseException( EXCEPTION_VM86_INTx, 0, 1, &rv );
}
DOSVM_Exit( AL_reg(context) );
break;
case 0x4d: /* GET RETURN CODE */
......@@ -5092,7 +5038,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT *context )
case 0x52: /* "SYSVARS" - GET LIST OF LISTS */
{
SEGPTR ptr = DOSDEV_GetLOL( ISV86(context) || !DOSVM_IsWin16() );
SEGPTR ptr = DOSDEV_GetLOL( ISV86(context) );
context->SegEs = SELECTOROF(ptr);
SET_BX( context, OFFSETOF(ptr) );
}
......
......@@ -482,11 +482,10 @@ callrmproc_again:
while (CurrRMCB && (HIWORD(CurrRMCB->address) != context->SegCs))
CurrRMCB = CurrRMCB->next;
if (!CurrRMCB && !MZ_Current())
if (!CurrRMCB)
{
FIXME("DPMI real-mode call using DOS VM task system, not fully tested!\n");
TRACE("creating VM86 task\n");
MZ_AllocDPMITask();
return 0;
}
if (!already) {
if (!context->SegSs) {
......@@ -1069,8 +1068,7 @@ void WINAPI DOSVM_Int31Handler( CONTEXT *context )
TRACE( "set selector base address (0x%04x,0x%08x)\n", sel, base );
/* check if Win16 app wants to access lower 64K of DOS memory */
if (base < 0x10000 && DOSVM_IsWin16())
DOSMEM_MapDosLayout();
if (base < 0x10000) DOSMEM_MapDosLayout();
SetSelectorBase( sel, base );
}
......
......@@ -437,70 +437,6 @@ void DOSVM_HardwareInterruptPM( CONTEXT *context, BYTE intnum )
/**********************************************************************
* DOSVM_EmulateInterruptRM
*
* Emulate software interrupt in real mode.
* Called from VM86 emulation when intXX opcode is executed.
*
* Either calls directly builtin handler or pushes interrupt frame to
* stack and changes instruction pointer to interrupt handler.
*
* Returns FALSE if this interrupt was caused by return
* from real mode wrapper.
*/
BOOL DOSVM_EmulateInterruptRM( CONTEXT *context, BYTE intnum )
{
TRACE_(relay)("\1Call DOS int 0x%02x ret=%04x:%08x\n"
" eax=%08x ebx=%08x ecx=%08x edx=%08x\n"
" esi=%08x edi=%08x ebp=%08x esp=%08x\n"
" ds=%04x es=%04x fs=%04x gs=%04x ss=%04x flags=%08x\n",
intnum, context->SegCs, context->Eip,
context->Eax, context->Ebx, context->Ecx, context->Edx,
context->Esi, context->Edi, context->Ebp, context->Esp,
context->SegDs, context->SegEs, context->SegFs, context->SegGs,
context->SegSs, context->EFlags );
/* check for our real-mode hooks */
if (intnum == 0x31)
{
/* is this exit from real-mode wrapper */
if (context->SegCs == DOSVM_dpmi_segments->wrap_seg)
return FALSE;
if (DOSVM_CheckWrappers( context ))
return TRUE;
}
/* check if the call is from our fake BIOS interrupt stubs */
if (context->SegCs==0xf000)
{
/* Restore original flags stored into the stack by the caller. */
WORD *stack = CTX_SEG_OFF_TO_LIN(context,
context->SegSs, context->Esp);
context->EFlags = (DWORD)MAKELONG( stack[2], HIWORD(context->EFlags) );
if (intnum != context->Eip / DOSVM_STUB_RM)
WARN( "interrupt stub has been modified "
"(interrupt is %02x, interrupt stub is %02x)\n",
intnum, context->Eip/DOSVM_STUB_RM );
TRACE( "builtin interrupt %02x has been branched to\n", intnum );
DOSVM_CallBuiltinHandler( context, intnum );
/* Real mode stubs use IRET so we must put flags back into stack. */
stack[2] = LOWORD(context->EFlags);
}
else
{
DOSVM_HardwareInterruptRM( context, intnum );
}
return TRUE;
}
/**********************************************************************
* DOSVM_HardwareInterruptRM
*
* Emulate call to interrupt handler in real mode.
......@@ -963,12 +899,7 @@ static void WINAPI DOSVM_Int1aHandler( CONTEXT *context )
*/
static void WINAPI DOSVM_Int20Handler( CONTEXT *context )
{
if (DOSVM_IsWin16())
DOSVM_Exit( 0 );
else if(ISV86(context))
MZ_Exit( context, TRUE, 0 );
else
ERR( "Called from DOS protected mode\n" );
DOSVM_Exit( 0 );
}
......
......@@ -739,7 +739,6 @@
# DOS support
@ cdecl -arch=win32 __wine_call_int_handler(ptr long)
@ cdecl -arch=win32 __wine_load_dos_exe(str str)
# VxDs
@ cdecl -arch=win32 -private __wine_vxd_open(wstr long ptr)
......
......@@ -21,137 +21,15 @@
#include "config.h"
#include "dosexe.h"
#include "wine/debug.h"
#include "wingdi.h"
#include "winuser.h"
WINE_DEFAULT_DEBUG_CHANNEL(int);
/*
* FIXME: Use QueryPerformanceCounter for
* more precise GetTimer implementation.
* FIXME: Use QueryPerformanceCounter (or GetTimer implementation)
* in timer tick routine to compensate for lost ticks.
* This should also make it possible to
* emulate really fast timers.
* FIXME: Support special timer modes in addition to periodic mode.
* FIXME: Use timeSetEvent, NtSetEvent or timer thread for more precise
* timing.
* FIXME: Move Win16 timer emulation code here.
*/
/* The PC clocks ticks at 1193180 Hz. */
#define TIMER_FREQ 1193180
/* How many timer IRQs can be pending at any time. */
#define TIMER_MAX_PENDING 20
/* Unique system timer identifier. */
static UINT_PTR TIMER_id = 0;
/* Time when timer IRQ was last queued. */
static DWORD TIMER_stamp = 0;
/* Timer ticks between timer IRQs. */
static UINT TIMER_ticks = 0;
/* Number of pending timer IRQs. */
static LONG TIMER_pending = 0;
/* Number of milliseconds between IRQs. */
static DWORD TIMER_millis = 0;
/***********************************************************************
* TIMER_Relay
*
* Decrement the number of pending IRQs after IRQ handler has been
* called. This function will be called even if application has its
* own IRQ handler that does not jump to builtin IRQ handler.
*/
static void TIMER_Relay( CONTEXT *context, void *data )
{
InterlockedDecrement( &TIMER_pending );
}
/***********************************************************************
* TIMER_TimerProc
*/
static void CALLBACK TIMER_TimerProc( HWND hwnd,
UINT uMsg,
UINT_PTR idEvent,
DWORD dwTime )
{
LONG pending = InterlockedIncrement( &TIMER_pending );
DWORD delta = (dwTime >= TIMER_stamp) ?
(dwTime - TIMER_stamp) : (0xffffffff - (TIMER_stamp - dwTime));
if (pending >= TIMER_MAX_PENDING)
{
if (delta >= 60000)
{
ERR( "DOS timer has been stuck for 60 seconds...\n" );
TIMER_stamp = dwTime;
}
InterlockedDecrement( &TIMER_pending );
}
else
{
DWORD i;
/* Calculate the number of valid timer interrupts we can generate */
DWORD count = delta / TIMER_millis;
/* Forward the timestamp with the time used */
TIMER_stamp += (count * TIMER_millis);
/* Generate interrupts */
for(i=0;i<count;i++)
{
DOSVM_QueueEvent( 0, DOS_PRIORITY_REALTIME, TIMER_Relay, NULL );
}
}
}
/***********************************************************************
* TIMER_DoSetTimer
*/
static void WINAPI TIMER_DoSetTimer( ULONG_PTR arg )
{
INT millis = MulDiv( arg, 1000, TIMER_FREQ );
/* sanity check - too fast timer */
if (millis < 1)
millis = 1;
TRACE_(int)( "setting timer tick delay to %d ms\n", millis );
if (TIMER_id)
KillTimer( NULL, TIMER_id );
TIMER_id = SetTimer( NULL, 0, millis, TIMER_TimerProc );
TIMER_stamp = GetTickCount();
TIMER_ticks = arg;
/* Remember number of milliseconds to wait */
TIMER_millis = millis;
}
/***********************************************************************
* DOSVM_SetTimer
*/
void DOSVM_SetTimer( UINT ticks )
{
/* PIT interprets zero as a maximum length delay. */
if (ticks == 0)
ticks = 0x10000;
if (!DOSVM_IsWin16())
MZ_RunInThread( TIMER_DoSetTimer, ticks );
}
......
......@@ -764,7 +764,7 @@ static void VGA_SyncWindow( BOOL target_is_fb )
}
static void WINAPI VGA_DoExit(ULONG_PTR arg)
static void VGA_DoExit(ULONG_PTR arg)
{
VGA_DeinstallTimer();
IDirectDrawSurface_SetPalette(lpddsurf,NULL);
......@@ -776,10 +776,9 @@ static void WINAPI VGA_DoExit(ULONG_PTR arg)
lpddraw=NULL;
}
static void WINAPI VGA_DoSetMode(ULONG_PTR arg)
static void VGA_DoSetMode( ModeSet *par )
{
HRESULT res;
ModeSet *par = (ModeSet *)arg;
par->ret = FALSE;
if (lpddraw) VGA_DoExit(0);
......@@ -950,7 +949,7 @@ static BOOL VGA_SetGraphicMode(WORD mode)
par.Depth = (vga_fb_depth < 8) ? 8 : vga_fb_depth;
MZ_RunInThread(VGA_DoSetMode, (ULONG_PTR)&par);
VGA_DoSetMode( &par );
return par.ret;
}
......@@ -995,7 +994,7 @@ BOOL VGA_GetMode(unsigned *Height, unsigned *Width, unsigned *Depth)
static void VGA_Exit(void)
{
if (lpddraw) MZ_RunInThread(VGA_DoExit, 0);
if (lpddraw) VGA_DoExit(0);
}
void VGA_SetPalette(PALETTEENTRY*pal,int start,int len)
......@@ -1109,7 +1108,7 @@ int VGA_GetWindowStart(void)
*
* Callback for VGA_ShowMouse.
*/
static void WINAPI VGA_DoShowMouse( ULONG_PTR show )
static void VGA_DoShowMouse( BOOL show )
{
INT rv;
......@@ -1130,8 +1129,7 @@ static void WINAPI VGA_DoShowMouse( ULONG_PTR show )
*/
void VGA_ShowMouse( BOOL show )
{
if (lpddraw)
MZ_RunInThread( VGA_DoShowMouse, (ULONG_PTR)show );
if (lpddraw) VGA_DoShowMouse( show );
}
......
......@@ -275,27 +275,6 @@ static DWORD call16_handler( EXCEPTION_RECORD *record, EXCEPTION_REGISTRATION_RE
}
/*************************************************************
* vm86_handler
*
* Handler for exceptions occurring in vm86 code.
*/
static DWORD vm86_handler( EXCEPTION_RECORD *record, EXCEPTION_REGISTRATION_RECORD *frame,
CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **pdispatcher )
{
if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND))
return ExceptionContinueSearch;
if (record->ExceptionCode == EXCEPTION_ACCESS_VIOLATION ||
record->ExceptionCode == EXCEPTION_PRIV_INSTRUCTION)
{
return __wine_emulate_instruction( record, context );
}
return ExceptionContinueSearch;
}
/*
* 32-bit WOW routines (in WOW32, but actually forwarded to KERNEL32)
*/
......@@ -549,60 +528,41 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags,
SYSLEVEL_CheckNotLevel( 2 );
}
if (context->EFlags & 0x00020000) /* v86 mode */
assert( !(context->EFlags & 0x00020000) ); /* vm86 mode no longer supported */
/* push return address */
if (dwFlags & WCB16_REGS_LONG)
{
EXCEPTION_REGISTRATION_RECORD frame;
frame.Handler = vm86_handler;
errno = 0;
__wine_push_frame( &frame );
__wine_enter_vm86( context );
__wine_pop_frame( &frame );
if (errno != 0) /* enter_vm86 will fail with ENOSYS on x64 kernels */
{
WARN("__wine_enter_vm86 failed (errno=%d)\n", errno);
if (errno == ENOSYS)
SetLastError(ERROR_NOT_SUPPORTED);
else
SetLastError(ERROR_GEN_FAILURE);
return FALSE;
}
stack -= sizeof(DWORD);
*((DWORD *)stack) = HIWORD(call16_ret_addr);
stack -= sizeof(DWORD);
*((DWORD *)stack) = LOWORD(call16_ret_addr);
cbArgs += 2 * sizeof(DWORD);
}
else
{
/* push return address */
if (dwFlags & WCB16_REGS_LONG)
{
stack -= sizeof(DWORD);
*((DWORD *)stack) = HIWORD(call16_ret_addr);
stack -= sizeof(DWORD);
*((DWORD *)stack) = LOWORD(call16_ret_addr);
cbArgs += 2 * sizeof(DWORD);
}
else
{
stack -= sizeof(SEGPTR);
*((SEGPTR *)stack) = call16_ret_addr;
cbArgs += sizeof(SEGPTR);
}
/*
* Start call by checking for pending events.
* Note that wine_call_to_16_regs overwrites context stack
* pointer so we may modify it here without a problem.
*/
if (get_vm86_teb_info()->dpmi_vif)
{
context->SegSs = wine_get_ds();
context->Esp = (DWORD)stack;
insert_event_check( context );
cbArgs += (DWORD)stack - context->Esp;
}
stack -= sizeof(SEGPTR);
*((SEGPTR *)stack) = call16_ret_addr;
cbArgs += sizeof(SEGPTR);
}
_EnterWin16Lock();
wine_call_to_16_regs( context, cbArgs, call16_handler );
_LeaveWin16Lock();
/*
* Start call by checking for pending events.
* Note that wine_call_to_16_regs overwrites context stack
* pointer so we may modify it here without a problem.
*/
if (get_vm86_teb_info()->dpmi_vif)
{
context->SegSs = wine_get_ds();
context->Esp = (DWORD)stack;
insert_event_check( context );
cbArgs += (DWORD)stack - context->Esp;
}
_EnterWin16Lock();
wine_call_to_16_regs( context, cbArgs, call16_handler );
_LeaveWin16Lock();
if (TRACE_ON(relay))
{
TRACE_(relay)( "\1RetFrom16() ss:sp=%04x:%04x ax=%04x bx=%04x cx=%04x dx=%04x bp=%04x sp=%04x\n",
......
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