{"id":22443,"date":"2008-05-06T10:00:00","date_gmt":"2008-05-06T10:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2008\/05\/06\/psychic-debugging-why-does-exitprocess1-produce-an-exit-code-of-zero\/"},"modified":"2008-05-06T10:00:00","modified_gmt":"2008-05-06T10:00:00","slug":"psychic-debugging-why-does-exitprocess1-produce-an-exit-code-of-zero","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20080506-00\/?p=22443","title":{"rendered":"Psychic debugging: Why does ExitProcess(1) produce an exit code of zero?"},"content":{"rendered":"<p> Here&#8217;s a question that came from a customer. By now, you should already have the necessary psychic powers to answer it. <\/p>\n<blockquote class=\"m\"><p> Our program calls <code>ExitProcess(1)<\/code> to indicate that it exited unsuccessfully. The process that launched our program waits for the program to exit and then calls <code>GetExitCodeProcess<\/code> to retrieve the exit code. The function succeeds, but the exit code is zero! How can this be? <\/p><\/blockquote>\n<p> Hint: Read about <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2007\/05\/03\/2383346.aspx\"> how processes terminate on Windows&nbsp;XP<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a question that came from a customer. By now, you should already have the necessary psychic powers to answer it. Our program calls ExitProcess(1) to indicate that it exited unsuccessfully. The process that launched our program waits for the program to exit and then calls GetExitCodeProcess to retrieve the exit code. The function succeeds, [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-22443","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Here&#8217;s a question that came from a customer. By now, you should already have the necessary psychic powers to answer it. Our program calls ExitProcess(1) to indicate that it exited unsuccessfully. The process that launched our program waits for the program to exit and then calls GetExitCodeProcess to retrieve the exit code. The function succeeds, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/22443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=22443"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/22443\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=22443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=22443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=22443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}