{"id":2073,"date":"2020-06-21T10:34:34","date_gmt":"2020-06-21T08:34:34","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=2073"},"modified":"2020-06-21T14:05:59","modified_gmt":"2020-06-21T12:05:59","slug":"getfileversioninfosize-and-api-sets","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/2073","title":{"rendered":"GetFileVersionInfoSize and API sets"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><code>GetFileVersionInfoSizeW<\/code> function in <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winver\/nf-winver-getfileversioninfosizew#requirements\">Requirements section<\/a> lists:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Minimum supported client<\/strong><\/td><td>Windows&nbsp;Vista [desktop apps only]<\/td><\/tr><tr><td><strong>Minimum supported server<\/strong><\/td><td>Windows Server&nbsp;2008 [desktop apps only]<\/td><\/tr><tr><td><strong>Target Platform<\/strong><\/td><td>Windows<\/td><\/tr><tr><td><strong>Header<\/strong><\/td><td>winver.h (include Windows.h)<\/td><\/tr><tr><td><strong>Library<\/strong><\/td><td>Version.lib<\/td><\/tr><tr><td><strong>DLL<\/strong><\/td><td>Api-ms-win-core-version-l1-1-0.dll<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">and this is inaccurate. The actual requirement DLL is api-ms-win-core-version-l1-1-1.dll instead. However, what does it mean exactly? <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/apiindex\/windows-apisets\">Windows API sets<\/a>:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>API Sets rely on operating system support in the library loader to effectively introduce a namespace redirection component into the library binding process. Subject to various inputs, including the API Set name and the binding (import) context, the library loader performs a runtime redirection of the reference to a target host binary that houses the appropriate implementation of the API Set.<\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>The decoupling between implementation and interface contracts provided by API Sets offers many engineering advantages, but can also potentially reduce the number of DLLs loaded in a process.<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">The &#8220;hyphen one&#8221; DLL (api-ms-win-core-version-l1-1-1.dll) is missing in Windows Server 2012 R2 and so the documented promise to offer support starting Windows Server\u00c2\u00a02008 is incorrect. Windows Server 2012 R2 has only &#8220;hyphen zero&#8221; DLL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The hyphen zero DLL exposes, however, <code>GetFileVersionInfoSizeExW<\/code> entry point so the application developers addressing backward compatibility should switch from use of <code>GetFileVersionInfoSize<\/code> to <code>GetFileVersionInfoSizeEx<\/code> even though the former is not documented as deprecated explicitly (probably another out of date aspect of the documentation).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The same applies to <code>GetFileVersionInfo<\/code> functions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also related, this part of MSDN documentation <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/apiindex\/windows-81-api-sets\">API Sets available in Windows 8.1 and Windows Server 2012 R2<\/a> looks good and has no mention of <code>GetFileVersionInfoSize<\/code> and <code>GetFileVersionInfo<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GetFileVersionInfoSizeW function in Requirements section lists: Minimum supported client Windows&nbsp;Vista [desktop apps only] Minimum supported server Windows Server&nbsp;2008 [desktop apps only] Target Platform Windows Header winver.h (include Windows.h) Library Version.lib DLL Api-ms-win-core-version-l1-1-0.dll and this is inaccurate. The actual requirement DLL is api-ms-win-core-version-l1-1-1.dll instead. However, what does it mean exactly? Windows API sets: API Sets rely&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/2073\">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":[1],"tags":[581],"class_list":["post-2073","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-winapi-2"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/2073","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=2073"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/2073\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=2073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=2073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=2073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}