[PATCH] kernel32: Make __wine_emulate_instruction CDECL and i386 only

Maarten Lankhorst m.b.lankhorst at gmail.com
Thu Dec 18 13:59:38 CST 2008


---
 dlls/kernel32/instr.c        |    6 +++++-
 dlls/kernel32/kernel32.spec  |    2 +-
 dlls/ntoskrnl.exe/ntoskrnl.c |    2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/instr.c b/dlls/kernel32/instr.c
index 73edf7b..2afaefc 100644
--- a/dlls/kernel32/instr.c
+++ b/dlls/kernel32/instr.c
@@ -427,13 +427,14 @@ static void INSTR_outport( WORD port, int size, DWORD val, CONTEXT86 *context )
 }
 
 
+#ifdef __i386__
 /***********************************************************************
  *           __wine_emulate_instruction
  *
  * Emulate a privileged instruction.
  * Returns exception continuation status.
  */
-DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
+DWORD CDECL __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
 {
     int prefix, segprefix, prefixlen, len, repX, long_op, long_addr;
     BYTE *instr;
@@ -868,6 +869,7 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
     }
     return ExceptionContinueSearch;  /* Unable to emulate it */
 }
+#endif
 
 
 /***********************************************************************
@@ -878,6 +880,7 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
  */
 LONG CALLBACK INSTR_vectored_handler( EXCEPTION_POINTERS *ptrs )
 {
+#ifdef __i386__
     EXCEPTION_RECORD *record = ptrs->ExceptionRecord;
     CONTEXT86 *context = ptrs->ContextRecord;
 
@@ -888,6 +891,7 @@ LONG CALLBACK INSTR_vectored_handler( EXCEPTION_POINTERS *ptrs )
         if (__wine_emulate_instruction( record, context ) == ExceptionContinueExecution)
             return EXCEPTION_CONTINUE_EXECUTION;
     }
+#endif
     return EXCEPTION_CONTINUE_SEARCH;
 }
 
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 32e3523..1007eed 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -1254,7 +1254,7 @@
 @ cdecl __wine_dll_register_16(ptr str)
 @ cdecl __wine_dll_unregister_16(ptr)
 @ varargs -private __wine_call_from_16_regs()
-@ cdecl __wine_emulate_instruction(ptr ptr)
+@ cdecl -i386 __wine_emulate_instruction(ptr ptr)
 
 # Unix files
 @ cdecl wine_get_unix_file_name(wstr)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 227e393..1e33a29 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -116,6 +116,7 @@ static HANDLE get_device_manager(void)
 /* exception handler for emulation of privileged instructions */
 static LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs )
 {
+#ifdef __i386__
     extern DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context );
 
     EXCEPTION_RECORD *record = ptrs->ExceptionRecord;
@@ -127,6 +128,7 @@ static LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs )
         if (__wine_emulate_instruction( record, context ) == ExceptionContinueExecution)
             return EXCEPTION_CONTINUE_EXECUTION;
     }
+#endif
     return EXCEPTION_CONTINUE_SEARCH;
 }
 
-- 
1.5.6.5


--------------000808090109070109010707--



More information about the wine-patches mailing list