{"id":5416,"date":"2014-03-30T21:41:50","date_gmt":"2014-03-30T21:41:50","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/writing-a-dll-that-loads-msvcr80-dll-and-exposes-the-free-function-collection-of-common-programming-errors\/"},"modified":"2014-03-30T21:41:50","modified_gmt":"2014-03-30T21:41:50","slug":"writing-a-dll-that-loads-msvcr80-dll-and-exposes-the-free-function-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/writing-a-dll-that-loads-msvcr80-dll-and-exposes-the-free-function-collection-of-common-programming-errors\/","title":{"rendered":"Writing a DLL that loads msvcr80.dll and exposes the free()-function-Collection of common programming errors"},"content":{"rendered":"<p>I have a third-party DLL that depends on MSVCR80 and allocates resources that I need to cleanup. The library does <em>not<\/em> expose a <code>free<\/code>-function for doing this. Instead, I need to load the same runtime library and manually call the <code>free<\/code> function.<\/p>\n<p>As a workaround I&#8217;m trying to write a &#8220;wrapper&#8221; DLL that loads the correct runtime and exposes the <code>free<\/code> function. This DLL is created using Visual Studio 2010 and is dependent on a separate runtime library. Doing <code>LoadLibrary(\"msvcr80.dll\")<\/code> fails with error R6034 which I guess is because of manifest issues.<\/p>\n<p>Is it even possible to load msvcr80.dll using <code>LoadLibrary<\/code>? Do I need to create a manifest, embed it into the DLL and store msvcr80.dll in the same directory as my wrapper DLL?<\/p>\n<p>I realize that this is a flaw in the third-party library, but I&#8217;m pretty much stuck with this version. Getting the vendor to fix this is most likely not an option.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a third-party DLL that depends on MSVCR80 and allocates resources that I need to cleanup. The library does not expose a free-function for doing this. Instead, I need to load the same runtime library and manually call the free function. As a workaround I&#8217;m trying to write a &#8220;wrapper&#8221; DLL that loads the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5416","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5416"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5416\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}