This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Microsoft Specific
Immediately terminates the calling process with minimum overhead.
__declspec(noreturn) void __fastfail(unsigned int code);code
[in] AFAST_FAIL_<description> symbolic constant from winnt.h or wdm.h that indicates the reason for process termination.
The__fastfail intrinsic does not return.
The__fastfail intrinsic provides a mechanism for afast fail request—a way for a potentially corrupted process to request immediate process termination. Critical failures that may have corrupted program state and stack beyond recovery cannot be handled by the regular exception handling facility. Use__fastfail to terminate the process using minimal overhead.
Internally,__fastfail is implemented by using several architecture-specific mechanisms:
| Architecture | Instruction | Location of code argument |
|---|---|---|
| x86 | int 0x29 | ecx |
| x64 | int 0x29 | rcx |
| ARM | Opcode 0xDEFB | r0 |
| ARM64 | Opcode 0xF003 | x0 |
A fast fail request is self-contained and typically requires just two instructions to execute. After a fast fail request has been executed, the kernel then takes the appropriate action. In user-mode code, there are no memory dependencies beyond the instruction pointer itself when a fast fail event is raised. That maximizes its reliability, even in cases of severe memory corruption.
Thecode argument, one of theFAST_FAIL_<description> symbolic constants from winnt.h or wdm.h, describes the type of failure condition. It's incorporated into failure reports in an environment-specific manner.
User-mode fast fail requests appear as a second chance non-continuable exception with exception code 0xC0000409, and with at least one exception parameter. The first exception parameter is thecode value. This exception code indicates to the Windows Error Reporting (WER) and debugging infrastructure that the process is corrupted, and that minimal in-process actions should be taken in response to the failure. Kernel-mode fast fail requests are implemented by using a dedicated bugcheck code,KERNEL_SECURITY_CHECK_FAILURE (0x139). In both cases, no exception handlers are invoked because the program is expected to be in a corrupted state. If a debugger is present, it's given an opportunity to examine the state of the program before termination.
Support for the native fast fail mechanism began in Windows 8. Windows operating systems that don't support the fast fail instruction natively will typically treat a fast fail request as an access violation, or as anUNEXPECTED_KERNEL_MODE_TRAP bugcheck. In these cases, the program is still terminated, but not necessarily as quickly.
__fastfail is only available as an intrinsic.
| Intrinsic | Architecture |
|---|---|
__fastfail | x86, x64, ARM, ARM64 |
Header file <intrin.h>
END Microsoft Specific
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?