Expand Minimize

OpCodes.Endfilter Field

Transfers control from the filter clause of an exception back to the Common Language Infrastructure (CLI) exception handler.

Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

static val Endfilter: OpCode

The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format

Assembly Format

Description

FE 11

endfilter

End filter clause of SEH exception handling.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.

  2. value is popped from the stack; endfilter is executed and control is transferred to the exception handler.

Value (which must be of type int32 and is one of a specific set of values) is returned from the filter clause. It should be one of:

  • exception_continue_search (value = 0) to continue searching for an exception handler

  • exception_execute_handler (value = 1) to start the second phase of exception handling where finally blocks are run until the handler associated with this filter clause is located. Upon discovery, the handler is executed.

Other integer values will produce unspecified results.

The entry point of a filter, as shown in the method's exception table, must be the first instruction in the filter's code block. The endfilter instruction must be the last instruction in the filter's code block (hence there can only be one endfilter for any single filter block). After executing the endfilter instruction, control logically flows back to the CLI exception handling mechanism.

Control cannot be transferred into a filter block except through the exception mechanism. Control cannot be transferred out of a filter block except through the use of a throw instruction or by executing the final endfilter instruction. You cannot embed a try block within a filter block. If an exception is thrown inside the filter block, it is intercepted and a value of 0 (exception_continue_search) is returned.

The following Emit method overload can use the endfilter opcode:

  • ILGenerator.Emit(OpCode)

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft