Common Process Termination Values

When your application does something the OS (or the application itself) doesn't like, often the floor gets yanked out and the process is terminated in an abrupt manner. If you don't happen to be running with a debugger, often the easiest way to get an idea of what went wrong is to look at the process exit code. Here we have an assortment of some of the more frequently encountered exit codes you are likely to witness:


CRT's abort() or assert() was called.


An unhandled breakpoint (such as __debugbreak()), may also be caused by /RTC run-time checks.


Access violation.


Stack overflow. Avoid recursion, move large stack buffers onto the heap, or increase the stack size via the /STACK linker option.


A required DLL was not found. Make sure you deploy all necessary components.


An API is missing from the loaded DLL (searched by ordinal). This, and the one below, is typically due to running on an older version of Windows. You can change your _WIN32_WINNT, _WIN32_IE, etc. defines to target a previous version, or use LoadLibrary/GetProcAddress on the specific new API.


An API is missing from the loaded DLL (searched by name).


DllMain (from a required library) returned FALSE.


Heap corruption detected (via HeapSetInformation's HeapEnableTerminationOnCorruption option).


Stack corruption detected (typically a result of /GS stack checks).


Invalid CRT parameter (typically a result of the safe CRT functions failing a check).

The 0xC… values are NTSTATUS codes, so if you happen to see other values in that range you know where to look them up.


Comments (2)
  1. MD_EXCH says:

    I'm seeing 0xc0000417 error with swprintf_s function. It fails with a larget buffer of say 1GB. Can you elaborate on the meaning of the error.

  2. Josh Poley says:


    If the size of the information you try to store in the buffer exceeds the size of the buffer, you can get 0xC0000417. For example:

    #include <stdio.h>

    int main(int, char**)
     wchar_t buffer[5];
     swprintf_s(buffer, 5, L"hello world");
     return 0;

    There may be other checks involved, you can always step through the CRT to see where exactly you are failing.

Comments are closed.

Skip to main content