Changed CONTEXT into CONTEXT86 everywhere we really want an i386
context.
Added #ifdef __i386__ around accesses to 386 registers in the generic
CONTEXT structure.
diff --git a/loader/ne/module.c b/loader/ne/module.c
index 04c7d19..827251a 100644
--- a/loader/ne/module.c
+++ b/loader/ne/module.c
@@ -1568,7 +1568,9 @@
*/
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(MapHInstSL)( CONTEXT *context )
{
+#ifdef __i386__
EAX_reg(context) = MapHModuleSL(EAX_reg(context));
+#endif
}
/***************************************************************************
@@ -1584,8 +1588,10 @@
*/
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(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));
}
diff --git a/loader/ne/segment.c b/loader/ne/segment.c
index c6e5d72..9d57323 100644
--- a/loader/ne/segment.c
+++ b/loader/ne/segment.c
@@ -623,7 +623,7 @@
{
SEGTABLEENTRY *pSegTable;
WORD hInst, ds, heap;
- CONTEXT context;
+ CONTEXT86 context;
pSegTable = NE_SEG_TABLE( pModule );
@@ -678,7 +678,7 @@
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;