From 6560c48ecc22ccf602a7533fe91537ebc9f2d092 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Thu, 19 May 2005 14:21:21 +0000 Subject: [PATCH] Implement _XcptFilter using signal handlers, and add a couple traces. --- dlls/msvcrt/except.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/dlls/msvcrt/except.c b/dlls/msvcrt/except.c index 6ba972ae3bc..51b15f07efb 100644 --- a/dlls/msvcrt/except.c +++ b/dlls/msvcrt/except.c @@ -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.@) */ #ifdef __i386__ @@ -200,6 +191,7 @@ int _except_handler3(PEXCEPTION_RECORD rec, { /* Unwinding the current frame */ _local_unwind2(frame, TRYLEVEL_END); + TRACE("unwound current frame, returning ExceptionContinueSearch\n"); return ExceptionContinueSearch; } else @@ -249,6 +241,7 @@ int _except_handler3(PEXCEPTION_RECORD rec, rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress, frame->handler, context, dispatcher); #endif + TRACE("reached TRYLEVEL_END, returning ExceptionContinueSearch\n"); return ExceptionContinueSearch; } @@ -428,6 +421,9 @@ static LONG WINAPI msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except) { LONG ret = EXCEPTION_CONTINUE_SEARCH; + if (!except || !except->ExceptionRecord) + return EXCEPTION_CONTINUE_SEARCH; + switch (except->ExceptionRecord->ExceptionCode) { case EXCEPTION_ACCESS_VIOLATION: @@ -528,3 +524,13 @@ __sighandler_t MSVCRT_signal(int sig, __sighandler_t func) } 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); +} -- 2.11.4.GIT