{"id":12993,"date":"2010-08-31T07:00:00","date_gmt":"2010-08-31T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2010\/08\/31\/shutdown-reason-codes-are-reason-codes-not-error-codes-or-hresults\/"},"modified":"2010-08-31T07:00:00","modified_gmt":"2010-08-31T07:00:00","slug":"shutdown-reason-codes-are-reason-codes-not-error-codes-or-hresults","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20100831-00\/?p=12993","title":{"rendered":"Shutdown reason codes are reason codes, not error codes or HRESULTs"},"content":{"rendered":"<p>\nA customer liaison asked the following question on behalf of\nhis customer:\n<\/p>\n<blockquote CLASS=\"q\">\n<p>\nMy customer is finding that their Windows Server 2003 system has\nrestarted, and they want to find out why.\nI&#8217;ve found some event log similar to the ones below,\nbut I don&#8217;t know what error code <code>0x84020004<\/code> is.\nI&#8217;ve searched the Knowledge Base but couldn&#8217;t find anything relevant.\nPlease let me know why the system restarted.\n<\/p>\n<pre>\nEvent Type: Information\nEvent Source: USER32\nEvent Category: None\nEvent ID: 1074\nDate: 3\/20\/2009\nTime: 11:51:30 AM\nUser: GROUP1\\infraadmin\nComputer: DATA2\nDescription:\nThe process Explorer.EXE has initiated the shutdown of computer SYSP1 on behalf\nof user GROUP1\\infraadmin for the following reason: Operating System:\nReconfiguration (Planned)\nReason Code: 0x84020004\nShutdown Type: restart\nComment:\n<\/pre>\n<\/blockquote>\n<p>\nThe value <code>0x84020004<\/code> is not an error code.\nIt says right there that it&#8217;s a reason code:\n<\/p>\n<pre>\n<u>Reason Code<\/u>: 0x84020004\n<\/pre>\n<p>\nThe system shutdown reason codes\nare documented in MSDN under the devious heading\n<a HREF=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa376885.aspx\">\nSystem Shutdown Reason Codes<\/a>.\nIn this case, the value <code>0x84020004<\/code> is a combination of\n<\/p>\n<pre>\nSHTDN_REASON_FLAG_PLANNED               0x80000000\nSHTDN_REASON_FLAG_CLEAN_UI              0x04000000 \/\/ reason.h\nSHTDN_REASON_MAJOR_OPERATINGSYSTEM      0x00020000\nSHTDN_REASON_MINOR_RECONFIG             0x00000004\n<\/pre>\n<p>\nThat value for <code>SHTDN_REASON_FLAG_CLEAN_UI<\/code> is missing\nfrom the MSDN documentation for some reason, but&#8217;s listed in\n<code>reason.h<\/code>.\nThe flag means that the system was shut down in a controlled manner,\nas opposed to <code>SHDTN_REASON_FLAG_DIRTY_UI<\/code> which means\nthat the system lost power and did not go through a clean shutdown.\n<\/p>\n<p>\nIn other words, this was a planned shutdown that was the result\nof an operating system reconfiguration.\nPerhaps somebody changed a system setting in the Control Panel,\nand in response to the question\n&#8220;The change you made requires that the system be restarted.\nRestart now?&#8221;, the person said Yes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A customer liaison asked the following question on behalf of his customer: My customer is finding that their Windows Server 2003 system has restarted, and they want to find out why. I&#8217;ve found some event log similar to the ones below, but I don&#8217;t know what error code 0x84020004 is. I&#8217;ve searched the Knowledge Base [&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":[104],"class_list":["post-12993","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>A customer liaison asked the following question on behalf of his customer: My customer is finding that their Windows Server 2003 system has restarted, and they want to find out why. I&#8217;ve found some event log similar to the ones below, but I don&#8217;t know what error code 0x84020004 is. I&#8217;ve searched the Knowledge Base [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/12993","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=12993"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/12993\/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=12993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=12993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=12993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}