mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 04:00:56 +00:00
ntdll: Use .seh handler instead of __TRY in RtlUserThreadStart() on x64.
This commit is contained in:
parent
e5536fa0de
commit
c22aa54e99
|
@ -285,7 +285,41 @@ void DECLSPEC_HIDDEN call_thread_func( PRTL_THREAD_START_ROUTINE entry, void *ar
|
|||
__ENDTRY
|
||||
}
|
||||
|
||||
#else /* __i386__ */
|
||||
#elif /* __i386__ */ defined(__x86_64__) && defined(__ASM_SEH_SUPPORTED)
|
||||
EXCEPTION_DISPOSITION WINAPI call_thread_func_handler( EXCEPTION_RECORD *rec, ULONG64 frame,
|
||||
CONTEXT *context, DISPATCHER_CONTEXT *dispatch )
|
||||
{
|
||||
EXCEPTION_POINTERS ep = { rec, context };
|
||||
|
||||
WARN( "Unhandled exception, calling filter.\n" );
|
||||
|
||||
switch (call_unhandled_exception_filter( &ep ))
|
||||
{
|
||||
case EXCEPTION_CONTINUE_SEARCH:
|
||||
return ExceptionContinueSearch;
|
||||
case EXCEPTION_CONTINUE_EXECUTION:
|
||||
return ExceptionContinueExecution;
|
||||
case EXCEPTION_EXECUTE_HANDLER:
|
||||
break;
|
||||
}
|
||||
NtTerminateProcess( GetCurrentProcess(), rec->ExceptionCode );
|
||||
return ExceptionContinueExecution;
|
||||
}
|
||||
|
||||
extern void WINAPI RtlUserThreadStart( PRTL_THREAD_START_ROUTINE entry, void *arg );
|
||||
__ASM_GLOBAL_FUNC( RtlUserThreadStart,
|
||||
"subq $0x28,%rsp\n\t"
|
||||
".seh_stackalloc 0x28\n\t"
|
||||
".seh_endprologue\n\t"
|
||||
"movq %rdx,%r8\n\t"
|
||||
"movq %rcx,%rdx\n\t"
|
||||
"xorq %rcx,%rcx\n\t"
|
||||
"movq " __ASM_NAME( "pBaseThreadInitThunk" ) "(%rip),%r9\n\t"
|
||||
"call *%r9\n\t"
|
||||
"int3\n\t"
|
||||
".seh_handler call_thread_func_handler, @except\n\t" )
|
||||
|
||||
#else /* defined(__x86_64__) && defined(__ASM_SEH_SUPPORTED) */
|
||||
|
||||
void WINAPI RtlUserThreadStart( PRTL_THREAD_START_ROUTINE entry, void *arg )
|
||||
{
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
# define __ASM_SEH(str)
|
||||
# else
|
||||
# define __ASM_SEH(str) str
|
||||
# define __ASM_SEH_SUPPORTED
|
||||
# endif
|
||||
#else
|
||||
# define __ASM_SEH(str)
|
||||
|
|
Loading…
Reference in a new issue