{"id":110136,"date":"2024-08-16T07:00:00","date_gmt":"2024-08-16T14:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=110136"},"modified":"2024-08-16T08:41:27","modified_gmt":"2024-08-16T15:41:27","slug":"20240816-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20240816-00\/?p=110136","title":{"rendered":"The case of the missing ordinal 380"},"content":{"rendered":"<p>A customer reported that some of their clients were getting an error message when running their program:<\/p>\n<blockquote class=\"q\">\n<p>contoso.exe &#8211; Ordinal Not Found<\/p>\n<p>The ordinal 380 could not be located in the dynamic link library C:\\Program Files\\Contoso\\Contoso.exe.<\/p>\n<\/blockquote>\n<p>The first thing to note is that this error message is misleading. It&#8217;s true that the missing ordinal is 380, but <tt>Contoso.exe<\/tt> is not the dynamic link library. Rather, it is the module that contains the reference to the missing ordinal. Unfortunately, the error message doesn&#8217;t tell us the DLL that lacks the desired ordinal 380 export. We&#8217;ll have to go find it ourselves.<\/p>\n<p>We can use the <tt>LINK \/DUMP \/IMPORTS<\/tt> command to find all the functions that <tt>Contoso.exe<\/tt> imports, and search for a 380.<\/p>\n<p>And there it is:<\/p>\n<pre>    COMCTL32.dll\r\n             100B76110 Import Address Table\r\n             100EC5868 Import Name Table\r\n                     0 time date stamp\r\n                     0 Index of first forwarder reference\r\n\r\n                             <span style=\"border: solid 1px currentcolor;\">Ordinal   380<\/span>\r\n<\/pre>\n<p>And if you look in <tt>comctl32.dll<\/tt> version 6, you&#8217;ll find that it&#8217;s<\/p>\n<pre>        380   7F 000C0DA0 LoadIconMetric\r\n<\/pre>\n<p>Okay, so they are trying to link to the function <code>Load\u00adIcon\u00adMetric<\/code> in <tt>comctl32.dll<\/tt>, and it&#8217;s not there.<\/p>\n<p>At this point, you may remember that there are two versions of <tt>comctl32.dll<\/tt>: Version 5 and version 6. Version 5 is the one you get by default, and to get version 6, you need to <a href=\"https:\/\/learn.microsoft.com\/windows\/win32\/controls\/cookbook-overview#using-manifests-or-directives-to-ensure-that-visual-styles-can-be-applied-to-applications\"> specify it in your application manifest<\/a>.<\/p>\n<p>The evidence suggests therefore that on the affected systems, something is wrong with their application manifest and the system is not processing it properly.<\/p>\n<p>The customer liaison took this information back to the customer. I haven&#8217;t heard back from them, so I&#8217;m hoping they figured out why their manifests aren&#8217;t working on some systems.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Untangling the error message and developing a theory.<\/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-110136","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Untangling the error message and developing a theory.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/110136","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=110136"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/110136\/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=110136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=110136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=110136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}