mirror of
https://github.com/reactos/reactos.git
synced 2025-06-24 23:59:43 +00:00
[CRT]
Implement call_finally_block, call_filter and call_unwind_func for MSVC svn path=/branches/cmake-bringup/; revision=50583
This commit is contained in:
parent
f22ed7dc10
commit
84a13923a5
1 changed files with 51 additions and 0 deletions
|
@ -96,6 +96,57 @@ static inline int call_unwind_func( int (*func)(void), void *ebp )
|
||||||
: "ecx", "edx", "memory" );
|
: "ecx", "edx", "memory" );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable:4731) // Don't complain about changing ebp
|
||||||
|
void __inline call_finally_block( void *code_block, void *base_ptr )
|
||||||
|
{
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
mov eax, code_block
|
||||||
|
mov ebp, base_ptr
|
||||||
|
call [eax]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int __inline call_filter( int (*func)(PEXCEPTION_POINTERS), void *arg, void *_ebp )
|
||||||
|
{
|
||||||
|
int _ret;
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
push ebp
|
||||||
|
mov eax, arg
|
||||||
|
push eax
|
||||||
|
mov ebp, _ebp
|
||||||
|
mov eax, func
|
||||||
|
call [eax]
|
||||||
|
mov _ret, eax
|
||||||
|
pop ebp
|
||||||
|
pop ebp
|
||||||
|
}
|
||||||
|
return _ret;
|
||||||
|
}
|
||||||
|
int __inline call_unwind_func( int (*func)(void), void *_ebp )
|
||||||
|
{
|
||||||
|
int _ret;
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
push ebp
|
||||||
|
push ebx
|
||||||
|
push esi
|
||||||
|
push edi
|
||||||
|
mov ebp, _ebp
|
||||||
|
call dword ptr [func]
|
||||||
|
mov _ret, eax
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
pop ebp
|
||||||
|
}
|
||||||
|
return _ret;
|
||||||
|
}
|
||||||
|
#pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static DWORD MSVCRT_nested_handler(PEXCEPTION_RECORD rec,
|
static DWORD MSVCRT_nested_handler(PEXCEPTION_RECORD rec,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue