{"id":1195,"date":"2011-04-28T19:17:41","date_gmt":"2011-04-28T17:17:41","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=1195"},"modified":"2011-04-29T08:14:40","modified_gmt":"2011-04-29T06:14:40","slug":"if-your-application-is-looking-for-network-adapters-it-may-be-blind-to-see","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/1195","title":{"rendered":"If your application is looking for network adapters, it may be blind to see"},"content":{"rendered":"<p>A really long and annoying troubleshooting of a problem finally ended with a bug found in <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa365917%28VS.85%29.aspx\">GetAdaptersInfo<\/a>\/<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa365915%28VS.85%29.aspx\">GetAdaptersAddresses<\/a> API.<\/p>\n<p>It may unexpectedly fail under the following conditions:<\/p>\n<ul>\n<li>32-bit application<\/li>\n<li>64-bit operating system or \/3GB feature enabled on 32-bit operating system<\/li>\n<li>hosting process is linked with \/LARGEADDRESSAWARE flag or has otherwise set it in binary header<\/li>\n<li>over 2GB of RAM (in terms of Private Bytes\/Virtual Size performance counters) consumed by the hosting process<\/li>\n<\/ul>\n<p>The application might unexpectedly start getting ERROR_NO_DATA (232) or ERROR_NOACCESS (998) error codes instead of list of adapters. Supposedly, the responsible Microsoft component iplhlpapi.dll or one of the underlying components\/APIs are incompatible with such environments (such as for example, treating 32-bit pointer with the most significant bit set as invalid or compares such pointers as signed values).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1196\" title=\"GetAdaptersInfo Failure\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2011\/04\/Image0011.png\" alt=\"\" width=\"301\" height=\"214\" \/><\/p>\n<p>A test Visual C++ .NET 2010 application <a href=\"http:\/\/trac2.assembla.com\/roatl-utilities\/browser\/trunk\/GetAdaptersAddressesTest\">is  available from SVN<\/a>. More bug details on <a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/665383\/getadaptersaddresses-api-incorrectly-returns-no-adapters-for-a-process-with-high-memory-consumption\">Microsoft Connect<\/a>.<\/p>\n<p>NOTE 1: You need to run &#8220;GetAdaptersAddressesTest \/regserver&#8221; once to register the app before running it for the test.<\/p>\n<p>NOTE 2: The problem does not seem to take place with 32-bit operating systems with \/3GB tuning enabled.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A really long and annoying troubleshooting of a problem finally ended with a bug found in GetAdaptersInfo\/GetAdaptersAddresses API. It may unexpectedly fail under the following conditions: 32-bit application 64-bit operating system or \/3GB feature enabled on 32-bit operating system hosting process is linked with \/LARGEADDRESSAWARE flag or has otherwise set it in binary header over&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/1195\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,13],"tags":[256,63,38,340,59,250],"class_list":["post-1195","post","type-post","status-publish","format-standard","hentry","category-seriously","category-source","tag-adapter","tag-bug","tag-c","tag-connect","tag-microsoft","tag-network"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=1195"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1195\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=1195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=1195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=1195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}