mirror of
https://github.com/reactos/reactos
synced 2025-10-06 00:12:51 +02:00
[VCRUNTIME] Implement _seh_longjmp_unwind
This commit is contained in:
@@ -21,7 +21,7 @@ list(APPEND SOURCE
|
||||
add_library(msvcrt20 MODULE ${SOURCE})
|
||||
set_module_type(msvcrt20 win32dll ENTRYPOINT DllMain 12)
|
||||
add_dependencies(msvcrt20 psdk)
|
||||
target_link_libraries(msvcrt20 crt wine ${PSEH_LIB})
|
||||
target_link_libraries(msvcrt20 crt vcruntime wine ${PSEH_LIB})
|
||||
|
||||
if(MSVC)
|
||||
# export of deleting destructor "name"
|
||||
|
@@ -21,7 +21,7 @@ list(APPEND SOURCE
|
||||
add_library(msvcrt40 MODULE ${SOURCE})
|
||||
set_module_type(msvcrt40 win32dll ENTRYPOINT DllMain 12)
|
||||
add_dependencies(msvcrt40 psdk)
|
||||
target_link_libraries(msvcrt40 crt wine ${PSEH_LIB})
|
||||
target_link_libraries(msvcrt40 crt vcruntime wine ${PSEH_LIB})
|
||||
|
||||
if(MSVC)
|
||||
# export of deleting destructor "name"
|
||||
|
@@ -1133,6 +1133,7 @@ void CDECL MSVCRT_longjmp(_JUMP_BUFFER *jmp, int retval)
|
||||
__wine_longjmp( (__wine_jmp_buf *)jmp, retval );
|
||||
}
|
||||
|
||||
#ifndef __REACTOS__
|
||||
/*********************************************************************
|
||||
* _seh_longjmp_unwind (MSVCRT.@)
|
||||
*/
|
||||
@@ -1140,6 +1141,7 @@ void __stdcall _seh_longjmp_unwind(_JUMP_BUFFER *jmp)
|
||||
{
|
||||
msvcrt_local_unwind2( (MSVCRT_EXCEPTION_FRAME *)jmp->Registration, jmp->TryLevel, (void *)jmp->Ebp );
|
||||
}
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
* _seh_longjmp_unwind4 (MSVCRT.@)
|
||||
|
@@ -55,6 +55,7 @@ if(${ARCH} STREQUAL "i386")
|
||||
)
|
||||
list(APPEND VCRT_SETJMP_ASM_SOURCES
|
||||
i386/__longjmp_nounwind.s
|
||||
i386/_seh_longjmp_unwind.s
|
||||
i386/_setjmp.s
|
||||
i386/_setjmp3.s
|
||||
)
|
||||
|
38
sdk/lib/vcruntime/i386/_seh_longjmp_unwind.s
Normal file
38
sdk/lib/vcruntime/i386/_seh_longjmp_unwind.s
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* PROJECT: ReactOS vcruntime library
|
||||
* LICENSE: MIT (https://spdx.org/licenses/MIT)
|
||||
* PURPOSE: Implementation of _seh_longjmp_unwind sor x86
|
||||
* COPYRIGHT: Copyright 2025 Timo Kreuzer <timo.kreuzer@reactos.org>
|
||||
*/
|
||||
|
||||
#include <asm.inc>
|
||||
#include <ks386.inc>
|
||||
|
||||
EXTERN __local_unwind2:PROC
|
||||
|
||||
.code
|
||||
|
||||
//
|
||||
// void __stdcall _seh_longjmp_unwind(_JUMP_BUFFER* _Buf);
|
||||
//
|
||||
PUBLIC __seh_longjmp_unwind@4
|
||||
__seh_longjmp_unwind@4:
|
||||
|
||||
// Save ebp
|
||||
push ebp
|
||||
|
||||
// Load the jump buffer address into eax
|
||||
mov eax, [esp + 8]
|
||||
|
||||
// Call _local_unwind2 to run the termination handlers
|
||||
push dword ptr [eax + JbTryLevel] // _Buf->TryLevel
|
||||
push dword ptr [eax + JbRegistration] // _Buf->Registration
|
||||
mov ebp, [eax + JbEbp] // _Buf->Ebp
|
||||
call __local_unwind2
|
||||
|
||||
// Clean up the stack and restore ebp
|
||||
add esp, 8
|
||||
pop ebp
|
||||
ret 4
|
||||
|
||||
END
|
Reference in New Issue
Block a user