2001-01-11 00:59:25 +01:00
|
|
|
/*
|
|
|
|
* msvcrt.dll exception handling
|
|
|
|
*
|
|
|
|
* Copyright 2000 Jon Griffiths
|
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
* NOTES:
|
|
|
|
*
|
2001-01-11 00:59:25 +01:00
|
|
|
* See http://www.microsoft.com/msj/0197/exception/exception.htm,
|
|
|
|
* but don't believe all of it.
|
|
|
|
*
|
2001-01-12 21:41:03 +01:00
|
|
|
* FIXME: Incomplete support for nested exceptions/try block cleanup.
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-04-25 23:40:56 +02:00
|
|
|
|
2001-06-29 21:19:53 +02:00
|
|
|
#include "config.h"
|
2002-04-25 23:40:56 +02:00
|
|
|
#include "wine/port.h"
|
2001-06-29 21:19:53 +02:00
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winreg.h"
|
2002-09-13 00:07:02 +02:00
|
|
|
#include "winternl.h"
|
2001-01-12 21:41:03 +01:00
|
|
|
#include "wine/exception.h"
|
2001-01-11 00:59:25 +01:00
|
|
|
#include "msvcrt.h"
|
2002-12-13 00:34:01 +01:00
|
|
|
#include "excpt.h"
|
2002-01-22 01:57:16 +01:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
2001-01-11 00:59:25 +01:00
|
|
|
|
|
|
|
typedef void (*MSVCRT_sig_handler_func)(void);
|
|
|
|
|
|
|
|
/* VC++ extensions to Win32 SEH */
|
|
|
|
typedef struct _SCOPETABLE
|
|
|
|
{
|
2002-10-10 19:56:48 +02:00
|
|
|
int previousTryLevel;
|
2001-04-10 23:16:07 +02:00
|
|
|
int (*lpfnFilter)(PEXCEPTION_POINTERS);
|
|
|
|
int (*lpfnHandler)(void);
|
2001-01-11 00:59:25 +01:00
|
|
|
} SCOPETABLE, *PSCOPETABLE;
|
|
|
|
|
2001-01-12 21:41:03 +01:00
|
|
|
typedef struct _MSVCRT_EXCEPTION_FRAME
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2003-08-28 05:07:56 +02:00
|
|
|
EXCEPTION_REGISTRATION_RECORD *prev;
|
2004-08-22 04:07:13 +02:00
|
|
|
void (*handler)(PEXCEPTION_RECORD, EXCEPTION_REGISTRATION_RECORD*,
|
2001-01-11 00:59:25 +01:00
|
|
|
PCONTEXT, PEXCEPTION_RECORD);
|
|
|
|
PSCOPETABLE scopetable;
|
2002-10-10 19:56:48 +02:00
|
|
|
int trylevel;
|
2001-01-11 00:59:25 +01:00
|
|
|
int _ebp;
|
|
|
|
PEXCEPTION_POINTERS xpointers;
|
2001-01-12 21:41:03 +01:00
|
|
|
} MSVCRT_EXCEPTION_FRAME;
|
2001-01-11 00:59:25 +01:00
|
|
|
|
2002-10-10 19:56:48 +02:00
|
|
|
#define TRYLEVEL_END (-1) /* End of trylevel list */
|
2001-01-12 21:41:03 +01:00
|
|
|
|
|
|
|
#if defined(__GNUC__) && defined(__i386__)
|
2001-09-20 21:33:37 +02:00
|
|
|
inline static void call_finally_block( void *code_block, void *base_ptr )
|
|
|
|
{
|
|
|
|
__asm__ __volatile__ ("movl %1,%%ebp; call *%%eax" \
|
|
|
|
: : "a" (code_block), "g" (base_ptr));
|
|
|
|
}
|
2002-10-02 20:34:58 +02:00
|
|
|
|
2002-11-01 02:50:51 +01:00
|
|
|
inline static DWORD call_filter( void *func, void *arg, void *ebp )
|
2002-10-02 20:34:58 +02:00
|
|
|
{
|
|
|
|
DWORD ret;
|
|
|
|
__asm__ __volatile__ ("pushl %%ebp; pushl %3; movl %2,%%ebp; call *%%eax; popl %%ebp; popl %%ebp"
|
2002-11-01 02:50:51 +01:00
|
|
|
: "=a" (ret)
|
|
|
|
: "0" (func), "g" (ebp), "g" (arg)
|
|
|
|
: "ecx", "edx", "memory" );
|
2002-10-02 20:34:58 +02:00
|
|
|
return ret;
|
|
|
|
}
|
2002-05-17 01:08:01 +02:00
|
|
|
#endif
|
2001-01-12 21:41:03 +01:00
|
|
|
|
2001-04-10 23:16:07 +02:00
|
|
|
static DWORD MSVCRT_nested_handler(PEXCEPTION_RECORD rec,
|
2003-08-28 05:07:56 +02:00
|
|
|
EXCEPTION_REGISTRATION_RECORD* frame,
|
2001-04-10 23:16:07 +02:00
|
|
|
PCONTEXT context WINE_UNUSED,
|
2003-08-28 05:07:56 +02:00
|
|
|
EXCEPTION_REGISTRATION_RECORD** dispatch)
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-01-12 21:41:03 +01:00
|
|
|
if (rec->ExceptionFlags & 0x6)
|
|
|
|
return ExceptionContinueSearch;
|
|
|
|
*dispatch = frame;
|
|
|
|
return ExceptionCollidedUnwind;
|
|
|
|
}
|
|
|
|
|
2001-01-11 00:59:25 +01:00
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _XcptFilter (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 23:16:07 +02:00
|
|
|
int _XcptFilter(int ex, PEXCEPTION_POINTERS ptr)
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
|
|
|
FIXME("(%d,%p)semi-stub\n", ex, ptr);
|
|
|
|
return UnhandledExceptionFilter(ptr);
|
|
|
|
}
|
|
|
|
|
2001-01-11 23:30:19 +01:00
|
|
|
/*********************************************************************
|
|
|
|
* _EH_prolog (MSVCRT.@)
|
|
|
|
*/
|
|
|
|
#ifdef __i386__
|
2003-05-13 02:41:57 +02:00
|
|
|
/* Provided for VC++ binary compatibility only */
|
2001-04-10 23:16:07 +02:00
|
|
|
__ASM_GLOBAL_FUNC(_EH_prolog,
|
2002-10-10 19:56:48 +02:00
|
|
|
"pushl $-1\n\t"
|
2001-01-11 23:30:19 +01:00
|
|
|
"pushl %eax\n\t"
|
|
|
|
"pushl %fs:0\n\t"
|
|
|
|
"movl %esp, %fs:0\n\t"
|
|
|
|
"movl 12(%esp), %eax\n\t"
|
|
|
|
"movl %ebp, 12(%esp)\n\t"
|
|
|
|
"leal 12(%esp), %ebp\n\t"
|
|
|
|
"pushl %eax\n\t"
|
|
|
|
"ret");
|
|
|
|
#endif
|
|
|
|
|
2001-01-11 00:59:25 +01:00
|
|
|
/*******************************************************************
|
|
|
|
* _global_unwind2 (MSVCRT.@)
|
|
|
|
*/
|
2004-08-14 01:22:30 +02:00
|
|
|
void _global_unwind2(EXCEPTION_REGISTRATION_RECORD* frame)
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-01-12 21:41:03 +01:00
|
|
|
TRACE("(%p)\n",frame);
|
|
|
|
RtlUnwind( frame, 0, 0, 0 );
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************
|
|
|
|
* _local_unwind2 (MSVCRT.@)
|
|
|
|
*/
|
2002-10-10 19:56:48 +02:00
|
|
|
void _local_unwind2(MSVCRT_EXCEPTION_FRAME* frame, int trylevel)
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-01-12 21:41:03 +01:00
|
|
|
MSVCRT_EXCEPTION_FRAME *curframe = frame;
|
2003-08-28 05:07:56 +02:00
|
|
|
EXCEPTION_REGISTRATION_RECORD reg;
|
2001-01-12 21:41:03 +01:00
|
|
|
|
2002-10-10 19:56:48 +02:00
|
|
|
TRACE("(%p,%d,%d)\n",frame, frame->trylevel, trylevel);
|
2001-01-12 21:41:03 +01:00
|
|
|
|
|
|
|
/* Register a handler in case of a nested exception */
|
|
|
|
reg.Handler = (PEXCEPTION_HANDLER)MSVCRT_nested_handler;
|
2003-08-28 05:44:41 +02:00
|
|
|
reg.Prev = NtCurrentTeb()->Tib.ExceptionList;
|
2001-01-12 21:41:03 +01:00
|
|
|
__wine_push_frame(®);
|
|
|
|
|
|
|
|
while (frame->trylevel != TRYLEVEL_END && frame->trylevel != trylevel)
|
|
|
|
{
|
2002-10-10 19:56:48 +02:00
|
|
|
int curtrylevel = frame->scopetable[frame->trylevel].previousTryLevel;
|
2001-01-12 21:41:03 +01:00
|
|
|
curframe = frame;
|
|
|
|
curframe->trylevel = curtrylevel;
|
|
|
|
if (!frame->scopetable[curtrylevel].lpfnFilter)
|
|
|
|
{
|
|
|
|
ERR("__try block cleanup not implemented - expect crash!\n");
|
|
|
|
/* FIXME: Remove current frame, set ebp, call
|
|
|
|
* frame->scopetable[curtrylevel].lpfnHandler()
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
__wine_pop_frame(®);
|
|
|
|
TRACE("unwound OK\n");
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _except_handler2 (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 23:16:07 +02:00
|
|
|
int _except_handler2(PEXCEPTION_RECORD rec,
|
2004-08-14 01:22:30 +02:00
|
|
|
EXCEPTION_REGISTRATION_RECORD* frame,
|
2001-04-10 23:16:07 +02:00
|
|
|
PCONTEXT context,
|
2004-08-14 01:22:30 +02:00
|
|
|
EXCEPTION_REGISTRATION_RECORD** dispatcher)
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
|
|
|
FIXME("exception %lx flags=%lx at %p handler=%p %p %p stub\n",
|
|
|
|
rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress,
|
|
|
|
frame->Handler, context, dispatcher);
|
|
|
|
return ExceptionContinueSearch;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _except_handler3 (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 23:16:07 +02:00
|
|
|
int _except_handler3(PEXCEPTION_RECORD rec,
|
|
|
|
MSVCRT_EXCEPTION_FRAME* frame,
|
|
|
|
PCONTEXT context, void* dispatcher)
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-01-12 21:41:03 +01:00
|
|
|
#if defined(__GNUC__) && defined(__i386__)
|
2002-10-10 19:56:48 +02:00
|
|
|
long retval;
|
|
|
|
int trylevel;
|
2001-01-12 21:41:03 +01:00
|
|
|
EXCEPTION_POINTERS exceptPtrs;
|
|
|
|
PSCOPETABLE pScopeTable;
|
|
|
|
|
|
|
|
TRACE("exception %lx flags=%lx at %p handler=%p %p %p semi-stub\n",
|
2001-01-11 00:59:25 +01:00
|
|
|
rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress,
|
|
|
|
frame->handler, context, dispatcher);
|
2001-01-12 21:41:03 +01:00
|
|
|
|
|
|
|
__asm__ __volatile__ ("cld");
|
|
|
|
|
|
|
|
if (rec->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND))
|
|
|
|
{
|
|
|
|
/* Unwinding the current frame */
|
2001-04-10 23:16:07 +02:00
|
|
|
_local_unwind2(frame, TRYLEVEL_END);
|
2001-01-12 21:41:03 +01:00
|
|
|
return ExceptionContinueSearch;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Hunting for handler */
|
|
|
|
exceptPtrs.ExceptionRecord = rec;
|
|
|
|
exceptPtrs.ContextRecord = context;
|
|
|
|
*((DWORD *)frame-1) = (DWORD)&exceptPtrs;
|
|
|
|
trylevel = frame->trylevel;
|
|
|
|
pScopeTable = frame->scopetable;
|
|
|
|
|
|
|
|
while (trylevel != TRYLEVEL_END)
|
|
|
|
{
|
|
|
|
if (pScopeTable[trylevel].lpfnFilter)
|
|
|
|
{
|
|
|
|
TRACE("filter = %p\n", pScopeTable[trylevel].lpfnFilter);
|
|
|
|
|
2002-10-02 20:34:58 +02:00
|
|
|
retval = call_filter( pScopeTable[trylevel].lpfnFilter, &exceptPtrs, &frame->_ebp );
|
2001-01-12 21:41:03 +01:00
|
|
|
|
|
|
|
TRACE("filter returned %s\n", retval == EXCEPTION_CONTINUE_EXECUTION ?
|
|
|
|
"CONTINUE_EXECUTION" : retval == EXCEPTION_EXECUTE_HANDLER ?
|
|
|
|
"EXECUTE_HANDLER" : "CONTINUE_SEARCH");
|
|
|
|
|
|
|
|
if (retval == EXCEPTION_CONTINUE_EXECUTION)
|
|
|
|
return ExceptionContinueExecution;
|
|
|
|
|
|
|
|
if (retval == EXCEPTION_EXECUTE_HANDLER)
|
|
|
|
{
|
|
|
|
/* Unwind all higher frames, this one will handle the exception */
|
2004-08-14 01:22:30 +02:00
|
|
|
_global_unwind2((EXCEPTION_REGISTRATION_RECORD*)frame);
|
2001-04-10 23:16:07 +02:00
|
|
|
_local_unwind2(frame, trylevel);
|
2001-01-12 21:41:03 +01:00
|
|
|
|
|
|
|
/* Set our trylevel to the enclosing block, and call the __finally
|
|
|
|
* code, which won't return
|
|
|
|
*/
|
|
|
|
frame->trylevel = pScopeTable->previousTryLevel;
|
|
|
|
TRACE("__finally block %p\n",pScopeTable[trylevel].lpfnHandler);
|
2001-09-20 21:33:37 +02:00
|
|
|
call_finally_block(pScopeTable[trylevel].lpfnHandler, &frame->_ebp);
|
2001-01-12 21:41:03 +01:00
|
|
|
ERR("Returned from __finally block - expect crash!\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
trylevel = pScopeTable->previousTryLevel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
TRACE("exception %lx flags=%lx at %p handler=%p %p %p stub\n",
|
|
|
|
rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress,
|
|
|
|
frame->handler, context, dispatcher);
|
|
|
|
#endif
|
2001-01-11 00:59:25 +01:00
|
|
|
return ExceptionContinueSearch;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _abnormal_termination (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 23:16:07 +02:00
|
|
|
int _abnormal_termination(void)
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
|
|
|
FIXME("(void)stub\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-12-21 20:23:30 +01:00
|
|
|
/*
|
|
|
|
* setjmp/longjmp implementation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __i386__
|
|
|
|
#define MSVCRT_JMP_MAGIC 0x56433230 /* ID value for new jump structure */
|
|
|
|
typedef void (*MSVCRT_unwind_function)(const void*);
|
|
|
|
|
|
|
|
/*
|
2002-06-01 01:06:46 +02:00
|
|
|
* The signatures of the setjmp/longjmp functions do not match that
|
|
|
|
* declared in the setjmp header so they don't follow the regular naming
|
2001-12-21 20:23:30 +01:00
|
|
|
* convention to avoid conflicts.
|
|
|
|
*/
|
|
|
|
|
2001-01-11 00:59:25 +01:00
|
|
|
/*******************************************************************
|
|
|
|
* _setjmp (MSVCRT.@)
|
|
|
|
*/
|
2003-12-04 06:51:01 +01:00
|
|
|
DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp, _MSVCRT__setjmp, 4, 0 );
|
2004-06-25 03:19:15 +02:00
|
|
|
void _MSVCRT__setjmp(struct MSVCRT___JUMP_BUFFER *jmp, CONTEXT86* context)
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-12-21 20:23:30 +01:00
|
|
|
TRACE("(%p)\n",jmp);
|
|
|
|
jmp->Ebp = context->Ebp;
|
|
|
|
jmp->Ebx = context->Ebx;
|
|
|
|
jmp->Edi = context->Edi;
|
|
|
|
jmp->Esi = context->Esi;
|
|
|
|
jmp->Esp = context->Esp;
|
|
|
|
jmp->Eip = context->Eip;
|
2003-08-28 05:44:41 +02:00
|
|
|
jmp->Registration = (unsigned long)NtCurrentTeb()->Tib.ExceptionList;
|
2001-12-21 20:23:30 +01:00
|
|
|
if (jmp->Registration == TRYLEVEL_END)
|
|
|
|
jmp->TryLevel = TRYLEVEL_END;
|
|
|
|
else
|
|
|
|
jmp->TryLevel = ((MSVCRT_EXCEPTION_FRAME*)jmp->Registration)->trylevel;
|
|
|
|
TRACE("returning 0\n");
|
|
|
|
context->Eax=0;
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
2001-03-19 20:13:40 +01:00
|
|
|
/*******************************************************************
|
|
|
|
* _setjmp3 (MSVCRT.@)
|
|
|
|
*/
|
2003-12-04 06:51:01 +01:00
|
|
|
DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp3, _MSVCRT__setjmp3, 8, 0 );
|
2004-06-25 03:19:15 +02:00
|
|
|
void _MSVCRT__setjmp3(struct MSVCRT___JUMP_BUFFER *jmp, int nb_args, CONTEXT86* context)
|
2001-03-19 20:13:40 +01:00
|
|
|
{
|
2001-12-21 20:23:30 +01:00
|
|
|
TRACE("(%p,%d)\n",jmp,nb_args);
|
|
|
|
jmp->Ebp = context->Ebp;
|
|
|
|
jmp->Ebx = context->Ebx;
|
|
|
|
jmp->Edi = context->Edi;
|
|
|
|
jmp->Esi = context->Esi;
|
|
|
|
jmp->Esp = context->Esp;
|
|
|
|
jmp->Eip = context->Eip;
|
|
|
|
jmp->Cookie = MSVCRT_JMP_MAGIC;
|
|
|
|
jmp->UnwindFunc = 0;
|
2003-08-28 05:44:41 +02:00
|
|
|
jmp->Registration = (unsigned long)NtCurrentTeb()->Tib.ExceptionList;
|
2001-12-21 20:23:30 +01:00
|
|
|
if (jmp->Registration == TRYLEVEL_END)
|
|
|
|
{
|
|
|
|
jmp->TryLevel = TRYLEVEL_END;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
void **args = ((void**)context->Esp)+2;
|
|
|
|
|
|
|
|
if (nb_args > 0) jmp->UnwindFunc = (unsigned long)*args++;
|
|
|
|
if (nb_args > 1) jmp->TryLevel = (unsigned long)*args++;
|
|
|
|
else jmp->TryLevel = ((MSVCRT_EXCEPTION_FRAME*)jmp->Registration)->trylevel;
|
|
|
|
if (nb_args > 2)
|
|
|
|
{
|
|
|
|
size_t size = (nb_args - 2) * sizeof(DWORD);
|
|
|
|
memcpy( jmp->UnwindData, args, min( size, sizeof(jmp->UnwindData) ));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TRACE("returning 0\n");
|
|
|
|
context->Eax = 0;
|
2001-03-19 20:13:40 +01:00
|
|
|
}
|
|
|
|
|
2001-01-11 00:59:25 +01:00
|
|
|
/*********************************************************************
|
|
|
|
* longjmp (MSVCRT.@)
|
|
|
|
*/
|
2003-12-04 06:51:01 +01:00
|
|
|
DEFINE_REGS_ENTRYPOINT( MSVCRT_longjmp, _MSVCRT_longjmp, 8, 0 );
|
2004-06-25 03:19:15 +02:00
|
|
|
void _MSVCRT_longjmp(struct MSVCRT___JUMP_BUFFER *jmp, int retval, CONTEXT86* context)
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-12-21 20:23:30 +01:00
|
|
|
unsigned long cur_frame = 0;
|
|
|
|
|
|
|
|
TRACE("(%p,%d)\n", jmp, retval);
|
|
|
|
|
2003-08-28 05:44:41 +02:00
|
|
|
cur_frame=(unsigned long)NtCurrentTeb()->Tib.ExceptionList;
|
2001-12-21 20:23:30 +01:00
|
|
|
TRACE("cur_frame=%lx\n",cur_frame);
|
|
|
|
|
|
|
|
if (cur_frame != jmp->Registration)
|
2004-08-22 04:07:13 +02:00
|
|
|
_global_unwind2((EXCEPTION_REGISTRATION_RECORD*)jmp->Registration);
|
2001-12-21 20:23:30 +01:00
|
|
|
|
|
|
|
if (jmp->Registration)
|
|
|
|
{
|
|
|
|
if (!IsBadReadPtr(&jmp->Cookie, sizeof(long)) &&
|
|
|
|
jmp->Cookie == MSVCRT_JMP_MAGIC && jmp->UnwindFunc)
|
|
|
|
{
|
|
|
|
MSVCRT_unwind_function unwind_func;
|
|
|
|
|
|
|
|
unwind_func=(MSVCRT_unwind_function)jmp->UnwindFunc;
|
|
|
|
unwind_func(jmp);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
_local_unwind2((MSVCRT_EXCEPTION_FRAME*)jmp->Registration,
|
|
|
|
jmp->TryLevel);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!retval)
|
|
|
|
retval = 1;
|
|
|
|
|
|
|
|
TRACE("Jump to %lx returning %d\n",jmp->Eip,retval);
|
|
|
|
context->Ebp = jmp->Ebp;
|
|
|
|
context->Ebx = jmp->Ebx;
|
|
|
|
context->Edi = jmp->Edi;
|
|
|
|
context->Esi = jmp->Esi;
|
|
|
|
context->Esp = jmp->Esp;
|
|
|
|
context->Eip = jmp->Eip;
|
|
|
|
context->Eax = retval;
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
2002-10-16 20:59:38 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* _seh_longjmp_unwind (MSVCRT.@)
|
|
|
|
*/
|
2004-06-25 03:19:15 +02:00
|
|
|
void __stdcall _seh_longjmp_unwind(struct MSVCRT___JUMP_BUFFER *jmp)
|
2002-10-16 20:59:38 +02:00
|
|
|
{
|
|
|
|
_local_unwind2( (MSVCRT_EXCEPTION_FRAME *)jmp->Registration, jmp->TryLevel );
|
|
|
|
}
|
2002-10-31 23:04:53 +01:00
|
|
|
#endif /* i386 */
|
2002-10-16 20:59:38 +02:00
|
|
|
|
2001-01-11 00:59:25 +01:00
|
|
|
/*********************************************************************
|
|
|
|
* signal (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 23:16:07 +02:00
|
|
|
void* MSVCRT_signal(int sig, MSVCRT_sig_handler_func func)
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
|
|
|
FIXME("(%d %p):stub\n", sig, func);
|
|
|
|
return (void*)-1;
|
|
|
|
}
|