RpcExceptionFilter function (rpcdce.h)

The RpcExceptionFilter function is a default exception filter that determines whether an exception is fatal or non-fatal.RpcExceptionFilter is recommended for structured exception handling for the most common exceptions as an alternative to custom filters with RpcExcept.

Syntax

int RpcExceptionFilter(
  [in] unsigned long ExceptionCode
);

Parameters

[in] ExceptionCode

Value of an exception. Any of the following exception values will return EXCEPTION_CONTINUE_SEARCH:

STATUS_ACCESS_VIOLATION

STATUS_POSSIBLE_DEADLOCK

STATUS_INSTRUCTION_MISALIGNMENT

STATUS_DATATYPE_MISALIGNMENT

STATUS_PRIVILEGED_INSTRUCTION

STATUS_ILLEGAL_INSTRUCTION

STATUS_BREAKPOINT

STATUS_STACK_OVERFLOW

STATUS_HANDLE_NOT_CLOSABLE

STATUS_IN_PAGE_ERROR

STATUS_ASSERTION_FAILURE

STATUS_STACK_BUFFER_OVERRUN

STATUS_GUARD_PAGE_VIOLATION

STATUS_REG_NAT_CONSUMPTION

Return value

A value that specifies whether the exception was fatal or non-fatal.

Return code Description
EXCEPTION_CONTINUE_SEARCH
The exception is fatal and must be handled.
EXCEPTION_EXECUTE_HANDLER
The exception is not fatal.

Remarks

The recommended usage of RpcExceptionFilter is:


RpcTry
{
    … RPC calls here …
RpcExcept(RpcExceptionFilter(RpcExceptionCode()))
{
    … error handling here …
}
RpcEndExcept

Requirements

   
Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header rpcdce.h (include Rpc.h)
Library Rpcrt4.lib
DLL Rpcrt4.dll

See also

Exception Handling

RpcExcept

RpcExceptionCode

RpcTryExcept