Commit 6560c48e authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

Implement _XcptFilter using signal handlers, and add a couple traces.

parent 84259840
...@@ -97,15 +97,6 @@ static DWORD MSVCRT_nested_handler(PEXCEPTION_RECORD rec, ...@@ -97,15 +97,6 @@ static DWORD MSVCRT_nested_handler(PEXCEPTION_RECORD rec,
/********************************************************************* /*********************************************************************
* _XcptFilter (MSVCRT.@)
*/
int _XcptFilter(int ex, PEXCEPTION_POINTERS ptr)
{
FIXME("(%d,%p)semi-stub\n", ex, ptr);
return UnhandledExceptionFilter(ptr);
}
/*********************************************************************
* _EH_prolog (MSVCRT.@) * _EH_prolog (MSVCRT.@)
*/ */
#ifdef __i386__ #ifdef __i386__
...@@ -200,6 +191,7 @@ int _except_handler3(PEXCEPTION_RECORD rec, ...@@ -200,6 +191,7 @@ int _except_handler3(PEXCEPTION_RECORD rec,
{ {
/* Unwinding the current frame */ /* Unwinding the current frame */
_local_unwind2(frame, TRYLEVEL_END); _local_unwind2(frame, TRYLEVEL_END);
TRACE("unwound current frame, returning ExceptionContinueSearch\n");
return ExceptionContinueSearch; return ExceptionContinueSearch;
} }
else else
...@@ -249,6 +241,7 @@ int _except_handler3(PEXCEPTION_RECORD rec, ...@@ -249,6 +241,7 @@ int _except_handler3(PEXCEPTION_RECORD rec,
rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress, rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress,
frame->handler, context, dispatcher); frame->handler, context, dispatcher);
#endif #endif
TRACE("reached TRYLEVEL_END, returning ExceptionContinueSearch\n");
return ExceptionContinueSearch; return ExceptionContinueSearch;
} }
...@@ -428,6 +421,9 @@ static LONG WINAPI msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except) ...@@ -428,6 +421,9 @@ static LONG WINAPI msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except)
{ {
LONG ret = EXCEPTION_CONTINUE_SEARCH; LONG ret = EXCEPTION_CONTINUE_SEARCH;
if (!except || !except->ExceptionRecord)
return EXCEPTION_CONTINUE_SEARCH;
switch (except->ExceptionRecord->ExceptionCode) switch (except->ExceptionRecord->ExceptionCode)
{ {
case EXCEPTION_ACCESS_VIOLATION: case EXCEPTION_ACCESS_VIOLATION:
...@@ -528,3 +524,13 @@ __sighandler_t MSVCRT_signal(int sig, __sighandler_t func) ...@@ -528,3 +524,13 @@ __sighandler_t MSVCRT_signal(int sig, __sighandler_t func)
} }
return ret; return ret;
} }
/*********************************************************************
* _XcptFilter (MSVCRT.@)
*/
int _XcptFilter(NTSTATUS ex, PEXCEPTION_POINTERS ptr)
{
TRACE("(%ld,%p)\n", ex, ptr);
/* I assume ptr->ExceptionRecord->ExceptionCode is the same as ex */
return msvcrt_exception_filter(ptr);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment