Changed CONTEXT into CONTEXT86 everywhere we really want an i386

context.
Added #ifdef __i386__ around accesses to 386 registers in the generic
CONTEXT structure.
This commit is contained in:
Alexandre Julliard 1999-06-26 18:40:24 +00:00
parent f6b08dd084
commit 617955db88
55 changed files with 292 additions and 238 deletions

View File

@ -223,7 +223,9 @@ void WINAPI REGS_FUNC(RtlUnwind)( PEXCEPTION_FRAME pEndFrame, LPVOID unusedEip,
EXCEPTION_RECORD record, newrec;
PEXCEPTION_FRAME frame, dispatch;
#ifdef __i386__
EAX_reg(context) = returnEax;
#endif
/* build an exception record, if we do not have one */
if (!pRecord)

View File

@ -376,11 +376,15 @@ BOOLEAN WINAPI RtlGetNtProductType(LPDWORD type)
*/
void WINAPI REGS_FUNC(NTDLL_chkstk)( CONTEXT *context )
{
#ifdef __i386__
ESP_reg(context) -= EAX_reg(context);
#endif
}
void WINAPI REGS_FUNC(NTDLL_alloca_probe)( CONTEXT *context )
{
#ifdef __i386__
ESP_reg(context) -= EAX_reg(context);
#endif
}
/******************************************************************************

View File

@ -511,7 +511,7 @@ DWORD WINAPI GetASPIDLLVersion16()
}
void WINAPI ASPI_DOS_func(CONTEXT *context)
void WINAPI ASPI_DOS_func(CONTEXT86 *context)
{
WORD *stack = CTX_SEG_OFF_TO_LIN(context, SS_reg(context), ESP_reg(context));
DWORD ptrSRB = *(DWORD *)&stack[2];
@ -526,7 +526,7 @@ void WINAPI ASPI_DOS_func(CONTEXT *context)
/* returns the address of a real mode callback to ASPI_DOS_func() */
void ASPI_DOS_HandleInt(CONTEXT *context)
void ASPI_DOS_HandleInt(CONTEXT86 *context)
{
#ifdef linux
FARPROC16 *p = (FARPROC16 *)CTX_SEG_OFF_TO_LIN(context, DS_reg(context), EDX_reg(context));

View File

@ -321,7 +321,7 @@ LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd )
*
* Default interrupt handler.
*/
void BUILTIN_DefaultIntHandler( CONTEXT *context )
void BUILTIN_DefaultIntHandler( CONTEXT86 *context )
{
WORD ordinal;
STACK16FRAME *frame = CURRENT_STACK16;

View File

@ -73,7 +73,7 @@ extern char **debug_relay_excludelist,**debug_relay_includelist;
* RELAY_DebugCallFrom16
*/
void RELAY_DebugCallFrom16( int func_type, char *args,
void *entry_point, CONTEXT *context )
void *entry_point, CONTEXT86 *context )
{
STACK16FRAME *frame;
WORD ordinal;
@ -197,7 +197,7 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
/***********************************************************************
* RELAY_DebugCallFrom16Ret
*/
void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, CONTEXT *context)
void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, CONTEXT86 *context)
{
STACK16FRAME *frame;
WORD ordinal;
@ -269,7 +269,7 @@ void RELAY_DebugCallTo16( int* stack, int nb_args )
if (nb_args == -1) /* Register function */
{
CONTEXT *context = (CONTEXT *)stack[0];
CONTEXT86 *context = (CONTEXT86 *)stack[0];
WORD *stack16 = (WORD *)THREAD_STACK16(teb);
DPRINTF("CallTo16(func=%04lx:%04x,ds=%04lx",
CS_reg(context), IP_reg(context), DS_reg(context) );
@ -323,7 +323,7 @@ void RELAY_DebugCallTo16Ret( int ret_val )
* Real prototype is:
* INT16 WINAPI Catch( LPCATCHBUF lpbuf );
*/
void WINAPI Catch16( CONTEXT *context )
void WINAPI Catch16( CONTEXT86 *context )
{
VA_LIST16 valist;
SEGPTR buf;
@ -370,7 +370,7 @@ void WINAPI Catch16( CONTEXT *context )
* Real prototype is:
* INT16 WINAPI Throw( LPCATCHBUF lpbuf, INT16 retval );
*/
void WINAPI Throw16( CONTEXT *context )
void WINAPI Throw16( CONTEXT86 *context )
{
VA_LIST16 valist;
SEGPTR buf;

View File

@ -22,8 +22,8 @@ DEFAULT_DEBUG_CHANNEL(snoop)
#include "pshpack1.h"
void WINAPI SNOOP16_Entry(CONTEXT *context);
void WINAPI SNOOP16_Return(CONTEXT *context);
void WINAPI SNOOP16_Entry(CONTEXT86 *context);
void WINAPI SNOOP16_Return(CONTEXT86 *context);
extern void CallFrom16_p_regs_();
/* Generic callfrom16_p_regs function entry.
@ -209,7 +209,7 @@ SNOOP16_GetProcAddress16(HMODULE16 hmod,DWORD ordinal,FARPROC16 origfun) {
}
#define CALLER1REF (*(DWORD*)(PTR_SEG_OFF_TO_LIN(SS_reg(context),SP_reg(context)+4)))
void WINAPI SNOOP16_Entry(CONTEXT *context) {
void WINAPI SNOOP16_Entry(CONTEXT86 *context) {
DWORD ordinal=0;
DWORD entry=(DWORD)PTR_SEG_OFF_TO_LIN(CS_reg(context),IP_reg(context))-5;
WORD xcs = CS_reg(context);
@ -276,7 +276,7 @@ void WINAPI SNOOP16_Entry(CONTEXT *context) {
DPRINTF(") ret=%04x:%04x\n",HIWORD(ret->origreturn),LOWORD(ret->origreturn));
}
void WINAPI SNOOP16_Return(CONTEXT *context) {
void WINAPI SNOOP16_Return(CONTEXT86 *context) {
SNOOP16_RETURNENTRY *ret = (SNOOP16_RETURNENTRY*)((char *) PTR_SEG_OFF_TO_LIN(CS_reg(context),IP_reg(context))-5);
/* We haven't found out the nrofargs yet. If we called a cdecl

View File

@ -30,8 +30,8 @@ DECLARE_DEBUG_CHANNEL(thunk)
/* by the build program to generate the file if1632/callto16.S */
/* ### start build ### */
extern LONG CALLBACK CallTo16_sreg_(const CONTEXT *context, INT offset);
extern LONG CALLBACK CallTo16_lreg_(const CONTEXT *context, INT offset);
extern LONG CALLBACK CallTo16_sreg_(const CONTEXT86 *context, INT offset);
extern LONG CALLBACK CallTo16_lreg_(const CONTEXT86 *context, INT offset);
extern WORD CALLBACK CallTo16_word_ (FARPROC16);
extern LONG CALLBACK CallTo16_long_ (FARPROC16);
extern WORD CALLBACK CallTo16_word_w (FARPROC16,WORD);
@ -251,7 +251,7 @@ static LRESULT WINAPI THUNK_CallWndProc16( WNDPROC16 proc, HWND16 hwnd,
UINT16 msg, WPARAM16 wParam,
LPARAM lParam )
{
CONTEXT context;
CONTEXT86 context;
LRESULT ret;
WORD *args;
WND *wndPtr = WIN_FindWndPtr( hwnd );
@ -700,7 +700,7 @@ static VOID WINAPI THUNK_CallMouseEventProc( FARPROC16 proc,
DWORD dwFlags, DWORD dx, DWORD dy,
DWORD cButtons, DWORD dwExtraInfo )
{
CONTEXT context;
CONTEXT86 context;
memset( &context, 0, sizeof(context) );
CS_reg(&context) = SELECTOROF( proc );
@ -748,7 +748,7 @@ FARPROC16 WINAPI GetMouseEventProc16(void)
/***********************************************************************
* WIN16_mouse_event (USER.299)
*/
void WINAPI WIN16_mouse_event( CONTEXT *context )
void WINAPI WIN16_mouse_event( CONTEXT86 *context )
{
mouse_event( AX_reg(context), BX_reg(context), CX_reg(context),
DX_reg(context), MAKELONG(SI_reg(context), DI_reg(context)) );
@ -762,7 +762,7 @@ static VOID WINAPI THUNK_CallKeybdEventProc( FARPROC16 proc,
BYTE bVk, BYTE bScan,
DWORD dwFlags, DWORD dwExtraInfo )
{
CONTEXT context;
CONTEXT86 context;
memset( &context, 0, sizeof(context) );
CS_reg(&context) = SELECTOROF( proc );
@ -800,7 +800,7 @@ VOID WINAPI THUNK_KEYBOARD_Enable( FARPROC16 proc, LPBYTE lpKeyState )
/***********************************************************************
* WIN16_keybd_event (USER.289)
*/
void WINAPI WIN16_keybd_event( CONTEXT *context )
void WINAPI WIN16_keybd_event( CONTEXT86 *context )
{
DWORD dwFlags = 0;
@ -817,7 +817,7 @@ void WINAPI WIN16_keybd_event( CONTEXT *context )
*/
static void THUNK_CallSystemTimerProc( FARPROC16 proc, WORD timer )
{
CONTEXT context;
CONTEXT86 context;
memset( &context, '\0', sizeof(context) );
CS_reg( &context ) = SELECTOROF( proc );
@ -1004,7 +1004,7 @@ UINT WINAPI ThunkConnect16(
* C16ThkSL (KERNEL.630)
*/
void WINAPI C16ThkSL(CONTEXT *context)
void WINAPI C16ThkSL(CONTEXT86 *context)
{
extern void CallFrom16_t_long_(void);
LPBYTE stub = PTR_SEG_TO_LIN(EAX_reg(context)), x = stub;
@ -1047,7 +1047,7 @@ void WINAPI C16ThkSL(CONTEXT *context)
* C16ThkSL01 (KERNEL.631)
*/
void WINAPI C16ThkSL01(CONTEXT *context)
void WINAPI C16ThkSL01(CONTEXT86 *context)
{
LPBYTE stub = PTR_SEG_TO_LIN(EAX_reg(context)), x = stub;
@ -1508,7 +1508,7 @@ void WINAPI InitCBClient16( FARPROC glueLS )
/***********************************************************************
* CBClientGlueSL (KERNEL.604)
*/
void WINAPI CBClientGlueSL( CONTEXT *context )
void WINAPI CBClientGlueSL( CONTEXT86 *context )
{
/* Create stack frame */
SEGPTR stackSeg = STACK16_PUSH( NtCurrentTeb(), 12 );
@ -1533,7 +1533,7 @@ void WINAPI CBClientGlueSL( CONTEXT *context )
/***********************************************************************
* CBClientThunkSL (KERNEL.620)
*/
void WINAPI CBClientThunkSL( CONTEXT *context )
void WINAPI CBClientThunkSL( CONTEXT86 *context )
{
/* Call 32-bit relay code */
extern DWORD WINAPI CALL32_CBClient( FARPROC proc, LPWORD args, DWORD *esi );
@ -1547,7 +1547,7 @@ void WINAPI CBClientThunkSL( CONTEXT *context )
/***********************************************************************
* CBClientThunkSLEx (KERNEL.621)
*/
void WINAPI CBClientThunkSLEx( CONTEXT *context )
void WINAPI CBClientThunkSLEx( CONTEXT86 *context )
{
/* Call 32-bit relay code */
extern DWORD WINAPI CALL32_CBClientEx( FARPROC proc, LPWORD args,

View File

@ -20,8 +20,8 @@ extern int (*IF1632_CallLargeStack)( int (*func)(void), void *arg );
typedef struct
{
LONG (CALLBACK *CallRegisterShortProc)( CONTEXT *, INT );
LONG (CALLBACK *CallRegisterLongProc)( CONTEXT *, INT );
LONG (CALLBACK *CallRegisterShortProc)( CONTEXT86 *, INT );
LONG (CALLBACK *CallRegisterLongProc)( CONTEXT86 *, INT );
VOID (CALLBACK *CallFrom16WndProc)(void);
LRESULT (CALLBACK *CallWndProc)( WNDPROC16, HWND16, UINT16,
WPARAM16, LPARAM );

View File

@ -40,7 +40,7 @@ typedef struct _DOSTASK {
typedef struct _DOSEVENT {
int irq,priority;
void (*relay)(LPDOSTASK,PCONTEXT,void*);
void (*relay)(LPDOSTASK,CONTEXT86*,void*);
void *data;
struct _DOSEVENT *next;
} DOSEVENT, *LPDOSEVENT;
@ -68,9 +68,9 @@ extern BOOL MZ_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmdline, LPCSTR
BOOL inherit, DWORD flags, LPSTARTUPINFOA startup,
LPPROCESS_INFORMATION info );
extern LPDOSTASK MZ_Current( void );
extern int DOSVM_Enter( PCONTEXT context );
extern int DOSVM_Enter( CONTEXT86 *context );
extern void DOSVM_Wait( int read_pipe, HANDLE hObject );
extern void DOSVM_QueueEvent( int irq, int priority, void (*relay)(LPDOSTASK,PCONTEXT,void*), void *data );
extern void DOSVM_QueueEvent( int irq, int priority, void (*relay)(LPDOSTASK,CONTEXT86*,void*), void *data );
extern void DOSVM_PIC_ioport_out( WORD port, BYTE val );
extern void DOSVM_SetTimer( unsigned ticks );
extern unsigned DOSVM_GetTimer( void );

View File

@ -109,9 +109,9 @@ extern FARPROC16 INT_GetPMHandler( BYTE intnum );
extern void INT_SetPMHandler( BYTE intnum, FARPROC16 handler );
extern FARPROC16 INT_GetRMHandler( BYTE intnum );
extern void INT_SetRMHandler( BYTE intnum, FARPROC16 handler );
extern FARPROC16 INT_CtxGetHandler( CONTEXT *context, BYTE intnum );
extern void INT_CtxSetHandler( CONTEXT *context, BYTE intnum, FARPROC16 handler );
extern int INT_RealModeInterrupt( BYTE intnum, PCONTEXT context );
extern FARPROC16 INT_CtxGetHandler( CONTEXT86 *context, BYTE intnum );
extern void INT_CtxSetHandler( CONTEXT86 *context, BYTE intnum, FARPROC16 handler );
extern int INT_RealModeInterrupt( BYTE intnum, CONTEXT86 *context );
/* msdos/ioports.c */
extern void IO_port_init (void);
@ -119,67 +119,67 @@ extern DWORD IO_inport( int port, int count );
extern void IO_outport( int port, int count, DWORD value );
/* msdos/int09.c */
extern void WINAPI INT_Int09Handler(CONTEXT*);
extern void WINAPI INT_Int09Handler(CONTEXT86*);
extern void WINAPI INT_Int09SendScan(BYTE);
extern BYTE WINAPI INT_Int09ReadScan(void);
/* msdos/int10.c */
extern void WINAPI INT_Int10Handler(CONTEXT*);
extern void WINAPI INT_Int10Handler(CONTEXT86*);
/* msdos/int11.c */
extern void WINAPI INT_Int11Handler(CONTEXT*);
extern void WINAPI INT_Int11Handler(CONTEXT86*);
/* msdos/int12.c */
extern void WINAPI INT_Int12Handler(CONTEXT*);
extern void WINAPI INT_Int12Handler(CONTEXT86*);
/* msdos/int13.c */
extern void WINAPI INT_Int13Handler(CONTEXT*);
extern void WINAPI INT_Int13Handler(CONTEXT86*);
/* msdos/int15.c */
extern void WINAPI INT_Int15Handler(CONTEXT*);
extern void WINAPI INT_Int15Handler(CONTEXT86*);
/* msdos/int16.c */
extern void WINAPI INT_Int16Handler(CONTEXT*);
extern void WINAPI INT_Int16Handler(CONTEXT86*);
extern int WINAPI INT_Int16AddChar(BYTE ascii,BYTE scan);
/* msdos/int17.c */
extern void WINAPI INT_Int17Handler(CONTEXT*);
extern void WINAPI INT_Int17Handler(CONTEXT86*);
/* msdos/int19.c */
extern void WINAPI INT_Int19Handler(CONTEXT*);
extern void WINAPI INT_Int19Handler(CONTEXT86*);
/* msdos/int1a.c */
extern DWORD INT1A_GetTicksSinceMidnight(void);
extern void WINAPI INT_Int1aHandler(CONTEXT*);
extern void WINAPI INT_Int1aHandler(CONTEXT86*);
/* msdos/int20.c */
extern void WINAPI INT_Int20Handler(CONTEXT*);
extern void WINAPI INT_Int20Handler(CONTEXT86*);
/* msdos/int25.c */
extern void WINAPI INT_Int25Handler(CONTEXT*);
extern void WINAPI INT_Int25Handler(CONTEXT86*);
/* msdos/int26.c */
extern void WINAPI INT_Int26Handler(CONTEXT*);
extern void WINAPI INT_Int26Handler(CONTEXT86*);
/* msdos/int29.c */
extern void WINAPI INT_Int29Handler(CONTEXT*);
extern void WINAPI INT_Int29Handler(CONTEXT86*);
/* msdos/int2f.c */
extern void WINAPI INT_Int2fHandler(CONTEXT*);
extern void WINAPI INT_Int2fHandler(CONTEXT86*);
/* msdos/int33.c */
extern void WINAPI INT_Int33Handler(CONTEXT*);
extern void WINAPI INT_Int33Handler(CONTEXT86*);
extern void WINAPI INT_Int33Message(UINT,WPARAM,LPARAM);
/* msdos/dpmi.c */
typedef void WINAPI (*RMCBPROC)(CONTEXT*);
extern void WINAPI INT_Int31Handler(CONTEXT*);
typedef void WINAPI (*RMCBPROC)(CONTEXT86*);
extern void WINAPI INT_Int31Handler(CONTEXT86*);
extern FARPROC16 WINAPI DPMI_AllocInternalRMCB(RMCBPROC);
extern void WINAPI DPMI_FreeInternalRMCB(FARPROC16);
extern int DPMI_CallRMProc(CONTEXT*,LPWORD,int,int);
extern int DPMI_CallRMProc(CONTEXT86*,LPWORD,int,int);
/* msdos/xms.c */
extern void WINAPI XMS_Handler(CONTEXT*);
extern void WINAPI XMS_Handler(CONTEXT86*);
/* loader/signal.c */
extern BOOL SIGNAL_Init(void);
@ -187,7 +187,7 @@ extern void SIGNAL_SetHandler( int sig, void (*func)(), int flags );
extern void SIGNAL_MaskAsyncEvents( BOOL flag );
/* misc/aspi.c */
extern void ASPI_DOS_HandleInt(CONTEXT *context);
extern void ASPI_DOS_HandleInt(CONTEXT86 *context);
/* NOTE: Interrupts might get called from three modes: real mode, 16-bit, and
* (via DeviceIoControl) 32-bit. For automatic conversion of pointer

View File

@ -189,7 +189,7 @@ extern struct DosDeviceStruct LPT[MAX_PORTS];
#define EL_Serial 0x04
#define EL_Memory 0x05
void WINAPI DOS3Call( CONTEXT *context );
void WINAPI DOS3Call( CONTEXT86 *context );
#define DOSCONF_MEM_HIGH 0x0001
#define DOSCONF_MEM_UMB 0x0002

View File

@ -50,7 +50,7 @@ DECLARE_DEBUG_CHANNEL(relay)
#undef TRY_PICRETURN
static void do_exception( int signal, CONTEXT *context )
static void do_exception( int signal, CONTEXT86 *context )
{
EXCEPTION_RECORD rec;
extern void WINAPI REGS_FUNC(RtlRaiseException)( EXCEPTION_RECORD *rec,
@ -108,7 +108,7 @@ static void DOSVM_Dump( LPDOSTASK lpDosTask, int fn, int sig,
printf("\n");
}
static int DOSVM_Int( int vect, PCONTEXT context, LPDOSTASK lpDosTask )
static int DOSVM_Int( int vect, CONTEXT86 *context, LPDOSTASK lpDosTask )
{
extern UINT16 DPMI_wrap_seg;
@ -123,7 +123,7 @@ static int DOSVM_Int( int vect, PCONTEXT context, LPDOSTASK lpDosTask )
return 0;
}
static void DOSVM_SimulateInt( int vect, PCONTEXT context, LPDOSTASK lpDosTask )
static void DOSVM_SimulateInt( int vect, CONTEXT86 *context, LPDOSTASK lpDosTask )
{
FARPROC16 handler=INT_GetRMHandler(vect);
@ -150,7 +150,7 @@ static void DOSVM_SimulateInt( int vect, PCONTEXT context, LPDOSTASK lpDosTask )
#define SHOULD_PEND(x) \
(x && ((!lpDosTask->current) || (x->priority < lpDosTask->current->priority)))
static void DOSVM_SendQueuedEvent(PCONTEXT context, LPDOSTASK lpDosTask)
static void DOSVM_SendQueuedEvent(CONTEXT86 *context, LPDOSTASK lpDosTask)
{
LPDOSEVENT event = lpDosTask->pending;
@ -179,7 +179,7 @@ static void DOSVM_SendQueuedEvent(PCONTEXT context, LPDOSTASK lpDosTask)
}
}
static void DOSVM_SendQueuedEvents(PCONTEXT context, LPDOSTASK lpDosTask)
static void DOSVM_SendQueuedEvents(CONTEXT86 *context, LPDOSTASK lpDosTask)
{
/* we will send all queued events as long as interrupts are enabled,
* but IRQ events will disable interrupts again */
@ -187,7 +187,7 @@ static void DOSVM_SendQueuedEvents(PCONTEXT context, LPDOSTASK lpDosTask)
DOSVM_SendQueuedEvent(context,lpDosTask);
}
void DOSVM_QueueEvent( int irq, int priority, void (*relay)(LPDOSTASK,PCONTEXT,void*), void *data)
void DOSVM_QueueEvent( int irq, int priority, void (*relay)(LPDOSTASK,CONTEXT86*,void*), void *data)
{
LPDOSTASK lpDosTask = MZ_Current();
LPDOSEVENT event, cur, prev;
@ -233,7 +233,7 @@ static int DOSVM_Process( LPDOSTASK lpDosTask, int fn, int sig,
struct vm86plus_struct*VM86 )
{
SIGCONTEXT sigcontext;
CONTEXT context;
CONTEXT86 context;
int ret=0;
if (VM86_TYPE(fn)==VM86_UNKNOWN) {
@ -391,7 +391,7 @@ void DOSVM_Wait( int read_pipe, HANDLE hObject )
} while (TRUE);
}
int DOSVM_Enter( PCONTEXT context )
int DOSVM_Enter( CONTEXT86 *context )
{
LPDOSTASK lpDosTask = MZ_Current();
struct vm86plus_struct VM86;
@ -606,7 +606,7 @@ void* DOSVM_GetSystemData( int id )
#else /* !MZ_SUPPORTED */
int DOSVM_Enter( PCONTEXT context )
int DOSVM_Enter( CONTEXT86 *context )
{
ERR_(module)("DOS realmode not supported on this architecture!\n");
return -1;
@ -618,6 +618,6 @@ void DOSVM_SetTimer( unsigned ticks ) {}
unsigned DOSVM_GetTimer( void ) { return 0; }
void DOSVM_SetSystemData( int id, void *data ) { free(data); }
void* DOSVM_GetSystemData( int id ) { return NULL; }
void DOSVM_QueueEvent( int irq, int priority, void (*relay)(LPDOSTASK,PCONTEXT,void*), void *data) {}
void DOSVM_QueueEvent( int irq, int priority, void (*relay)(LPDOSTASK,CONTEXT86*,void*), void *data) {}
#endif

View File

@ -1568,7 +1568,9 @@ HMODULE WINAPI MapHModuleSL(HMODULE16 hmod) {
*/
void WINAPI REGS_FUNC(MapHInstLS)( CONTEXT *context )
{
#ifdef __i386__
EAX_reg(context) = MapHModuleLS(EAX_reg(context));
#endif
}
/***************************************************************************
@ -1576,7 +1578,9 @@ void WINAPI REGS_FUNC(MapHInstLS)( CONTEXT *context )
*/
void WINAPI REGS_FUNC(MapHInstSL)( CONTEXT *context )
{
#ifdef __i386__
EAX_reg(context) = MapHModuleSL(EAX_reg(context));
#endif
}
/***************************************************************************
@ -1584,8 +1588,10 @@ void WINAPI REGS_FUNC(MapHInstSL)( CONTEXT *context )
*/
void WINAPI REGS_FUNC(MapHInstLS_PN)( CONTEXT *context )
{
#ifdef __i386__
if (EAX_reg(context))
EAX_reg(context) = MapHModuleLS(EAX_reg(context));
#endif
}
/***************************************************************************
@ -1593,20 +1599,24 @@ void WINAPI REGS_FUNC(MapHInstLS_PN)( CONTEXT *context )
*/
void WINAPI REGS_FUNC(MapHInstSL_PN)( CONTEXT *context )
{
#ifdef __i386__
if (EAX_reg(context))
EAX_reg(context) = MapHModuleSL(EAX_reg(context));
#endif
}
/***************************************************************************
* WIN16_MapHInstLS (KERNEL.472)
*/
VOID WINAPI WIN16_MapHInstLS( CONTEXT *context ) {
VOID WINAPI WIN16_MapHInstLS( CONTEXT86 *context )
{
EAX_reg(context) = MapHModuleLS(EAX_reg(context));
}
/***************************************************************************
* WIN16_MapHInstSL (KERNEL.473)
*/
VOID WINAPI WIN16_MapHInstSL( CONTEXT *context ) {
VOID WINAPI WIN16_MapHInstSL( CONTEXT86 *context )
{
EAX_reg(context) = MapHModuleSL(EAX_reg(context));
}

View File

@ -623,7 +623,7 @@ static BOOL NE_InitDLL( TDB* pTask, NE_MODULE *pModule )
{
SEGTABLEENTRY *pSegTable;
WORD hInst, ds, heap;
CONTEXT context;
CONTEXT86 context;
pSegTable = NE_SEG_TABLE( pModule );
@ -678,7 +678,7 @@ static void NE_CallDllEntryPoint( NE_MODULE *pModule, DWORD dwReason )
WORD hInst, ds, heap;
FARPROC16 entryPoint;
WORD ordinal;
CONTEXT context;
CONTEXT86 context;
LPBYTE stack = (LPBYTE)CURRENT_STACK16;
if (!(pModule->flags & NE_FFLAGS_BUILTIN) && pModule->expected_version < 0x0400) return;

View File

@ -231,7 +231,7 @@ void TASK_CallToStart(void)
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
NE_MODULE *pModule = NE_GetPtr( pTask->hModule );
SEGTABLEENTRY *pSegTable = NE_SEG_TABLE( pModule );
CONTEXT context;
CONTEXT86 context;
/* Add task to 16-bit scheduler pool */
TASK_Reschedule();
@ -717,7 +717,7 @@ void TASK_Reschedule(void)
*
* Called by the application startup code.
*/
void WINAPI InitTask16( CONTEXT *context )
void WINAPI InitTask16( CONTEXT86 *context )
{
TDB *pTask;
NE_MODULE *pModule;
@ -1210,7 +1210,7 @@ void WINAPI SwitchStackTo16( WORD seg, WORD ptr, WORD top )
/***********************************************************************
* SwitchStackBack (KERNEL.109)
*/
void WINAPI SwitchStackBack16( CONTEXT *context )
void WINAPI SwitchStackBack16( CONTEXT86 *context )
{
STACK16FRAME *oldFrame, *newFrame;
INSTANCEDATA *pData;
@ -1254,7 +1254,7 @@ void WINAPI SwitchStackBack16( CONTEXT *context )
/***********************************************************************
* GetTaskQueueDS (KERNEL.118)
*/
void WINAPI GetTaskQueueDS16( CONTEXT *context )
void WINAPI GetTaskQueueDS16( CONTEXT86 *context )
{
DS_reg(context) = GlobalHandleToSel16( GetTaskQueue16(0) );
}
@ -1263,7 +1263,7 @@ void WINAPI GetTaskQueueDS16( CONTEXT *context )
/***********************************************************************
* GetTaskQueueES (KERNEL.119)
*/
void WINAPI GetTaskQueueES16( CONTEXT *context )
void WINAPI GetTaskQueueES16( CONTEXT86 *context )
{
ES_reg(context) = GlobalHandleToSel16( GetTaskQueue16(0) );
}
@ -1374,7 +1374,7 @@ HINSTANCE16 WINAPI GetTaskDS16(void)
/***********************************************************************
* GetDummyModuleHandleDS (KERNEL.602)
*/
VOID WINAPI GetDummyModuleHandleDS16( CONTEXT *context )
VOID WINAPI GetDummyModuleHandleDS16( CONTEXT86 *context )
{
TDB *pTask;
WORD selector;
@ -1513,7 +1513,7 @@ HMODULE16 WINAPI GetExePtr( HANDLE16 handle )
return GetExePtrHelper( handle, &dummy );
}
void WINAPI WIN16_GetExePtr( CONTEXT *context )
void WINAPI WIN16_GetExePtr( CONTEXT86 *context )
{
WORD *stack = PTR_SEG_OFF_TO_LIN(SS_reg(context), SP_reg(context));
HANDLE16 handle = (HANDLE16)stack[2];

View File

@ -547,7 +547,7 @@ BOOL16 WINAPI GlobalUnlock16(
* *all* registers, even AX/DX !
*
*/
void WINAPI GlobalChangeLockCount16( CONTEXT *context )
void WINAPI GlobalChangeLockCount16( CONTEXT86 *context )
{
LPWORD args = PTR_SEG_OFF_TO_LIN( SS_reg( context ), SP_reg( context ) );
HGLOBAL16 handle = (HGLOBAL16)args[3];

View File

@ -1527,7 +1527,7 @@ HLOCAL16 WINAPI LocalAlloc16( UINT16 flags, WORD size )
/***********************************************************************
* WIN16_LocalAlloc
*/
void WINAPI WIN16_LocalAlloc( CONTEXT *context )
void WINAPI WIN16_LocalAlloc( CONTEXT86 *context )
{
WORD *stack = PTR_SEG_OFF_TO_LIN(SS_reg(context), SP_reg(context));
UINT16 flags = (UINT16)stack[3];

View File

@ -628,6 +628,7 @@ BOOL WINAPI GetThreadSelectorEntry( HANDLE hthread, DWORD sel,
*/
static void
x_SMapLS_IP_EBP_x(CONTEXT *context,int argoff) {
#ifdef __i386__
DWORD val,ptr;
val =*(DWORD*)(EBP_reg(context)+argoff);
@ -639,6 +640,7 @@ x_SMapLS_IP_EBP_x(CONTEXT *context,int argoff) {
*(DWORD*)(EBP_reg(context)+argoff) = ptr;
}
EAX_reg(context) = ptr;
#endif
}
void WINAPI REGS_FUNC(SMapLS_IP_EBP_8)(CONTEXT *context) {x_SMapLS_IP_EBP_x(context,8);}
@ -653,25 +655,31 @@ void WINAPI REGS_FUNC(SMapLS_IP_EBP_40)(CONTEXT *context) {x_SMapLS_IP_EBP_x(con
void WINAPI REGS_FUNC(SMapLS)( CONTEXT *context )
{
#ifdef __i386__
if (EAX_reg(context)>=0x10000) {
EAX_reg(context) = MapLS((LPVOID)EAX_reg(context));
EDX_reg(context) = EAX_reg(context);
} else {
EDX_reg(context) = 0;
}
#endif
}
void WINAPI REGS_FUNC(SUnMapLS)( CONTEXT *context )
{
#ifdef __i386__
if (EAX_reg(context)>=0x10000)
UnMapLS((SEGPTR)EAX_reg(context));
#endif
}
static void
x_SUnMapLS_IP_EBP_x(CONTEXT *context,int argoff) {
#ifdef __i386__
if (*(DWORD*)(EBP_reg(context)+argoff))
UnMapLS(*(DWORD*)(EBP_reg(context)+argoff));
*(DWORD*)(EBP_reg(context)+argoff)=0;
#endif
}
void WINAPI REGS_FUNC(SUnMapLS_IP_EBP_8)(CONTEXT *context) { x_SUnMapLS_IP_EBP_x(context,8); }
void WINAPI REGS_FUNC(SUnMapLS_IP_EBP_12)(CONTEXT *context) { x_SUnMapLS_IP_EBP_x(context,12); }
@ -704,6 +712,7 @@ void WINAPI REGS_FUNC(SUnMapLS_IP_EBP_40)(CONTEXT *context) { x_SUnMapLS_IP_EBP_
void WINAPI REGS_FUNC(AllocMappedBuffer)( CONTEXT *context )
{
#ifdef __i386__
HGLOBAL handle = GlobalAlloc(0, EDI_reg(context) + 8);
DWORD *buffer = (DWORD *)GlobalLock(handle);
SEGPTR ptr = 0;
@ -725,6 +734,7 @@ void WINAPI REGS_FUNC(AllocMappedBuffer)( CONTEXT *context )
EAX_reg(context) = (DWORD) ptr;
EDI_reg(context) = (DWORD)(buffer + 2);
}
#endif
}
/**********************************************************************
@ -737,6 +747,7 @@ void WINAPI REGS_FUNC(AllocMappedBuffer)( CONTEXT *context )
void WINAPI REGS_FUNC(FreeMappedBuffer)( CONTEXT *context )
{
#ifdef __i386__
if (EDI_reg(context))
{
DWORD *buffer = (DWORD *)EDI_reg(context) - 2;
@ -746,6 +757,7 @@ void WINAPI REGS_FUNC(FreeMappedBuffer)( CONTEXT *context )
GlobalUnlock(buffer[0]);
GlobalFree(buffer[0]);
}
#endif
}
/**********************************************************************

View File

@ -40,7 +40,7 @@ static LRESULT WINAPI CALLBACK_CallWndProc( WNDPROC16 proc, HWND16 hwnd,
/**********************************************************************
* CALLBACK_CallRegisterProc
*/
static LONG WINAPI CALLBACK_CallRegisterProc( CONTEXT *context, INT offset)
static LONG WINAPI CALLBACK_CallRegisterProc( CONTEXT86 *context, INT offset)
{
ERR(relay, "Cannot call a register proc in Winelib\n" );
assert( FALSE );

View File

@ -158,7 +158,7 @@ void WINAPI LogParamError16(UINT16 uErr, FARPROC16 lpfn, LPVOID lpvParam)
/***********************************************************************
* HandleParamError (KERNEL.327)
*/
void WINAPI HandleParamError( CONTEXT *context )
void WINAPI HandleParamError( CONTEXT86 *context )
{
UINT16 uErr = BX_reg( context );
FARPROC16 lpfn = (FARPROC16)PTR_SEG_OFF_TO_SEGPTR( CS_reg(context),

View File

@ -16,7 +16,7 @@ DEFAULT_DEBUG_CHANNEL(dll)
* WinNotify (WINDEBUG.3)
* written without _any_ docu
*/
void WINAPI WinNotify16(CONTEXT *context)
void WINAPI WinNotify16(CONTEXT86 *context)
{
FIXME(dll, "(AX=%04x):stub.\n", AX_reg(context));
switch (AX_reg(context))

View File

@ -27,7 +27,7 @@ struct Win87EmInfoStruct
*/
/* FIXME: Only skeletal implementation for now */
void WINAPI WIN87_fpmath( CONTEXT *context )
void WINAPI WIN87_fpmath( CONTEXT86 *context )
{
TRACE(int, "(cs:eip=%x:%lx es=%x bx=%04x ax=%04x dx==%04x)\n",
(WORD)CS_reg(context), EIP_reg(context),

View File

@ -100,10 +100,10 @@ DWORD DOS_LOLSeg;
#define ALL_OFS (ALLDEV_OFS + REQ_SCRATCH)
/* prototypes */
static void WINAPI nul_strategy(CONTEXT*ctx);
static void WINAPI nul_interrupt(CONTEXT*ctx);
static void WINAPI con_strategy(CONTEXT*ctx);
static void WINAPI con_interrupt(CONTEXT*ctx);
static void WINAPI nul_strategy(CONTEXT86*ctx);
static void WINAPI nul_interrupt(CONTEXT86*ctx);
static void WINAPI con_strategy(CONTEXT86*ctx);
static void WINAPI con_interrupt(CONTEXT86*ctx);
/* the device headers */
#define STRATEGY_OFS sizeof(DOS_DEVICE_HEADER)
@ -128,7 +128,7 @@ static WINEDEV devs[]={
#define nr_devs (sizeof(devs)/sizeof(WINEDEV))
/* the device implementations */
static void do_lret(CONTEXT*ctx)
static void do_lret(CONTEXT86*ctx)
{
WORD *stack = CTX_SEG_OFF_TO_LIN(ctx, SS_reg(ctx), ESP_reg(ctx));
@ -137,7 +137,7 @@ static void do_lret(CONTEXT*ctx)
SP_reg(ctx) += 2*sizeof(WORD);
}
static void do_strategy(CONTEXT*ctx, int id, int extra)
static void do_strategy(CONTEXT86*ctx, int id, int extra)
{
REQUEST_HEADER *hdr = CTX_SEG_OFF_TO_LIN(ctx, ES_reg(ctx), EBX_reg(ctx));
void **hdr_ptr = DOSVM_GetSystemData(id);
@ -159,12 +159,12 @@ static REQUEST_HEADER * get_hdr(int id, void**extra)
return hdr_ptr ? *hdr_ptr : (void *)NULL;
}
static void WINAPI nul_strategy(CONTEXT*ctx)
static void WINAPI nul_strategy(CONTEXT86*ctx)
{
do_strategy(ctx, SYSTEM_STRATEGY_NUL, 0);
}
static void WINAPI nul_interrupt(CONTEXT*ctx)
static void WINAPI nul_interrupt(CONTEXT86*ctx)
{
REQUEST_HEADER *hdr = get_hdr(SYSTEM_STRATEGY_NUL, NULL);
/* eat everything and recycle nothing */
@ -184,12 +184,12 @@ static void WINAPI nul_interrupt(CONTEXT*ctx)
#define CON_BUFFER 128
static void WINAPI con_strategy(CONTEXT*ctx)
static void WINAPI con_strategy(CONTEXT86*ctx)
{
do_strategy(ctx, SYSTEM_STRATEGY_CON, sizeof(int));
}
static void WINAPI con_interrupt(CONTEXT*ctx)
static void WINAPI con_interrupt(CONTEXT86*ctx)
{
int *scan;
REQUEST_HEADER *hdr = get_hdr(SYSTEM_STRATEGY_CON,(void **)&scan);
@ -509,7 +509,7 @@ static void DOSDEV_DoReq(void*req, DWORD dev)
{
REQUEST_HEADER *hdr = (REQUEST_HEADER *)req;
DOS_DEVICE_HEADER *dhdr;
CONTEXT ctx;
CONTEXT86 ctx;
char *phdr;
dhdr = DOSMEM_MapRealToLinear(dev);

View File

@ -139,7 +139,7 @@ DPMI_xrealloc(LPVOID ptr,int newsize) {
/**********************************************************************
* INT_GetRealModeContext
*/
static void INT_GetRealModeContext( REALMODECALL *call, CONTEXT *context )
static void INT_GetRealModeContext( REALMODECALL *call, CONTEXT86 *context )
{
EAX_reg(context) = call->eax;
EBX_reg(context) = call->ebx;
@ -164,7 +164,7 @@ static void INT_GetRealModeContext( REALMODECALL *call, CONTEXT *context )
/**********************************************************************
* INT_SetRealModeContext
*/
static void INT_SetRealModeContext( REALMODECALL *call, CONTEXT *context )
static void INT_SetRealModeContext( REALMODECALL *call, CONTEXT86 *context )
{
call->eax = EAX_reg(context);
call->ebx = EBX_reg(context);
@ -190,7 +190,7 @@ static void INT_SetRealModeContext( REALMODECALL *call, CONTEXT *context )
*
* This routine does the hard work of calling a callback procedure.
*/
static void DPMI_CallRMCBProc( CONTEXT *context, RMCB *rmcb, WORD flag )
static void DPMI_CallRMCBProc( CONTEXT86 *context, RMCB *rmcb, WORD flag )
{
if (IS_SELECTOR_SYSTEM( rmcb->proc_sel )) {
/* Wine-internal RMCB, call directly */
@ -232,7 +232,7 @@ static void DPMI_CallRMCBProc( CONTEXT *context, RMCB *rmcb, WORD flag )
: "ecx", "edx", "ebp" );
} else {
/* 16-bit DPMI client */
CONTEXT ctx = *context;
CONTEXT86 ctx = *context;
CS_reg(&ctx) = rmcb->proc_sel;
EIP_reg(&ctx) = rmcb->proc_ofs;
DS_reg(&ctx) = ss;
@ -257,7 +257,7 @@ static void DPMI_CallRMCBProc( CONTEXT *context, RMCB *rmcb, WORD flag )
*
* This routine does the hard work of calling a real mode procedure.
*/
int DPMI_CallRMProc( CONTEXT *context, LPWORD stack, int args, int iret )
int DPMI_CallRMProc( CONTEXT86 *context, LPWORD stack, int args, int iret )
{
LPWORD stack16;
#ifndef MZ_SUPPORTED
@ -401,9 +401,9 @@ callrmproc_again:
/**********************************************************************
* CallRMInt
*/
static void CallRMInt( CONTEXT *context )
static void CallRMInt( CONTEXT86 *context )
{
CONTEXT realmode_ctx;
CONTEXT86 realmode_ctx;
FARPROC16 rm_int = INT_GetRMHandler( BL_reg(context) );
REALMODECALL *call = (REALMODECALL *)PTR_SEG_OFF_TO_LIN( ES_reg(context),
DI_reg(context) );
@ -435,10 +435,10 @@ static void CallRMInt( CONTEXT *context )
}
static void CallRMProc( CONTEXT *context, int iret )
static void CallRMProc( CONTEXT86 *context, int iret )
{
REALMODECALL *p = (REALMODECALL *)PTR_SEG_OFF_TO_LIN( ES_reg(context), DI_reg(context) );
CONTEXT context16;
CONTEXT86 context16;
TRACE(int31, "RealModeCall: EAX=%08lx EBX=%08lx ECX=%08lx EDX=%08lx\n",
p->eax, p->ebx, p->ecx, p->edx);
@ -506,7 +506,7 @@ static RMCB *DPMI_AllocRMCB( void )
}
static void AllocRMCB( CONTEXT *context )
static void AllocRMCB( CONTEXT86 *context )
{
RMCB *NewRMCB = DPMI_AllocRMCB();
@ -569,7 +569,7 @@ static int DPMI_FreeRMCB( DWORD address )
}
static void FreeRMCB( CONTEXT *context )
static void FreeRMCB( CONTEXT86 *context )
{
FIXME(int31, "callback address: %04x:%04x\n",
CX_reg(context), DX_reg(context));
@ -590,11 +590,11 @@ void WINAPI DPMI_FreeInternalRMCB( FARPROC16 proc )
#ifdef MZ_SUPPORTED
/* (see loader/dos/module.c, function MZ_InitDPMI) */
static void StartPM( CONTEXT *context, LPDOSTASK lpDosTask )
static void StartPM( CONTEXT86 *context, LPDOSTASK lpDosTask )
{
char *base = DOSMEM_MemoryBase(0);
UINT16 cs, ss, ds, es;
CONTEXT pm_ctx;
CONTEXT86 pm_ctx;
DWORD psp_ofs = (DWORD)(lpDosTask->psp_seg<<4);
PDB16 *psp = (PDB16 *)(base + psp_ofs);
HANDLE16 env_seg = psp->environment;
@ -647,7 +647,7 @@ static void StartPM( CONTEXT *context, LPDOSTASK lpDosTask )
void WINAPI DPMI_RawModeSwitch( SIGCONTEXT *context )
{
LPDOSTASK lpDosTask = MZ_Current();
CONTEXT rm_ctx;
CONTEXT86 rm_ctx;
int ret;
if (!lpDosTask) {
@ -722,7 +722,7 @@ void WINAPI DPMI_RawModeSwitch( SIGCONTEXT *context )
* Handler for int 31h (DPMI).
*/
void WINAPI INT_Int31Handler( CONTEXT *context )
void WINAPI INT_Int31Handler( CONTEXT86 *context )
{
/*
* Note: For Win32s processes, the whole linear address space is

View File

@ -21,7 +21,7 @@ typedef struct {
*
* Handler for int 09h.
*/
void WINAPI INT_Int09Handler( CONTEXT *context )
void WINAPI INT_Int09Handler( CONTEXT86 *context )
{
BYTE scan = INT_Int09ReadScan();
UINT vkey = MapVirtualKeyA(scan&0x7f, 1);
@ -38,7 +38,7 @@ void WINAPI INT_Int09Handler( CONTEXT *context )
DOSVM_PIC_ioport_out(0x20, 0x20); /* send EOI */
}
static void KbdRelay( LPDOSTASK lpDosTask, PCONTEXT context, void *data )
static void KbdRelay( LPDOSTASK lpDosTask, CONTEXT86 *context, void *data )
{
KBDSYSTEM *sys = (KBDSYSTEM *)DOSVM_GetSystemData(0x09);

View File

@ -56,7 +56,7 @@ static int color_palette[16];
* Added additional vga graphic support - 3/99
*/
void WINAPI INT_Int10Handler( CONTEXT *context )
void WINAPI INT_Int10Handler( CONTEXT86 *context )
{
static int registered_colors = FALSE;

View File

@ -13,7 +13,7 @@
*
* Handler for int 11h (get equipment list).
*/
void WINAPI INT_Int11Handler( CONTEXT *context )
void WINAPI INT_Int11Handler( CONTEXT86 *context )
{
int diskdrives = 0;
int parallelports = 0;

View File

@ -9,7 +9,7 @@
*
* Handler for int 12h (get memory size).
*/
void WINAPI INT_Int12Handler( CONTEXT *context )
void WINAPI INT_Int12Handler( CONTEXT86 *context )
{
AX_reg(context) = 640;
}

View File

@ -23,7 +23,7 @@ DEFAULT_DEBUG_CHANNEL(int)
*
* Handler for int 13h (disk I/O).
*/
void WINAPI INT_Int13Handler( CONTEXT *context )
void WINAPI INT_Int13Handler( CONTEXT86 *context )
{
switch(AH_reg(context))
{

View File

@ -14,7 +14,7 @@ DEFAULT_DEBUG_CHANNEL(int)
*
* Handler for int 15h (old cassette interrupt).
*/
void WINAPI INT_Int15Handler( CONTEXT *context )
void WINAPI INT_Int15Handler( CONTEXT86 *context )
{
switch(AH_reg(context))
{

View File

@ -27,7 +27,7 @@ DEFAULT_DEBUG_CHANNEL(int16)
* not currently listed here.
*/
void WINAPI INT_Int16Handler( CONTEXT *context )
void WINAPI INT_Int16Handler( CONTEXT86 *context )
{
switch AH_reg(context) {

View File

@ -17,7 +17,7 @@ DEFAULT_DEBUG_CHANNEL(int17)
*
* Handler for int 17h (printer - output character).
*/
void WINAPI INT_Int17Handler( CONTEXT *context )
void WINAPI INT_Int17Handler( CONTEXT86 *context )
{
switch( AH_reg(context) )
{

View File

@ -14,7 +14,7 @@ DEFAULT_DEBUG_CHANNEL(int19)
*
* Handler for int 19h (Reboot).
*/
void WINAPI INT_Int19Handler( CONTEXT *context )
void WINAPI INT_Int19Handler( CONTEXT86 *context )
{
WARN(int19, "Attempted Reboot\n");
}

View File

@ -45,7 +45,7 @@ DWORD INT1A_GetTicksSinceMidnight(void)
* 0x00 - 0x07 - date and time
* 0x?? - 0x?? - Microsoft Real Time Compression Interface
*/
void WINAPI INT_Int1aHandler( CONTEXT *context )
void WINAPI INT_Int1aHandler( CONTEXT86 *context )
{
time_t ltime;
DWORD ticks;

View File

@ -14,7 +14,7 @@
*
* Handler for int 20h.
*/
void WINAPI INT_Int20Handler( CONTEXT *context )
void WINAPI INT_Int20Handler( CONTEXT86 *context )
{
ExitProcess( 0 );
}

View File

@ -102,7 +102,7 @@ static BOOL INT21_CreateHeap(void)
return TRUE;
}
static BYTE *GetCurrentDTA( CONTEXT *context )
static BYTE *GetCurrentDTA( CONTEXT86 *context )
{
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
@ -152,7 +152,7 @@ void CreateBPB(int drive, BYTE *data, BOOL16 limited)
}
}
static int INT21_GetFreeDiskSpace( CONTEXT *context )
static int INT21_GetFreeDiskSpace( CONTEXT86 *context )
{
DWORD cluster_sectors, sector_bytes, free_clusters, total_clusters;
char root[] = "A:\\";
@ -167,7 +167,7 @@ static int INT21_GetFreeDiskSpace( CONTEXT *context )
return 1;
}
static int INT21_GetDriveAllocInfo( CONTEXT *context )
static int INT21_GetDriveAllocInfo( CONTEXT86 *context )
{
if (!INT21_GetFreeDiskSpace( context )) return 0;
if (!heap && !INT21_CreateHeap()) return 0;
@ -177,7 +177,7 @@ static int INT21_GetDriveAllocInfo( CONTEXT *context )
return 1;
}
static void GetDrivePB( CONTEXT *context, int drive )
static void GetDrivePB( CONTEXT86 *context, int drive )
{
if(!DRIVE_IsValid(drive))
{
@ -220,7 +220,7 @@ static void GetDrivePB( CONTEXT *context, int drive )
}
static void ioctlGetDeviceInfo( CONTEXT *context )
static void ioctlGetDeviceInfo( CONTEXT86 *context )
{
int curr_drive;
const DOS_DEVICE *dev;
@ -249,7 +249,7 @@ static void ioctlGetDeviceInfo( CONTEXT *context )
*/
}
static BOOL ioctlGenericBlkDevReq( CONTEXT *context )
static BOOL ioctlGenericBlkDevReq( CONTEXT86 *context )
{
BYTE *dataptr = CTX_SEG_OFF_TO_LIN(context, DS_reg(context), EDX_reg(context));
int drive = DOS_GET_DRIVE( BL_reg(context) );
@ -356,7 +356,7 @@ static BOOL ioctlGenericBlkDevReq( CONTEXT *context )
return FALSE;
}
static void INT21_ParseFileNameIntoFCB( CONTEXT *context )
static void INT21_ParseFileNameIntoFCB( CONTEXT86 *context )
{
char *filename =
CTX_SEG_OFF_TO_LIN(context, DS_reg(context), ESI_reg(context) );
@ -394,7 +394,7 @@ static void INT21_ParseFileNameIntoFCB( CONTEXT *context )
SI_reg(context) += (int)s - (int)filename;
}
static void INT21_GetSystemDate( CONTEXT *context )
static void INT21_GetSystemDate( CONTEXT86 *context )
{
SYSTEMTIME systime;
GetLocalTime( &systime );
@ -403,7 +403,7 @@ static void INT21_GetSystemDate( CONTEXT *context )
AX_reg(context) = systime.wDayOfWeek;
}
static void INT21_GetSystemTime( CONTEXT *context )
static void INT21_GetSystemTime( CONTEXT86 *context )
{
SYSTEMTIME systime;
GetLocalTime( &systime );
@ -427,7 +427,7 @@ char *INT21_DriveName(int drive)
}
return drivestring;
}
static BOOL INT21_CreateFile( CONTEXT *context )
static BOOL INT21_CreateFile( CONTEXT86 *context )
{
AX_reg(context) = _lcreat16( CTX_SEG_OFF_TO_LIN(context, DS_reg(context),
EDX_reg(context) ), CX_reg(context) );
@ -443,7 +443,7 @@ static HFILE16 _lcreat16_uniq( LPCSTR path, INT attr )
CREATE_NEW, attr, -1 ));
}
static void OpenExistingFile( CONTEXT *context )
static void OpenExistingFile( CONTEXT86 *context )
{
AX_reg(context) = _lopen16( CTX_SEG_OFF_TO_LIN(context, DS_reg(context),EDX_reg(context)),
AL_reg(context) );
@ -454,7 +454,7 @@ static void OpenExistingFile( CONTEXT *context )
}
}
static BOOL INT21_ExtendedOpenCreateFile(CONTEXT *context )
static BOOL INT21_ExtendedOpenCreateFile(CONTEXT86 *context )
{
BOOL bExtendedError = FALSE;
BYTE action = DL_reg(context);
@ -548,7 +548,7 @@ static BOOL INT21_ExtendedOpenCreateFile(CONTEXT *context )
}
static BOOL INT21_ChangeDir( CONTEXT *context )
static BOOL INT21_ChangeDir( CONTEXT86 *context )
{
int drive;
char *dirname = CTX_SEG_OFF_TO_LIN(context, DS_reg(context),EDX_reg(context));
@ -564,7 +564,7 @@ static BOOL INT21_ChangeDir( CONTEXT *context )
}
static int INT21_FindFirst( CONTEXT *context )
static int INT21_FindFirst( CONTEXT86 *context )
{
char *p;
const char *path;
@ -603,7 +603,7 @@ static int INT21_FindFirst( CONTEXT *context )
}
static int INT21_FindNext( CONTEXT *context )
static int INT21_FindNext( CONTEXT86 *context )
{
FINDFILE_DTA *dta = (FINDFILE_DTA *)GetCurrentDTA(context);
WIN32_FIND_DATAA entry;
@ -641,7 +641,7 @@ static int INT21_FindNext( CONTEXT *context )
}
static BOOL INT21_CreateTempFile( CONTEXT *context )
static BOOL INT21_CreateTempFile( CONTEXT86 *context )
{
static int counter = 0;
char *name = CTX_SEG_OFF_TO_LIN(context, DS_reg(context), EDX_reg(context) );
@ -666,7 +666,7 @@ static BOOL INT21_CreateTempFile( CONTEXT *context )
}
static BOOL INT21_GetCurrentDirectory( CONTEXT *context )
static BOOL INT21_GetCurrentDirectory( CONTEXT86 *context )
{
int drive = DOS_GET_DRIVE( DL_reg(context) );
char *ptr = (char *)CTX_SEG_OFF_TO_LIN(context, DS_reg(context), ESI_reg(context) );
@ -682,7 +682,7 @@ static BOOL INT21_GetCurrentDirectory( CONTEXT *context )
}
static void INT21_GetDBCSLeadTable( CONTEXT *context )
static void INT21_GetDBCSLeadTable( CONTEXT86 *context )
{
if (heap || INT21_CreateHeap())
{ /* return an empty table just as DOS 4.0+ does */
@ -697,7 +697,7 @@ static void INT21_GetDBCSLeadTable( CONTEXT *context )
}
static int INT21_GetDiskSerialNumber( CONTEXT *context )
static int INT21_GetDiskSerialNumber( CONTEXT86 *context )
{
BYTE *dataptr = CTX_SEG_OFF_TO_LIN(context, DS_reg(context), EDX_reg(context));
int drive = DOS_GET_DRIVE( BL_reg(context) );
@ -716,7 +716,7 @@ static int INT21_GetDiskSerialNumber( CONTEXT *context )
}
static int INT21_SetDiskSerialNumber( CONTEXT *context )
static int INT21_SetDiskSerialNumber( CONTEXT86 *context )
{
BYTE *dataptr = CTX_SEG_OFF_TO_LIN(context, DS_reg(context), EDX_reg(context));
int drive = DOS_GET_DRIVE( BL_reg(context) );
@ -735,7 +735,7 @@ static int INT21_SetDiskSerialNumber( CONTEXT *context )
/* microsoft's programmers should be shot for using CP/M style int21
calls in Windows for Workgroup's winfile.exe */
static int INT21_FindFirstFCB( CONTEXT *context )
static int INT21_FindFirstFCB( CONTEXT86 *context )
{
BYTE *fcb = (BYTE *)CTX_SEG_OFF_TO_LIN(context, DS_reg(context), EDX_reg(context));
FINDFILE_FCB *pFCB;
@ -759,7 +759,7 @@ static int INT21_FindFirstFCB( CONTEXT *context )
}
static int INT21_FindNextFCB( CONTEXT *context )
static int INT21_FindNextFCB( CONTEXT86 *context )
{
BYTE *fcb = (BYTE *)CTX_SEG_OFF_TO_LIN(context, DS_reg(context), EDX_reg(context));
FINDFILE_FCB *pFCB;
@ -828,19 +828,19 @@ static int INT21_FindNextFCB( CONTEXT *context )
}
static void DeleteFileFCB( CONTEXT *context )
static void DeleteFileFCB( CONTEXT86 *context )
{
FIXME(int21, "(%p): stub\n", context);
}
static void RenameFileFCB( CONTEXT *context )
static void RenameFileFCB( CONTEXT86 *context )
{
FIXME(int21, "(%p): stub\n", context);
}
static void fLock( CONTEXT * context )
static void fLock( CONTEXT86 * context )
{
switch ( AX_reg(context) & 0xff )
@ -878,7 +878,7 @@ static void fLock( CONTEXT * context )
}
static BOOL
INT21_networkfunc (CONTEXT *context)
INT21_networkfunc (CONTEXT86 *context)
{
switch (AL_reg(context)) {
case 0x00: /* Get machine name. */
@ -940,7 +940,7 @@ static WORD INT21_GetCurrentPSP()
/***********************************************************************
* INT21_GetExtendedError
*/
static void INT21_GetExtendedError( CONTEXT *context )
static void INT21_GetExtendedError( CONTEXT86 *context )
{
BYTE class, action, locus;
WORD error = GetLastError();
@ -1055,7 +1055,7 @@ static void INT21_GetExtendedError( CONTEXT *context )
/***********************************************************************
* DOS3Call (KERNEL.102)
*/
void WINAPI DOS3Call( CONTEXT *context )
void WINAPI DOS3Call( CONTEXT86 *context )
{
BOOL bSetDOSExtendedError = FALSE;

View File

@ -20,7 +20,7 @@ DEFAULT_DEBUG_CHANNEL(int)
*
* Handler for int 25h (absolute disk read).
*/
void WINAPI INT_Int25Handler( CONTEXT *context )
void WINAPI INT_Int25Handler( CONTEXT86 *context )
{
BYTE *dataptr = CTX_SEG_OFF_TO_LIN( context, DS_reg(context), EBX_reg(context) );
DWORD begin, length;

View File

@ -18,7 +18,7 @@ DEFAULT_DEBUG_CHANNEL(int)
*
* Handler for int 26h (absolute disk read).
*/
void WINAPI INT_Int26Handler( CONTEXT *context )
void WINAPI INT_Int26Handler( CONTEXT86 *context )
{
BYTE *dataptr = CTX_SEG_OFF_TO_LIN( context, DS_reg(context), EBX_reg(context) );
DWORD begin, length;

View File

@ -12,7 +12,7 @@
*
* Handler for int 29h (fast console output)
*/
void WINAPI INT_Int29Handler( CONTEXT *context )
void WINAPI INT_Int29Handler( CONTEXT86 *context )
{
/* Yes, it seems that this is really all this interrupt does. */
CONSOLE_Write(AL_reg(context), 0, 0, 0);

View File

@ -12,7 +12,7 @@
*
* Handler for int 2ah (network).
*/
void WINAPI INT_Int2aHandler( CONTEXT *context )
void WINAPI INT_Int2aHandler( CONTEXT86 *context )
{
switch(AH_reg(context))
{

View File

@ -29,15 +29,15 @@ DEFAULT_DEBUG_CHANNEL(int)
/* base WPROCS.DLL ordinal number for VxDs */
#define VXD_BASE 400
static void do_int2f_16( CONTEXT *context );
static void MSCDEX_Handler( CONTEXT *context );
static void do_int2f_16( CONTEXT86 *context );
static void MSCDEX_Handler( CONTEXT86 *context );
/**********************************************************************
* INT_Int2fHandler
*
* Handler for int 2fh (multiplex).
*/
void WINAPI INT_Int2fHandler( CONTEXT *context )
void WINAPI INT_Int2fHandler( CONTEXT86 *context )
{
TRACE(int,"Subfunction 0x%X\n", AX_reg(context));
@ -291,7 +291,7 @@ void WINAPI INT_Int2fHandler( CONTEXT *context )
/**********************************************************************
* do_int2f_16
*/
static void do_int2f_16( CONTEXT *context )
static void do_int2f_16( CONTEXT86 *context )
{
DWORD addr;
@ -451,7 +451,7 @@ static void MSCDEX_StoreMSF(DWORD frame, BYTE* val)
val[0] = frame - CDFRAMES_PERMIN * val[2] - CDFRAMES_PERSEC * val[1]; /* frames */
}
static void MSCDEX_Handler(CONTEXT* context)
static void MSCDEX_Handler(CONTEXT86* context)
{
int drive, count;
char* p;

View File

@ -21,7 +21,7 @@ typedef struct {
*
* Handler for int 33h (MS MOUSE).
*/
void WINAPI INT_Int33Handler( CONTEXT *context )
void WINAPI INT_Int33Handler( CONTEXT86 *context )
{
MOUSESYSTEM *sys = (MOUSESYSTEM *)DOSVM_GetSystemData(0x33);
@ -54,10 +54,10 @@ typedef struct {
WORD mask,but,x,y,mx,my;
} MCALLDATA;
static void MouseRelay(LPDOSTASK lpDosTask,PCONTEXT context,void *mdata)
static void MouseRelay(LPDOSTASK lpDosTask,CONTEXT86 *context,void *mdata)
{
MCALLDATA *data = (MCALLDATA *)mdata;
CONTEXT ctx = *context;
CONTEXT86 ctx = *context;
AX_reg(&ctx) = data->mask;
BX_reg(&ctx) = data->but;

View File

@ -14,7 +14,7 @@
*
* Handler for int 3d (FLOATING POINT EMULATION - STANDALONE FWAIT).
*/
void WINAPI INT_Int3dHandler(CONTEXT *context)
void WINAPI INT_Int3dHandler(CONTEXT86 *context)
{
switch(AH_reg(context))
{

View File

@ -11,7 +11,7 @@
* INT_Int41Handler
*
*/
void WINAPI INT_Int41Handler( CONTEXT *context )
void WINAPI INT_Int41Handler( CONTEXT86 *context )
{
if ( ISV86(context) )
{

View File

@ -9,7 +9,7 @@
* INT_Int4bHandler
*
*/
void WINAPI INT_Int4bHandler( CONTEXT *context )
void WINAPI INT_Int4bHandler( CONTEXT86 *context )
{
switch(AH_reg(context))
{

View File

@ -16,7 +16,7 @@ DEFAULT_DEBUG_CHANNEL(int)
*
* Also handler for interrupt 5c.
*/
void WINAPI NetBIOSCall16( CONTEXT *context )
void WINAPI NetBIOSCall16( CONTEXT86 *context )
{
BYTE* ptr;
ptr = (BYTE*) PTR_SEG_OFF_TO_LIN(ES_reg(context),BX_reg(context));

View File

@ -68,7 +68,7 @@ void INT_SetRMHandler( BYTE intnum, FARPROC16 handler )
*
* Return the interrupt vector for a given interrupt.
*/
FARPROC16 INT_CtxGetHandler( CONTEXT *context, BYTE intnum )
FARPROC16 INT_CtxGetHandler( CONTEXT86 *context, BYTE intnum )
{
if (ISV86(context))
return ((FARPROC16*)V86BASE(context))[intnum];
@ -82,7 +82,7 @@ FARPROC16 INT_CtxGetHandler( CONTEXT *context, BYTE intnum )
*
* Set the interrupt handler for a given interrupt.
*/
void INT_CtxSetHandler( CONTEXT *context, BYTE intnum, FARPROC16 handler )
void INT_CtxSetHandler( CONTEXT86 *context, BYTE intnum, FARPROC16 handler )
{
if (ISV86(context)) {
TRACE(int, "Set real mode interrupt vector %02x <- %04x:%04x\n",
@ -98,7 +98,7 @@ void INT_CtxSetHandler( CONTEXT *context, BYTE intnum, FARPROC16 handler )
*
* Handle real mode interrupts
*/
int INT_RealModeInterrupt( BYTE intnum, PCONTEXT context )
int INT_RealModeInterrupt( BYTE intnum, CONTEXT86 *context )
{
/* we should really map to if1632/wprocs.spec, but not all
* interrupt handlers are adapted to support real mode yet */

View File

@ -40,7 +40,7 @@ static WORD VXD_WinVersion(void)
/***********************************************************************
* VXD_VMM
*/
void VXD_VMM ( CONTEXT *context )
void VXD_VMM ( CONTEXT86 *context )
{
unsigned service = AX_reg(context);
@ -67,7 +67,7 @@ void VXD_VMM ( CONTEXT *context )
/***********************************************************************
* VXD_PageFile
*/
void WINAPI VXD_PageFile( CONTEXT *context )
void WINAPI VXD_PageFile( CONTEXT86 *context )
{
unsigned service = AX_reg(context);
@ -113,7 +113,7 @@ void WINAPI VXD_PageFile( CONTEXT *context )
/***********************************************************************
* VXD_Reboot
*/
void VXD_Reboot ( CONTEXT *context )
void VXD_Reboot ( CONTEXT86 *context )
{
unsigned service = AX_reg(context);
@ -134,7 +134,7 @@ void VXD_Reboot ( CONTEXT *context )
/***********************************************************************
* VXD_VDD
*/
void VXD_VDD ( CONTEXT *context )
void VXD_VDD ( CONTEXT86 *context )
{
unsigned service = AX_reg(context);
@ -155,7 +155,7 @@ void VXD_VDD ( CONTEXT *context )
/***********************************************************************
* VXD_VMD
*/
void VXD_VMD ( CONTEXT *context )
void VXD_VMD ( CONTEXT86 *context )
{
unsigned service = AX_reg(context);
@ -176,7 +176,7 @@ void VXD_VMD ( CONTEXT *context )
/***********************************************************************
* VXD_Shell
*/
void WINAPI VXD_Shell( CONTEXT *context )
void WINAPI VXD_Shell( CONTEXT86 *context )
{
unsigned service = DX_reg(context);
@ -270,7 +270,7 @@ void WINAPI VXD_Shell( CONTEXT *context )
/***********************************************************************
* VXD_Comm
*/
void WINAPI VXD_Comm( CONTEXT *context )
void WINAPI VXD_Comm( CONTEXT86 *context )
{
unsigned service = AX_reg(context);
@ -295,7 +295,7 @@ void WINAPI VXD_Comm( CONTEXT *context )
/***********************************************************************
* VXD_Timer
*/
void VXD_Timer( CONTEXT *context )
void VXD_Timer( CONTEXT86 *context )
{
unsigned service = AX_reg(context);
@ -331,7 +331,7 @@ void VXD_Timer( CONTEXT *context )
static DWORD System_Time = 0;
static WORD System_Time_Selector = 0;
static void System_Time_Tick( WORD timer ) { System_Time += 55; }
void VXD_TimerAPI ( CONTEXT *context )
void VXD_TimerAPI ( CONTEXT86 *context )
{
unsigned service = AX_reg(context);
@ -364,7 +364,7 @@ void VXD_TimerAPI ( CONTEXT *context )
/***********************************************************************
* VXD_ConfigMG
*/
void VXD_ConfigMG ( CONTEXT *context )
void VXD_ConfigMG ( CONTEXT86 *context )
{
unsigned service = AX_reg(context);
@ -385,7 +385,7 @@ void VXD_ConfigMG ( CONTEXT *context )
/***********************************************************************
* VXD_Enable
*/
void VXD_Enable ( CONTEXT *context )
void VXD_Enable ( CONTEXT86 *context )
{
unsigned service = AX_reg(context);
@ -406,7 +406,7 @@ void VXD_Enable ( CONTEXT *context )
/***********************************************************************
* VXD_APM
*/
void VXD_APM ( CONTEXT *context )
void VXD_APM ( CONTEXT86 *context )
{
unsigned service = AX_reg(context);
@ -479,7 +479,7 @@ void VXD_APM ( CONTEXT *context )
*
*/
void VXD_Win32s( CONTEXT *context )
void VXD_Win32s( CONTEXT86 *context )
{
switch (AX_reg(context))
{

View File

@ -39,7 +39,7 @@ static BYTE * XMS_Offset( MOVEOFS *ofs )
* XMS_Handler
*/
void WINAPI XMS_Handler( CONTEXT *context )
void WINAPI XMS_Handler( CONTEXT86 *context )
{
switch(AH_reg(context))
{

View File

@ -289,7 +289,7 @@ HANDLE WINAPI CreateThread( SECURITY_ATTRIBUTES *sa, DWORD stack,
{
int handle = -1;
TEB *teb = THREAD_Create( PROCESS_Current(), flags, stack, TRUE, sa, &handle );
if (!teb) return INVALID_HANDLE_VALUE;
if (!teb) return 0;
teb->flags |= TEBF_WIN32;
teb->entry_point = start;
teb->entry_arg = param;
@ -297,7 +297,7 @@ HANDLE WINAPI CreateThread( SECURITY_ATTRIBUTES *sa, DWORD stack,
if (SYSDEPS_SpawnThread( teb ) == -1)
{
CloseHandle( handle );
return INVALID_HANDLE_VALUE;
return 0;
}
if (id) *id = (DWORD)teb->tid;
return handle;
@ -504,6 +504,7 @@ BOOL WINAPI GetThreadContext(
HANDLE handle, /* [in] Handle to thread with context */
CONTEXT *context) /* [out] Address of context structure */
{
#ifdef __i386__
WORD cs, ds;
FIXME("returning dummy info\n" );
@ -517,6 +518,7 @@ BOOL WINAPI GetThreadContext(
context->SegGs = ds;
context->SegSs = ds;
context->SegFs = ds;
#endif
return TRUE;
}

View File

@ -174,7 +174,7 @@ static int debugging = 1;
#define STRUCTOFFSET(type,field) ((int)&((type *)0)->field)
/* Offset of register relative to the start of the CONTEXT struct */
#define CONTEXTOFFSET(reg) STRUCTOFFSET(CONTEXT,reg)
#define CONTEXTOFFSET(reg) STRUCTOFFSET(CONTEXT86,reg)
/* Offset of the stack pointer relative to %fs:(0) */
#define STACKOFFSET (STRUCTOFFSET(TEB,cur_stack))
@ -1502,52 +1502,52 @@ static void BuildContext16( FILE *outfile )
/* Store the registers */
fprintf( outfile, "\tmovl %%eax,%d(%%ebx)\n",
CONTEXTOFFSET(Eax) - sizeof(CONTEXT) );
CONTEXTOFFSET(Eax) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovl %%ecx,%d(%%ebx)\n",
CONTEXTOFFSET(Ecx) - sizeof(CONTEXT) );
CONTEXTOFFSET(Ecx) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovl %%edx,%d(%%ebx)\n",
CONTEXTOFFSET(Edx) - sizeof(CONTEXT) );
CONTEXTOFFSET(Edx) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovl %%esi,%d(%%ebx)\n",
CONTEXTOFFSET(Esi) - sizeof(CONTEXT) );
CONTEXTOFFSET(Esi) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovl %%edi,%d(%%ebx)\n",
CONTEXTOFFSET(Edi) - sizeof(CONTEXT) );
CONTEXTOFFSET(Edi) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovl -24(%%ebp),%%eax\n" ); /* Get %ebx from stack*/
fprintf( outfile, "\tmovl %%eax,%d(%%ebx)\n",
CONTEXTOFFSET(Ebx) - sizeof(CONTEXT) );
CONTEXTOFFSET(Ebx) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovzwl -10(%%ebp),%%eax\n" ); /* Get %ds from stack*/
fprintf( outfile, "\tmovl %%eax,%d(%%ebx)\n",
CONTEXTOFFSET(SegDs) - sizeof(CONTEXT) );
CONTEXTOFFSET(SegDs) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovzwl -6(%%ebp),%%eax\n" ); /* Get %es from stack*/
fprintf( outfile, "\tmovl %%eax,%d(%%ebx)\n",
CONTEXTOFFSET(SegEs) - sizeof(CONTEXT) );
CONTEXTOFFSET(SegEs) - sizeof(CONTEXT86) );
fprintf( outfile, "\tpushfl\n" );
fprintf( outfile, "\tpopl %d(%%ebx)\n",
CONTEXTOFFSET(EFlags) - sizeof(CONTEXT) );
CONTEXTOFFSET(EFlags) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovl -20(%%ebp),%%eax\n" ); /* Get %ebp from stack */
fprintf( outfile, "\tmovl %%eax,%d(%%ebx)\n",
CONTEXTOFFSET(Ebp) - sizeof(CONTEXT) );
CONTEXTOFFSET(Ebp) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovzwl 2(%%ebp),%%eax\n" ); /* Get %ip from stack */
fprintf( outfile, "\tmovl %%eax,%d(%%ebx)\n",
CONTEXTOFFSET(Eip) - sizeof(CONTEXT) );
CONTEXTOFFSET(Eip) - sizeof(CONTEXT86) );
fprintf( outfile, "\tleal 2(%%ebp),%%eax\n" ); /* Get initial %sp */
fprintf( outfile, "\tmovl %%eax,%d(%%ebx)\n",
CONTEXTOFFSET(Esp) - sizeof(CONTEXT) );
CONTEXTOFFSET(Esp) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovzwl 4(%%ebp),%%eax\n" ); /* Get %cs from stack */
fprintf( outfile, "\tmovl %%eax,%d(%%ebx)\n",
CONTEXTOFFSET(SegCs) - sizeof(CONTEXT) );
CONTEXTOFFSET(SegCs) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovzwl -14(%%ebp),%%eax\n" ); /* Get %fs from stack */
fprintf( outfile, "\tmovl %%eax,%d(%%ebx)\n",
CONTEXTOFFSET(SegFs) - sizeof(CONTEXT) );
CONTEXTOFFSET(SegFs) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovw %%gs,%%ax\n" );
fprintf( outfile, "\tmovl %%eax,%d(%%ebx)\n",
CONTEXTOFFSET(SegGs) - sizeof(CONTEXT) );
CONTEXTOFFSET(SegGs) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovw %%ss,%%ax\n" );
fprintf( outfile, "\tmovl %%eax,%d(%%ebx)\n",
CONTEXTOFFSET(SegSs) - sizeof(CONTEXT) );
CONTEXTOFFSET(SegSs) - sizeof(CONTEXT86) );
#if 0
fprintf( outfile, "\tfsave %d(%%ebx)\n",
CONTEXTOFFSET(FloatSave) - sizeof(CONTEXT) );
CONTEXTOFFSET(FloatSave) - sizeof(CONTEXT86) );
#endif
}
@ -1568,41 +1568,41 @@ static void RestoreContext16( FILE *outfile )
* from the 16-bit stack */
fprintf( outfile, "\tmovl %d(%%ebx),%%eax\n",
CONTEXTOFFSET(SegSs) - sizeof(CONTEXT) );
CONTEXTOFFSET(SegSs) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovw %%ax,%%ss\n" );
fprintf( outfile, "\tmovl %d(%%ebx),%%esp\n",
CONTEXTOFFSET(Esp) - sizeof(CONTEXT) );
CONTEXTOFFSET(Esp) - sizeof(CONTEXT86) );
fprintf( outfile, "\taddl $4,%%esp\n" ); /* Remove return address */
/* Restore the registers */
fprintf( outfile, "\tmovl %d(%%ebx),%%ecx\n",
CONTEXTOFFSET(Ecx) - sizeof(CONTEXT) );
CONTEXTOFFSET(Ecx) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovl %d(%%ebx),%%edx\n",
CONTEXTOFFSET(Edx) - sizeof(CONTEXT) );
CONTEXTOFFSET(Edx) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovl %d(%%ebx),%%esi\n",
CONTEXTOFFSET(Esi) - sizeof(CONTEXT) );
CONTEXTOFFSET(Esi) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovl %d(%%ebx),%%edi\n",
CONTEXTOFFSET(Edi) - sizeof(CONTEXT) );
CONTEXTOFFSET(Edi) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovl %d(%%ebx),%%ebp\n",
CONTEXTOFFSET(Ebp) - sizeof(CONTEXT) );
CONTEXTOFFSET(Ebp) - sizeof(CONTEXT86) );
fprintf( outfile, "\tpushw %d(%%ebx)\n", /* Push new cs */
CONTEXTOFFSET(SegCs) - sizeof(CONTEXT) );
CONTEXTOFFSET(SegCs) - sizeof(CONTEXT86) );
fprintf( outfile, "\tpushw %d(%%ebx)\n", /* Push new ip */
CONTEXTOFFSET(Eip) - sizeof(CONTEXT) );
CONTEXTOFFSET(Eip) - sizeof(CONTEXT86) );
fprintf( outfile, "\tpushl %d(%%ebx)\n", /* Push new ds */
CONTEXTOFFSET(SegDs) - sizeof(CONTEXT) );
CONTEXTOFFSET(SegDs) - sizeof(CONTEXT86) );
fprintf( outfile, "\tpushl %d(%%ebx)\n", /* Push new es */
CONTEXTOFFSET(SegEs) - sizeof(CONTEXT) );
CONTEXTOFFSET(SegEs) - sizeof(CONTEXT86) );
fprintf( outfile, "\tpushl %d(%%ebx)\n", /* Push new fs */
CONTEXTOFFSET(SegFs) - sizeof(CONTEXT) );
CONTEXTOFFSET(SegFs) - sizeof(CONTEXT86) );
fprintf( outfile, "\tpushl %d(%%ebx)\n",
CONTEXTOFFSET(EFlags) - sizeof(CONTEXT) );
CONTEXTOFFSET(EFlags) - sizeof(CONTEXT86) );
fprintf( outfile, "\tpopfl\n" );
fprintf( outfile, "\tmovl %d(%%ebx),%%eax\n",
CONTEXTOFFSET(Eax) - sizeof(CONTEXT) );
CONTEXTOFFSET(Eax) - sizeof(CONTEXT86) );
fprintf( outfile, "\tmovl %d(%%ebx),%%ebx\n",
CONTEXTOFFSET(Ebx) - sizeof(CONTEXT) );
CONTEXTOFFSET(Ebx) - sizeof(CONTEXT86) );
fprintf( outfile, "\tpopl %%fs\n" ); /* Set fs */
fprintf( outfile, "\tpopl %%es\n" ); /* Set es */
fprintf( outfile, "\tpopl %%ds\n" ); /* Set ds */
@ -1771,7 +1771,7 @@ static void BuildCallFrom16Func( FILE *outfile, char *profile )
fprintf( outfile, "\tpushl %%ds\n" );
fprintf( outfile, "\tpopl %%ss\n" );
fprintf( outfile, "\tleal -%d(%%ebp),%%esp\n",
reg_func ? sizeof(CONTEXT) : 4 * strlen(args) );
reg_func ? sizeof(CONTEXT86) : 4 * strlen(args) );
if (reg_func) /* Push the address of the context struct */
fprintf( outfile, "\tpushl %%esp\n" );
@ -1820,7 +1820,7 @@ static void BuildCallFrom16Func( FILE *outfile, char *profile )
/* Push again the address of the context struct in case */
/* it has been removed by an stdcall function */
fprintf( outfile, "\tleal -%d(%%ebp),%%esp\n",
sizeof(CONTEXT) + STRUCTOFFSET(STACK32FRAME,ebp) );
sizeof(CONTEXT86) + STRUCTOFFSET(STACK32FRAME,ebp) );
fprintf( outfile, "\tpushl %%esp\n" );
}
fprintf( outfile, "\tpushl %%eax\n" );
@ -1933,8 +1933,8 @@ static void BuildCallFrom16Func( FILE *outfile, char *profile )
* Prototypes for the CallTo16 functions:
* extern WINAPI WORD CallTo16_word_xxx( FARPROC16 func, args... );
* extern WINAPI LONG CallTo16_long_xxx( FARPROC16 func, args... );
* extern WINAPI void CallTo16_sreg_( const CONTEXT *context, int nb_args );
* extern WINAPI void CallTo16_lreg_( const CONTEXT *context, int nb_args );
* extern WINAPI void CallTo16_sreg_( const CONTEXT86 *context, int nb_args );
* extern WINAPI void CallTo16_lreg_( const CONTEXT86 *context, int nb_args );
*/
static void BuildCallTo16Func( FILE *outfile, char *profile )
{
@ -2585,8 +2585,8 @@ static void BuildCallTo32LargeStack( FILE *outfile )
* (ebp+4) ret addr to relay code
* (ebp+0) saved ebp
* (ebp-128) buffer area to allow stack frame manipulation
* (ebp-332) CONTEXT struct
* (ebp-336) CONTEXT *argument
* (ebp-332) CONTEXT86 struct
* (ebp-336) CONTEXT86 *argument
* .... other arguments copied from (ebp+12)
*
* The entry point routine is called with a CONTEXT* extra argument,
@ -2597,7 +2597,7 @@ static void BuildCallTo32LargeStack( FILE *outfile )
*/
static void BuildCallFrom32Regs( FILE *outfile )
{
static const int STACK_SPACE = 128 + sizeof(CONTEXT);
static const int STACK_SPACE = 128 + sizeof(CONTEXT86);
/* Function header */

View File

@ -717,9 +717,9 @@ struct win32apireq {
unsigned short ar_pad;
};
static void win32apieq_2_CONTEXT(struct win32apireq *pIn,CONTEXT *pCxt)
static void win32apieq_2_CONTEXT(struct win32apireq *pIn,CONTEXT86 *pCxt)
{
memset(pCxt,0,sizeof(CONTEXT));
memset(pCxt,0,sizeof(*pCxt));
pCxt->ContextFlags=CONTEXT_INTEGER|CONTEXT_CONTROL;
pCxt->Eax = pIn->ar_eax;
@ -737,7 +737,7 @@ static void win32apieq_2_CONTEXT(struct win32apireq *pIn,CONTEXT *pCxt)
/* FIXME: pIn->ar_pad ignored */
}
static void CONTEXT_2_win32apieq(CONTEXT *pCxt,struct win32apireq *pOut)
static void CONTEXT_2_win32apieq(CONTEXT86 *pCxt,struct win32apireq *pOut)
{
memset(pOut,0,sizeof(struct win32apireq));
@ -773,7 +773,7 @@ static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbI
{
case IFS_IOCTL_21:
case IFS_IOCTL_2F:{
CONTEXT cxt;
CONTEXT86 cxt;
struct win32apireq *pIn=(struct win32apireq *) lpvInBuffer;
struct win32apireq *pOut=(struct win32apireq *) lpvOutBuffer;
@ -822,9 +822,9 @@ static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbI
* DeviceIo_VWin32
*/
static void DIOCRegs_2_CONTEXT( DIOC_REGISTERS *pIn, CONTEXT *pCxt )
static void DIOCRegs_2_CONTEXT( DIOC_REGISTERS *pIn, CONTEXT86 *pCxt )
{
memset( pCxt, 0, sizeof(CONTEXT) );
memset( pCxt, 0, sizeof(*pCxt) );
/* Note: segment registers == 0 means that CTX_SEG_OFF_TO_LIN
will interpret 32-bit register contents as linear pointers */
@ -840,7 +840,7 @@ static void DIOCRegs_2_CONTEXT( DIOC_REGISTERS *pIn, CONTEXT *pCxt )
pCxt->EFlags = pIn->reg_Flags;
}
static void CONTEXT_2_DIOCRegs( CONTEXT *pCxt, DIOC_REGISTERS *pOut )
static void CONTEXT_2_DIOCRegs( CONTEXT86 *pCxt, DIOC_REGISTERS *pOut )
{
memset( pOut, 0, sizeof(DIOC_REGISTERS) );
@ -871,7 +871,7 @@ static BOOL DeviceIo_VWin32(DWORD dwIoControlCode,
case VWIN32_DIOC_DOS_INT25:
case VWIN32_DIOC_DOS_INT26:
{
CONTEXT cxt;
CONTEXT86 cxt;
DIOC_REGISTERS *pIn = (DIOC_REGISTERS *)lpvInBuffer;
DIOC_REGISTERS *pOut = (DIOC_REGISTERS *)lpvOutBuffer;

View File

@ -292,7 +292,8 @@ UINT WINAPI ThunkConnect32(
*/
void WINAPI REGS_FUNC(QT_Thunk)( CONTEXT *context )
{
CONTEXT context16;
#ifdef __i386__
CONTEXT86 context16;
DWORD argsize;
memcpy(&context16,context,sizeof(context16));
@ -310,6 +311,7 @@ void WINAPI REGS_FUNC(QT_Thunk)( CONTEXT *context )
EAX_reg(context) = Callbacks->CallRegisterShortProc( &context16, argsize );
EDX_reg(context) = HIWORD(EAX_reg(context));
EAX_reg(context) = LOWORD(EAX_reg(context));
#endif
}
@ -359,6 +361,7 @@ void WINAPI REGS_FUNC(QT_Thunk)( CONTEXT *context )
void WINAPI REGS_FUNC(FT_Prolog)( CONTEXT *context )
{
#ifdef __i386__
/* Build stack frame */
STACK32_PUSH(context, EBP_reg(context));
EBP_reg(context) = ESP_reg(context);
@ -376,6 +379,7 @@ void WINAPI REGS_FUNC(FT_Prolog)( CONTEXT *context )
*(DWORD *)(EBP_reg(context) - 48) = EAX_reg(context);
*(DWORD *)(EBP_reg(context) - 52) = EDX_reg(context);
#endif
}
/**********************************************************************
@ -401,10 +405,11 @@ void WINAPI REGS_FUNC(FT_Prolog)( CONTEXT *context )
void WINAPI REGS_FUNC(FT_Thunk)( CONTEXT *context )
{
#ifdef __i386__
DWORD mapESPrelative = *(DWORD *)(EBP_reg(context) - 20);
DWORD callTarget = *(DWORD *)(EBP_reg(context) - 52);
CONTEXT context16;
CONTEXT86 context16;
DWORD i, argsize;
LPBYTE newstack, oldstack;
@ -436,6 +441,7 @@ void WINAPI REGS_FUNC(FT_Thunk)( CONTEXT *context )
/* Copy modified buffers back to 32-bit stack */
memcpy( oldstack, newstack, argsize );
#endif
}
/**********************************************************************
@ -452,6 +458,7 @@ void WINAPI REGS_FUNC(FT_Thunk)( CONTEXT *context )
static void FT_Exit(CONTEXT *context, int nPopArgs)
{
#ifdef __i386__
/* Return value is in EBX */
EAX_reg(context) = EBX_reg(context);
@ -468,6 +475,7 @@ static void FT_Exit(CONTEXT *context, int nPopArgs)
EIP_reg(context) = STACK32_POP(context);
/* Remove arguments */
ESP_reg(context) += nPopArgs;
#endif
}
void WINAPI REGS_FUNC(FT_Exit0)(CONTEXT *context) { FT_Exit(context, 0); }
@ -593,7 +601,8 @@ DWORD WINAPI ThunkInitLS(
*/
void WINAPI REGS_FUNC(Common32ThkLS)( CONTEXT *context )
{
CONTEXT context16;
#ifdef __i386__
CONTEXT86 context16;
DWORD argsize;
memcpy(&context16,context,sizeof(context16));
@ -617,6 +626,7 @@ void WINAPI REGS_FUNC(Common32ThkLS)( CONTEXT *context )
/* Clean up caller's stack frame */
ESP_reg(context) += argsize;
#endif
}
/***********************************************************************
@ -648,7 +658,8 @@ void WINAPI REGS_FUNC(Common32ThkLS)( CONTEXT *context )
*/
void WINAPI REGS_FUNC(OT_32ThkLSF)( CONTEXT *context )
{
CONTEXT context16;
#ifdef __i386__
CONTEXT86 context16;
DWORD argsize;
memcpy(&context16,context,sizeof(context16));
@ -667,6 +678,7 @@ void WINAPI REGS_FUNC(OT_32ThkLSF)( CONTEXT *context )
memcpy( (LPBYTE)ESP_reg(context),
(LPBYTE)CURRENT_STACK16 - argsize, argsize );
#endif
}
/***********************************************************************
@ -753,6 +765,7 @@ LPVOID WINAPI ThunkInitLSF(
*/
void WINAPI REGS_FUNC(FT_PrologPrime)( CONTEXT *context )
{
#ifdef __i386__
DWORD targetTableOffset;
LPBYTE relayCode;
@ -767,6 +780,7 @@ void WINAPI REGS_FUNC(FT_PrologPrime)( CONTEXT *context )
/* Jump to the call stub just created */
EIP_reg(context) = (DWORD)relayCode;
#endif
}
/***********************************************************************
@ -782,6 +796,7 @@ void WINAPI REGS_FUNC(FT_PrologPrime)( CONTEXT *context )
*/
void WINAPI REGS_FUNC(QT_ThunkPrime)( CONTEXT *context )
{
#ifdef __i386__
DWORD targetTableOffset;
LPBYTE relayCode;
@ -796,6 +811,7 @@ void WINAPI REGS_FUNC(QT_ThunkPrime)( CONTEXT *context )
/* Jump to the call stub just created */
EIP_reg(context) = (DWORD)relayCode;
#endif
}
/***********************************************************************
@ -852,7 +868,7 @@ BOOL WINAPI SSOnBigStack()
*
* This must be a register routine as it has to preserve *all* registers.
*/
void WINAPI SSConfirmSmallStack( CONTEXT *context )
void WINAPI SSConfirmSmallStack( CONTEXT86 *context )
{
/* We are always on the small stack while in 16-bit code ... */
}
@ -923,6 +939,7 @@ DWORD WINAPIV SSCall(
*/
void WINAPI REGS_FUNC(W32S_BackTo32)( CONTEXT *context )
{
#ifdef __i386__
LPDWORD stack = (LPDWORD)ESP_reg( context );
FARPROC proc = (FARPROC)EIP_reg(context);
@ -930,6 +947,7 @@ void WINAPI REGS_FUNC(W32S_BackTo32)( CONTEXT *context )
stack[6], stack[7], stack[8], stack[9], stack[10] );
EIP_reg( context ) = STACK32_POP(context);
#endif
}
/**********************************************************************
@ -1000,7 +1018,7 @@ FreeSLCallback(
* GetTEBSelectorFS (KERNEL.475)
* Set the 16-bit %fs to the 32-bit %fs (current TEB selector)
*/
VOID WINAPI GetTEBSelectorFS16( CONTEXT *context )
VOID WINAPI GetTEBSelectorFS16( CONTEXT86 *context )
{
GET_FS( FS_reg(context) );
}
@ -1067,6 +1085,7 @@ HANDLE WINAPI WOWHandle32(
*/
void WINAPI REGS_FUNC(K32Thk1632Prolog)( CONTEXT *context )
{
#ifdef __i386__
LPBYTE code = (LPBYTE)EIP_reg(context) - 5;
/* Arrrgh! SYSTHUNK.DLL just has to re-implement another method
@ -1119,6 +1138,7 @@ void WINAPI REGS_FUNC(K32Thk1632Prolog)( CONTEXT *context )
}
SYSLEVEL_ReleaseWin16Lock();
#endif
}
/***********************************************************************
@ -1126,6 +1146,7 @@ void WINAPI REGS_FUNC(K32Thk1632Prolog)( CONTEXT *context )
*/
void WINAPI REGS_FUNC(K32Thk1632Epilog)( CONTEXT *context )
{
#ifdef __i386__
LPBYTE code = (LPBYTE)EIP_reg(context) - 13;
SYSLEVEL_RestoreWin16Lock();
@ -1153,6 +1174,7 @@ void WINAPI REGS_FUNC(K32Thk1632Epilog)( CONTEXT *context )
TRACE_(thunk)("after SYSTHUNK hack: EBP: %08lx ESP: %08lx cur_stack: %08lx\n",
EBP_reg(context), ESP_reg(context), NtCurrentTeb()->cur_stack);
}
#endif
}
/***********************************************************************

View File

@ -56,6 +56,7 @@ LPVOID WINAPI GetPK16SysVar(void)
*/
void WINAPI REGS_FUNC(CommonUnimpStub)( CONTEXT *context )
{
#ifdef __i386__
if (EAX_reg(context))
MESSAGE( "*** Unimplemented Win32 API: %s\n", (LPSTR)EAX_reg(context) );
@ -69,6 +70,7 @@ void WINAPI REGS_FUNC(CommonUnimpStub)( CONTEXT *context )
}
ESP_reg(context) += (ECX_reg(context) & 0x0f) * 4;
#endif
}
/**********************************************************************

View File

@ -2291,7 +2291,7 @@ BOOL16 WINAPI IsWindow16( HWND16 hwnd )
return IsWindow( hwnd );
}
void WINAPI WIN16_IsWindow16( CONTEXT *context )
void WINAPI WIN16_IsWindow16( CONTEXT86 *context )
{
WORD *stack = PTR_SEG_OFF_TO_LIN(SS_reg(context), SP_reg(context));
HWND16 hwnd = (HWND16)stack[2];