From 5bd3d51ca0b00a03ed37bed2fc2397ef2a298696 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Thu, 18 Dec 2008 20:59:38 +0100 Subject: [PATCH] kernel32: Make __wine_emulate_instruction CDECL and i386 only --- 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 73edf7b756d..2afaefcbb33 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 32e352361c5..1007eed0520 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 227e393d207..1e33a2937d5 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; } -- 2.11.4.GIT