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 @@ -96,15 +96,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.@) */ @@ -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); +}