This probably deserves a test?
What happens to TIB exception handlers when the context is to be restored with RtlRestoreContext()? Is application supposed to pop them itself if using this function?
On 8/19/22 01:46, Jakub Staroń wrote:
From: Jakub Staroń kubastaron@hotmail.com
dlls/kernel32/kernel32.spec | 2 +- dlls/ntdll/ntdll.spec | 2 +- dlls/ntdll/signal_i386.c | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 556156686f2..a5fa757da9f 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1313,7 +1313,7 @@ @ stdcall RtlMoveMemory(ptr ptr long) NTDLL.RtlMoveMemory @ stdcall RtlPcToFileHeader(ptr ptr) NTDLL.RtlPcToFileHeader @ stdcall -arch=arm,arm64,x86_64 -norelay RtlRaiseException(ptr) NTDLL.RtlRaiseException -@ cdecl -arch=arm,arm64,x86_64 -import RtlRestoreContext(ptr ptr) +@ cdecl -import RtlRestoreContext(ptr ptr) @ stdcall RtlUnwind(ptr ptr ptr long) NTDLL.RtlUnwind @ stdcall -arch=arm,arm64,x86_64 RtlUnwindEx(long long ptr long ptr) NTDLL.RtlUnwindEx @ stdcall -arch=arm,arm64,x86_64 RtlVirtualUnwind(long long long ptr ptr ptr ptr ptr) NTDLL.RtlVirtualUnwind diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 299d2195800..c294490d544 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -952,7 +952,7 @@ @ stdcall RtlRemoveVectoredContinueHandler(ptr) @ stdcall RtlRemoveVectoredExceptionHandler(ptr) @ stdcall RtlResetRtlTranslations(ptr) -@ cdecl -arch=arm,arm64,x86_64 RtlRestoreContext(ptr ptr) +@ cdecl RtlRestoreContext(ptr ptr) @ stdcall RtlRestoreLastWin32Error(long) RtlSetLastWin32Error @ stub RtlRevertMemoryStream @ stub RtlRunDecodeUnicodeString diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index ae065f8c37b..8978e33e2d8 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -359,6 +359,16 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 4, __ASM_CFI(".cfi_adjust_cfa_offset -4\n\t") "ret $4" )
+/*******************************************************************
RtlRestoreContext (NTDLL.@)
- */
+void CDECL RtlRestoreContext( CONTEXT *context, EXCEPTION_RECORD *rec ) +{
- FIXME("(%p, %p): semi-stub\n", context, rec);
- TRACE( "returning to %p stack %p\n", (void *)context->Eip, (void *)context->Esp );
- NtContinue( context, FALSE );
+}
/*******************************************************************
RtlUnwind (NTDLL.@)