RpcFinally

The RpcFinally statement provides developers with the ability to create termination handlers.

void RpcFinally(void);

Parameters

This function has no parameters.

Return Value

This function does not return a value.

Remarks

  • guarded statements
    Statements that are executed while exceptions are being monitored. If an exception occurs during the execution of these statements, termination statements will be executed. Unwinding then continues to the next RpcTryExcept or RpcTryFinally statements.
  • termination statements
    Statements that are executed when an exception occurs. After the termination statements are complete, the exception is raised again.

Use the RpcFinally statement to build termination handlers. All termination handlers created with RpcFinally execute whether or not an exception occurs. Your program can call the RpcAbnormalTermination function in termination statements to determine whether termination statements is being executed because an exception occurred. A nonzero return from RpcAbnormalTermination indicates that an exception occurred. A value of zero indicates that no exception occurred.

The following restrictions apply:

  • Jumping (through a goto) into guarded statements is not allowed.
  • Jumping (through a goto) into termination statements is not allowed.
  • Returning or jumping (through a goto) from guarded statements is not allowed.
  • Returning or jumping (through a goto) from termination statements is not allowed.

Requirements

Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Server Requires Windows Server "Longhorn", Windows Server 2003, Windows 2000 Server, or Windows NT Server.
Header

Declared in Rpc.h.

Library

Use Rpcrt4.lib.

DLL Requires Rpcrt4.dll.

See Also

RpcAbnormalTermination