SetUnhandledExceptionFilter

SetUnhandledExceptionFilter lets an application supersede the top-level exception handler that RTSS places at the top of each thread and process. After calling this function, if an exception occurs in a process and the system's scan of handlers reaches the RTSS unhandled exception filter, that filter will call the exception filter function specified by the lpTopLevelExceptionFilter parameter.

Syntax

LPTOP_LEVEL_EXCEPTION_FILTER SetUnhandledExceptionFilter(
    LPTOP_LEVEL_EXCEPTION_FILTER pTopLevelExceptionFilter
);

Parameters

lpTopLevelExceptionFilter

The address of a top-level exception filter function that will be called whenever the UnhandledExceptionFilter function gets control. A value of NULL for this parameter specifies default handling within UnhandledExceptionFilter. The filter function has syntax congruent to that of UnhandledExceptionFilter: It takes a single parameter of type LPEXCEPTION_POINTERS, and returns a value of type LONG.

The filter function returns one of the following values:

Return Value

The address of the previous exception filter established with the function if the function succeeds, a NULL return value if there is no current top-level exception handler

Remarks

Issuing SetUnhandledExceptionFilter replaces the existing top-level exception filter for all existing and all future threads in the calling process.

The exception handler specified by lpTopLevelExceptionFilter is executed in the context of the thread that caused the fault. This can affect the exception handler's ability to recover from certain exceptions, such as an invalid stack.

Requirements

Minimum Supported Version RTX64 2013
Header windows.h
Library

rtapi.lib (Windows), Rtx_Rtss.lib (RTSS)

See Also:

UnhandledExceptionFilter