AddVectoredExceptionHandler

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This function registers a new vectored exception handler.

Syntax

PVOID AddVectoredExceptionHandler(
  ULONG FirstHandler,
  PVECTORED_EXCEPTION_HANDLER VectoredHandler
);

Parameters

  • FirstHandler
    [in] Order in which the handler should be called. If the parameter is nonzero, the handler is the first handler to be called. If the parameter is zero, the handler is the last handler to be called.
  • VectoredHandler
    [in] Pointer to the handler to be called. For more information, see VectoredHandler.

Return Value

A pointer to the exception handler indicates success. NULL indicates failure.

Remarks

If the FirstHandler parameter is nonzero, the handler is the first handler to be called until a subsequent call to AddVectoredExceptionHandler is used to specify a different handler as the first handler.

If the VectoredHandler parameter points to a function in a DLL and that DLL is unloaded, the handler is still registered. This can lead to application errors.

Vectored exception handlers are not frame-based handlers. Therefore, you can add a handler and ensure that it gets called regardless of where you are in a call frame. The handlers are called in the order that they were added, after the debugger gets a first chance notification, but before frame-based dispatching occurs.

Requirements

Header winbase.h
Library coredll.lib
Windows Embedded CE Windows Embedded CE 6.0 and later

See Also

Reference

Exception Functions
RemoveVectoredExceptionHandler
VectoredHandler

Other Resources

New Kernel APIs