The Old New Thing

Psychic debugging: Why does ExitProcess(1) produce an exit code of zero?

Here's a question that came from a customer. By now, you should already have the necessary psychic powers to answer it. Our program calls to indicate that it exited unsuccessfully. The process that launched our program waits for the program to exit and then calls to retrieve the exit code. The function succeeds, but the exit code is zero! ...