ntdll: Call NtRaiseException directly from RtlRaiseException on i386.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Alexandre Julliard 2017-07-20 13:35:53 +02:00
parent 1522280e68
commit a75e3f734d
6 changed files with 31 additions and 15 deletions

View File

@ -8,7 +8,7 @@
@ cdecl -arch=x86_64 RtlInstallFunctionTableCallback(long long long ptr ptr wstr) ntdll.RtlInstallFunctionTableCallback
@ stdcall -arch=arm,x86_64 RtlLookupFunctionEntry(long ptr ptr) ntdll.RtlLookupFunctionEntry
@ stdcall RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader
@ stdcall -register RtlRaiseException(ptr) ntdll.RtlRaiseException
@ stdcall -norelay RtlRaiseException(ptr) ntdll.RtlRaiseException
@ stdcall -arch=x86_64 RtlRestoreContext(ptr ptr) ntdll.RtlRestoreContext
@ stdcall -register RtlUnwind(ptr ptr ptr ptr) ntdll.RtlUnwind
@ stdcall -arch=x86_64 RtlUnwindEx(ptr ptr ptr ptr ptr ptr) ntdll.RtlUnwindEx

View File

@ -2,5 +2,5 @@
@ stdcall RtlCaptureStackBackTrace(long long ptr ptr) ntdll.RtlCaptureStackBackTrace
@ stdcall RtlCompareMemory(ptr ptr long) ntdll.RtlCompareMemory
@ stdcall RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader
@ stdcall -register RtlRaiseException(ptr) ntdll.RtlRaiseException
@ stdcall -norelay RtlRaiseException(ptr) ntdll.RtlRaiseException
@ stdcall -register RtlUnwind(ptr ptr ptr ptr) ntdll.RtlUnwind

View File

@ -1285,7 +1285,7 @@
@ stdcall RestoreLastError(long) ntdll.RtlRestoreLastWin32Error
@ stdcall ResumeThread(long)
@ cdecl -arch=arm,x86_64 RtlAddFunctionTable(ptr long long) ntdll.RtlAddFunctionTable
@ stdcall -register RtlCaptureContext(ptr) ntdll.RtlCaptureContext
@ stdcall -norelay RtlCaptureContext(ptr) ntdll.RtlCaptureContext
@ stdcall RtlCaptureStackBackTrace(long long ptr ptr) ntdll.RtlCaptureStackBackTrace
@ stdcall -arch=x86_64 RtlCompareMemory(ptr ptr long) ntdll.RtlCompareMemory
@ stdcall -arch=x86_64 RtlCopyMemory(ptr ptr long) ntdll.RtlCopyMemory
@ -1295,7 +1295,7 @@
@ stdcall -arch=arm,x86_64 RtlLookupFunctionEntry(long ptr ptr) ntdll.RtlLookupFunctionEntry
@ stdcall RtlMoveMemory(ptr ptr long) ntdll.RtlMoveMemory
@ stdcall -arch=x86_64,arm RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader
@ stdcall -arch=arm -register RtlRaiseException(ptr) ntdll.RtlRaiseException
@ stdcall -arch=arm -norelay RtlRaiseException(ptr) ntdll.RtlRaiseException
@ stdcall -arch=x86_64 RtlRestoreContext(ptr ptr) ntdll.RtlRestoreContext
@ stdcall RtlUnwind(ptr ptr ptr long) ntdll.RtlUnwind
@ stdcall -arch=x86_64 RtlUnwindEx(long long ptr long ptr) ntdll.RtlUnwindEx

View File

@ -824,7 +824,7 @@
@ stdcall RtlQueryUnbiasedInterruptTime(ptr)
@ stub RtlQueueApcWow64Thread
@ stdcall RtlQueueWorkItem(ptr ptr long)
@ stdcall -register RtlRaiseException(ptr)
@ stdcall -norelay RtlRaiseException(ptr)
@ stdcall RtlRaiseStatus(long)
@ stdcall RtlRandom(ptr)
@ stub RtlRandomEx

View File

@ -2708,15 +2708,31 @@ NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL
/***********************************************************************
* RtlRaiseException (NTDLL.@)
*/
void WINAPI __regs_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context )
{
NTSTATUS status;
rec->ExceptionAddress = (void *)context->Eip;
status = raise_exception( rec, context, TRUE );
if (status != STATUS_SUCCESS) raise_status( status, rec );
}
DEFINE_REGS_ENTRYPOINT( RtlRaiseException, 1 )
__ASM_STDCALL_FUNC( RtlRaiseException, 4,
"leal -0x2cc(%esp),%esp\n\t" /* sizeof(CONTEXT) */
__ASM_CFI(".cfi_adjust_cfa_offset 0x2cc\n\t")
"pushl %esp\n\t" /* context */
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"call " __ASM_NAME("RtlCaptureContext") __ASM_STDCALL(4) "\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset -4\n\t")
"movl 0x2cc(%esp),%eax\n\t" /* return address */
"movl 0x2d0(%esp),%ecx\n\t" /* rec */
"movl %eax,0xb8(%esp)\n\t" /* context->Eip */
"movl %eax,12(%ecx)\n\t" /* rec->ExceptionAddress */
"leal 0x2d4(%esp),%eax\n\t"
"movl %eax,0xc4(%esp)\n\t" /* context->Esp */
"movl %esp,%eax\n\t"
"pushl $1\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"pushl %eax\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"pushl %ecx\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"call " __ASM_NAME("NtRaiseException") __ASM_STDCALL(12) "\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset -12\n\t")
"pushl %eax\n\t"
"call " __ASM_NAME("RtlRaiseStatus") __ASM_STDCALL(4) "\n\t"
"ret $4" ) /* actually never returns */
/*************************************************************************

View File

@ -1134,7 +1134,7 @@
@ stdcall RtlQueryAtomInAtomTable(ptr long ptr ptr ptr ptr) ntdll.RtlQueryAtomInAtomTable
@ stdcall RtlQueryRegistryValues(long ptr ptr ptr ptr) ntdll.RtlQueryRegistryValues
@ stdcall RtlQueryTimeZoneInformation(ptr) ntdll.RtlQueryTimeZoneInformation
@ stdcall -register RtlRaiseException(ptr) ntdll.RtlRaiseException
@ stdcall -norelay RtlRaiseException(ptr) ntdll.RtlRaiseException
@ stdcall RtlRandom(ptr) ntdll.RtlRandom
@ stub RtlRandomEx
@ stub RtlRealPredecessor