Exit Codes Windows =link= Direct
This layering leads to a key insight: . The default for a thread is STATUS_THREAD_TERMINATED (0x00000100); for a process, it is STATUS_PENDING (0x00000103) until termination, then the final code. 2. The Semantic Wasteland: What Does Non-Zero Mean? Unlike Unix, where exit codes are small (0–255) and often mapped to sysexits.h conventions, Windows exit codes are full 32-bit values, blending several distinct categories:
If yes, it's either an NTSTATUS (0xCxxxxxxx) or HRESULT (0x8xxxxxxx). Use the Visual Studio tool err.exe or net helpmsg : exit codes windows
These are STILL_ACTIVE (thread) and STATUS_PENDING (process). Seeing them from GetExitCodeProcess means you called it before the process actually exited. This is a classic race. This layering leads to a key insight:
> net helpmsg 2 The system cannot find the file specified. If the program is well-known (e.g., robocopy , xcopy ), consult its documentation—they reuse Win32 error codes with different meanings. The Semantic Wasteland: What Does Non-Zero Mean