Commit dc63fbf9 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Use RtlCaptureContext also in RtlUnwind.

parent 2bb668b1
...@@ -10,6 +10,6 @@ ...@@ -10,6 +10,6 @@
@ stdcall RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader @ stdcall RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader
@ stdcall -norelay RtlRaiseException(ptr) ntdll.RtlRaiseException @ stdcall -norelay RtlRaiseException(ptr) ntdll.RtlRaiseException
@ stdcall -arch=x86_64 RtlRestoreContext(ptr ptr) ntdll.RtlRestoreContext @ stdcall -arch=x86_64 RtlRestoreContext(ptr ptr) ntdll.RtlRestoreContext
@ stdcall -register RtlUnwind(ptr ptr ptr ptr) ntdll.RtlUnwind @ stdcall -norelay RtlUnwind(ptr ptr ptr ptr) ntdll.RtlUnwind
@ stdcall -arch=x86_64 RtlUnwindEx(ptr ptr ptr ptr ptr ptr) ntdll.RtlUnwindEx @ stdcall -arch=x86_64 RtlUnwindEx(ptr ptr ptr ptr ptr ptr) ntdll.RtlUnwindEx
@ stdcall -arch=x86_64 RtlVirtualUnwind(long long long ptr ptr ptr ptr ptr) ntdll.RtlVirtualUnwind @ stdcall -arch=x86_64 RtlVirtualUnwind(long long long ptr ptr ptr ptr ptr) ntdll.RtlVirtualUnwind
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
@ stdcall RtlCompareMemory(ptr ptr long) ntdll.RtlCompareMemory @ stdcall RtlCompareMemory(ptr ptr long) ntdll.RtlCompareMemory
@ stdcall RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader @ stdcall RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader
@ stdcall -norelay RtlRaiseException(ptr) ntdll.RtlRaiseException @ stdcall -norelay RtlRaiseException(ptr) ntdll.RtlRaiseException
@ stdcall -register RtlUnwind(ptr ptr ptr ptr) ntdll.RtlUnwind @ stdcall -norelay RtlUnwind(ptr ptr ptr ptr) ntdll.RtlUnwind
...@@ -940,7 +940,7 @@ ...@@ -940,7 +940,7 @@
# @ stub RtlUnlockBootStatusData # @ stub RtlUnlockBootStatusData
@ stdcall RtlUnlockHeap(long) @ stdcall RtlUnlockHeap(long)
# @ stub RtlUnlockMemoryStreamRegion # @ stub RtlUnlockMemoryStreamRegion
@ stdcall -register RtlUnwind(ptr ptr ptr ptr) @ stdcall -norelay RtlUnwind(ptr ptr ptr ptr)
@ stdcall -arch=x86_64 RtlUnwindEx(ptr ptr ptr ptr ptr ptr) @ stdcall -arch=x86_64 RtlUnwindEx(ptr ptr ptr ptr ptr ptr)
@ stdcall RtlUpcaseUnicodeChar(long) @ stdcall RtlUpcaseUnicodeChar(long)
@ stdcall RtlUpcaseUnicodeString(ptr ptr long) @ stdcall RtlUpcaseUnicodeString(ptr ptr long)
......
...@@ -2667,6 +2667,11 @@ void WINAPI __regs_RtlUnwind( EXCEPTION_REGISTRATION_RECORD* pEndFrame, PVOID ta ...@@ -2667,6 +2667,11 @@ void WINAPI __regs_RtlUnwind( EXCEPTION_REGISTRATION_RECORD* pEndFrame, PVOID ta
pRecord->ExceptionFlags |= EH_UNWINDING | (pEndFrame ? 0 : EH_EXIT_UNWIND); pRecord->ExceptionFlags |= EH_UNWINDING | (pEndFrame ? 0 : EH_EXIT_UNWIND);
TRACE( "code=%x flags=%x\n", pRecord->ExceptionCode, pRecord->ExceptionFlags ); TRACE( "code=%x flags=%x\n", pRecord->ExceptionCode, pRecord->ExceptionFlags );
TRACE( "eax=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x\n",
context->Eax, context->Ebx, context->Ecx, context->Edx, context->Esi, context->Edi );
TRACE( "ebp=%08x esp=%08x eip=%08x cs=%04x ds=%04x fs=%04x gs=%04x flags=%08x\n",
context->Ebp, context->Esp, context->Eip, LOWORD(context->SegCs), LOWORD(context->SegDs),
LOWORD(context->SegFs), LOWORD(context->SegGs), context->EFlags );
/* get chain of exception frames */ /* get chain of exception frames */
frame = NtCurrentTeb()->Tib.ExceptionList; frame = NtCurrentTeb()->Tib.ExceptionList;
...@@ -2697,8 +2702,30 @@ void WINAPI __regs_RtlUnwind( EXCEPTION_REGISTRATION_RECORD* pEndFrame, PVOID ta ...@@ -2697,8 +2702,30 @@ void WINAPI __regs_RtlUnwind( EXCEPTION_REGISTRATION_RECORD* pEndFrame, PVOID ta
} }
frame = __wine_pop_frame( frame ); frame = __wine_pop_frame( frame );
} }
NtSetContextThread( GetCurrentThread(), context );
} }
DEFINE_REGS_ENTRYPOINT( RtlUnwind, 4 ) __ASM_STDCALL_FUNC( RtlUnwind, 16,
"pushl %ebp\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
__ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
"movl %esp,%ebp\n\t"
__ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
"leal -(0x2cc+8)(%esp),%esp\n\t" /* sizeof(CONTEXT) + alignment */
"pushl %esp\n\t" /* context */
"call " __ASM_NAME("RtlCaptureContext") __ASM_STDCALL(4) "\n\t"
"leal 24(%ebp),%eax\n\t"
"movl %eax,0xc4(%esp)\n\t" /* context->Esp */
"pushl %esp\n\t"
"pushl 20(%ebp)\n\t"
"pushl 16(%ebp)\n\t"
"pushl 12(%ebp)\n\t"
"pushl 8(%ebp)\n\t"
"call " __ASM_NAME("__regs_RtlUnwind") __ASM_STDCALL(20) "\n\t"
"leave\n\t"
__ASM_CFI(".cfi_def_cfa %esp,4\n\t")
__ASM_CFI(".cfi_same_value %ebp\n\t")
"ret $16" ) /* actually never returns */
/******************************************************************* /*******************************************************************
......
...@@ -1185,7 +1185,7 @@ ...@@ -1185,7 +1185,7 @@
@ stdcall RtlUnicodeToMultiByteSize(ptr ptr long) ntdll.RtlUnicodeToMultiByteSize @ stdcall RtlUnicodeToMultiByteSize(ptr ptr long) ntdll.RtlUnicodeToMultiByteSize
@ stdcall RtlUnicodeToOemN(ptr long ptr ptr long) ntdll.RtlUnicodeToOemN @ stdcall RtlUnicodeToOemN(ptr long ptr ptr long) ntdll.RtlUnicodeToOemN
@ stub RtlUnlockBootStatusData @ stub RtlUnlockBootStatusData
@ stdcall -register RtlUnwind(ptr ptr ptr ptr) ntdll.RtlUnwind @ stdcall -norelay RtlUnwind(ptr ptr ptr ptr) ntdll.RtlUnwind
@ stdcall -arch=x86_64 RtlUnwindEx(ptr ptr ptr ptr ptr ptr) ntdll.RtlUnwindEx @ stdcall -arch=x86_64 RtlUnwindEx(ptr ptr ptr ptr ptr ptr) ntdll.RtlUnwindEx
@ stdcall RtlUpcaseUnicodeChar(long) ntdll.RtlUpcaseUnicodeChar @ stdcall RtlUpcaseUnicodeChar(long) ntdll.RtlUpcaseUnicodeChar
@ stdcall RtlUpcaseUnicodeString(ptr ptr long) ntdll.RtlUpcaseUnicodeString @ stdcall RtlUpcaseUnicodeString(ptr ptr long) ntdll.RtlUpcaseUnicodeString
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment