{"id":93194,"date":"2016-03-24T07:00:00","date_gmt":"2016-03-24T21:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=93194"},"modified":"2019-03-13T10:31:47","modified_gmt":"2019-03-13T17:31:47","slug":"20160324-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20160324-00\/?p=93194","title":{"rendered":"Why does PathIsUNC say that paths that begin with \\\\?\\ are not UNCs?"},"content":{"rendered":"<p>An application vendor opened a bug with the product team saying that <a HREF=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/bb773712(v=vs.85).aspx\">the <code>Path&shy;Is&shy;UNC<\/code> function<\/a> was returning incorrect values in Windows Vista. Specifically, the <code>Path&shy;Is&shy;UNC<\/code> function was returning <code>FALSE<\/code> for strings that begin with <code>\\\\?\\<\/code>, whereas Windows XP returned <code>TRUE<\/code>. <\/p>\n<p>The answer is, &#8220;Yes, the <code>Path&shy;Is&shy;UNC<\/code> function returns <code>FALSE<\/code> for strings that begin with <code>\\\\?\\<\/code>. Because they aren&#8217;t UNCs.&#8221; <\/p>\n<p>There was a bug in the Windows XP version of the <code>Path&shy;Is&shy;UNC<\/code> function where it reported that anything that began with two backslashes was a UNC, even if it wasn&#8217;t. In particular, paths that begin with <code>\\\\?\\<\/code> are not UNCs, unless they happen to begin with <code>\\\\?\\UNC\\<\/code>. The bug was fixed in Windows Vista so it returned <code>TRUE<\/code> only if the <code>\\\\?\\<\/code> is followed by <code>UNC\\<\/code>. <\/p>\n<p>Fortunately, the application compatibility team had a ready answer for this: The <a HREF=\"https:\/\/technet.microsoft.com\/en-us\/library\/cc722305(v=ws.10).aspx\">Emulate&shy;Old&shy;Path&shy;Is&shy;UNC<\/code><\/a> compatibility shim returns the <code>Path&shy;Is&shy;UNC<\/code> function to its old behavior that is bug-for-bug compatible with Windows XP. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Because they aren&#8217;t.<\/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-93194","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Because they aren&#8217;t.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/93194","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=93194"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/93194\/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=93194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=93194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=93194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}