{"id":16023,"date":"2009-11-16T07:00:00","date_gmt":"2009-11-16T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2009\/11\/16\/why-does-shlwapi-import-a-nonexistent-function\/"},"modified":"2009-11-16T07:00:00","modified_gmt":"2009-11-16T07:00:00","slug":"why-does-shlwapi-import-a-nonexistent-function","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20091116-00\/?p=16023","title":{"rendered":"Why does shlwapi import a nonexistent function?"},"content":{"rendered":"<p>Commenter charless asks <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/pages\/407234.aspx#681765\"> why shlwapi.dll imports a nonexistent function from mpr.dll<\/a>, which shows up in dependency tools as a broken import.\n Because that function did exist at one point, although it doesn&#8217;t exist any more.\n The function in question was available only on Windows&nbsp;95-series versions of Windows. It never existed on Windows&nbsp;NT or any of its successors. But remember that <code>shlwapi.dll<\/code> was originally developed for Internet Explorer, which ran on Windows&nbsp;95 as well as Windows&nbsp;NT. Internet Explorer checked the operating system and called the Windows&nbsp;95-only function only after verifying that it was running on Windows&nbsp;95. If it was running on Windows&nbsp;NT, then it never called the function and therefore never stepped on the land mine known as <code>ERROR_PROC_NOT_FOUND<\/code>.\n Okay, so why does <code>shlwapi<\/code> still link to the function long after the Windows&nbsp;95 series of operating systems have become obsolete?\n Removing a function, even a function that doesn&#8217;t do anything, even an <i>undocumented<\/i> function that doesn&#8217;t do anything, is a dangerous endeavor. Suppose you have a program that links to the function, but just like Internet Explorer, it is clever and checks whether it is running on Windows&nbsp;NT before calling it. If you remove the useless function from <code>shlwapi<\/code>, then that program will <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2003\/09\/16\/54938.aspx\"> fail to load<\/a>, even though it never calls the offending function, and now you have an application compatibility problem on your hands.\n Since it&#8217;s a small function that doesn&#8217;t do anything, it&#8217;s a lot less risky simply to leave the function in.<\/p>\n<p> Even though it doesn&#8217;t do anything except fail. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Commenter charless asks why shlwapi.dll imports a nonexistent function from mpr.dll, which shows up in dependency tools as a broken import. Because that function did exist at one point, although it doesn&#8217;t exist any more. The function in question was available only on Windows&nbsp;95-series versions of Windows. It never existed on Windows&nbsp;NT or any of [&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":[2],"class_list":["post-16023","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-history"],"acf":[],"blog_post_summary":"<p>Commenter charless asks why shlwapi.dll imports a nonexistent function from mpr.dll, which shows up in dependency tools as a broken import. Because that function did exist at one point, although it doesn&#8217;t exist any more. The function in question was available only on Windows&nbsp;95-series versions of Windows. It never existed on Windows&nbsp;NT or any of [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/16023","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=16023"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/16023\/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=16023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=16023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=16023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}