diff --git a/reactos/include/ndk/rtlfuncs.h b/reactos/include/ndk/rtlfuncs.h index 6f9925e3434..b04633f05dd 100644 --- a/reactos/include/ndk/rtlfuncs.h +++ b/reactos/include/ndk/rtlfuncs.h @@ -604,10 +604,10 @@ RtlAssert( ); NTSYSAPI -PVOID +VOID NTAPI RtlSetUnhandledExceptionFilter( - IN PVOID TopLevelExceptionFilter + IN PRTLP_UNHANDLED_EXCEPTION_FILTER TopLevelExceptionFilter ); NTSYSAPI diff --git a/reactos/include/ndk/rtltypes.h b/reactos/include/ndk/rtltypes.h index 8f0afbd19da..609b398ad0f 100644 --- a/reactos/include/ndk/rtltypes.h +++ b/reactos/include/ndk/rtltypes.h @@ -472,6 +472,15 @@ extern const PRTL_REALLOCATE_STRING_ROUTINE RtlReallocateStringRoutine; #endif /* NTOS_MODE_USER */ +// +// Unhandled Exception Filter +// +typedef ULONG +(NTAPI *RTLP_UNHANDLED_EXCEPTION_FILTER)( + IN struct _EXCEPTION_POINTERS *ExceptionInfo +); +typedef RTLP_UNHANDLED_EXCEPTION_FILTER *PRTLP_UNHANDLED_EXCEPTION_FILTER; + // // Callback for RTL Heap Enumeration // diff --git a/reactos/lib/rtl/exception.c b/reactos/lib/rtl/exception.c index e0970d182e7..60aa0bcaaed 100644 --- a/reactos/lib/rtl/exception.c +++ b/reactos/lib/rtl/exception.c @@ -15,6 +15,10 @@ #define NDEBUG #include +/* GLOBALS *****************************************************************/ + +PRTLP_UNHANDLED_EXCEPTION_FILTER RtlpUnhandledExceptionFilter; + /* FUNCTIONS ***************************************************************/ #if !defined(_M_IX86) && !defined(_M_AMD64) @@ -172,17 +176,18 @@ LONG NTAPI RtlUnhandledExceptionFilter(IN struct _EXCEPTION_POINTERS* ExceptionInfo) { + /* This is used by the security cookie checks, and calso called externally */ UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } /* - * @unimplemented + * @implemented */ -PVOID +VOID NTAPI -RtlSetUnhandledExceptionFilter(IN PVOID TopLevelExceptionFilter) +RtlSetUnhandledExceptionFilter(IN PRTLP_UNHANDLED_EXCEPTION_FILTER TopLevelExceptionFilter) { - UNIMPLEMENTED; - return NULL; + /* Set the filter which is used by the CriticalSection package */ + RtlpUnhandledExceptionFilter = RtlEncodePointer(TopLevelExceptionFilter); }