Share via


RaiseFailFastException Function

[This documentation is preliminary and is subject to change.]

Raises an exception that bypasses all exception handlers (frame or vector based). Raising this exception terminates the application and invokes Windows Error Reporting (if Windows Error Reporting is running).

Syntax

VOID WINAPI RaiseFailFastException(
  __in_opt  PEXCEPTION_RECORD pExceptionRecord,
  __in_opt  PCONTEXT pContextRecord,
  __in      DWORD dwFlags
);

Parameters

  • pExceptionRecord [in, optional]
    A pointer to an EXCEPTION_RECORD structure that contains the exception information. You must specify the ExceptionAddress and ExceptionCode members.

    If this parameter is NULL, the function creates an exception record and sets the ExceptionCode member to STATUS_FAIL_FAST_EXCEPTION. The function will also set the ExceptionAddress member if the dwFlags parameter contains the FAIL_FAST_GENERATE_EXCEPTION_ADDRESS flag.

  • pContextRecord [in, optional]
    A pointer to a CONTEXT structure that contains the context information. If NULL, this function generates the context (however, the context will not match the context of the caller).

  • dwFlags [in]

    You can specify zero or one or more of the following flags that control this function's behavior:

    Value Meaning
    FAIL_FAST_GENERATE_EXCEPTION_ADDRESS 0x1

    Causes RaiseFailFastException to set the ExceptionAddress of EXCEPTION_RECORD to the return address of this function (the next instruction in the caller after the call to RaiseFailFastException). This function will set the exception address only if ExceptionAddress is NULL.

    FAIL_FAST_NO_HARD_ERROR_DLG 0x2

    If the Windows Error Report service is not running when an unhandled exception occurs, a message box is diplayed to the user that identifies the address where the exception occurred. To prevent the message box from being displayed to the user, and to fail silently, set this flag.

     

Return Value

This function does not return a value.

Remarks

Typically, you call this function if your application is in a bad state and you want to terminate immediately and have a Windows Error Report created.

If the WER service is not running or there is no debugger attached to the process, the process will be terminated.

This function raises a second chance exception. If JIT debugging is enabled, a debugger will attach to the process.

Requirements

Minimum supported client Windows 7
Minimum supported server Windows Server 2008 R2
Header Winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also

Environment.FailFast

Send comments about this topic to Microsoft

Build date: 5/7/2009