{"id":73,"date":"2014-09-04T07:00:00","date_gmt":"2014-09-04T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2014\/09\/04\/aha-i-have-found-a-flaw-in-the-logic-to-detect-whether-my-program-is-running-on-64-bit-windows\/"},"modified":"2014-09-04T07:00:00","modified_gmt":"2014-09-04T07:00:00","slug":"aha-i-have-found-a-flaw-in-the-logic-to-detect-whether-my-program-is-running-on-64-bit-windows","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20140904-00\/?p=73","title":{"rendered":"Aha, I have found a flaw in the logic to detect whether my program is running on 64-bit Windows"},"content":{"rendered":"<p>Some time ago, I described <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2005\/02\/01\/364563.aspx\"> how to detect programmatically whether you are running on 64-bit Windows<\/a>, and one of the steps of the algorithm was &#8220;If you are a 64-bit program, then you are running on 64-bit Windows, because 32-bit Windows cannot run 64-bit programs.&#8221;\n Every so often, somebody will claim that they found a flaw in this logic: &#8220;This algorithm may work today, but it assumes that the only version of Windows that can run 64-bit applications is 64-bit Windows. What if a future <a href=\"http:\/\/web.archive.org\/web\/20091010165416\/http:\/\/blog.eightforums.com\/windows_8\/windows-8-x128-the-next-pc-revolution-has-is-begun\/\"> non-64-bit version of version of Windows<\/a> runs 64-bit applications? Then your algorithm will incorrectly say that it is running on 64-bit Windows!&#8221;\n Yeah, but so what?\n Suppose you detect that the program is running on this hypothetical version of Windows that is not natively 64-bit but still runs 64-bit applications. What will your program do differently? How can you reason about the feature set and compatibility requirements of something that hasn&#8217;t been invented yet?\n This is another case of <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2013\/04\/17\/10411656.aspx\"> <i>If you don&#8217;t know what you&#8217;re going to do with the answer to a question, then there&#8217;s not much point in asking it<\/i><\/a>.<\/p>\n<p> In this specific case, you should just continue about your normal business and <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2008\/12\/22\/9244582.aspx\"> let the emulation layer<\/a> of the hypothetical future version of Windows do its job of giving you a 64-bit sky with 64-bit birds in the 64-bit trees. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some time ago, I described how to detect programmatically whether you are running on 64-bit Windows, and one of the steps of the algorithm was &#8220;If you are a 64-bit program, then you are running on 64-bit Windows, because 32-bit Windows cannot run 64-bit programs.&#8221; Every so often, somebody will claim that they found a [&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-73","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Some time ago, I described how to detect programmatically whether you are running on 64-bit Windows, and one of the steps of the algorithm was &#8220;If you are a 64-bit program, then you are running on 64-bit Windows, because 32-bit Windows cannot run 64-bit programs.&#8221; Every so often, somebody will claim that they found a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/73","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=73"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/73\/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=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}