Process exit codes are fairly straightforward on Windows. They are essentially the return value of a process: a plain, 32-bit unsigned integer code. There are no strict rules governing this value, just convention:
- 0 means success
- Anything else means failure
- If the system is involved in the termination of a program, the returned value might be a standard Win32 error code, HRESULT, or NTSTATUS. For example, if your process gets terminated due to an unhandled access violation, the exit code will be 0xC0000005
Due to the third point above, when your process is terminated, you can get a pretty good idea regarding the cause. However, sometimes that’s not the case. At work I’ve seen many exit codes that I found interesting. In some cases we figured out the reason, in other cases, we didn’t (comments welcome!). I thought I’d compile a list of codes that might be of interest to others. This is listed as a resource, so I plan to update/extend it in the future.