Registers a vectored exception handler.
Syntax
PVOID WINAPI AddVectoredExceptionHandler(
__in ULONG FirstHandler,
__in PVECTORED_EXCEPTION_HANDLER VectoredHandler
);
Parameters
- FirstHandler [in]
-
The 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]
-
A pointer to the handler to be called. For more information, see
VectoredHandler.
Return Value
If the function succeeds, the return value is a handle to the exception handler.
If the function fails, the return value is NULL.
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.
To unregister the handler, use the
RemoveVectoredExceptionHandler function.
To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0500 or later. For more information, see
Using the Windows Headers.
Examples
For an example, see
Using a Vectored Exception Handler.
Requirements
| Minimum supported client | Windows XP |
| Minimum supported server | Windows Server 2003 |
| Header | Winbase.h (include Windows.h) |
| Library | Kernel32.lib |
| DLL | Kernel32.dll |
See Also
- AddVectoredContinueHandler
- RemoveVectoredExceptionHandler
- VectoredHandler
- Vectored Exception Handling
Send comments about this topic to Microsoft
Build date: 7/30/2009