A DLL entry that loads msvcr80.dll and provides the free () function

I have a third-party DLL that depends on the MSVCR80 and allocates the resources that I need to clean up. For this, the library does not provide the free function. Instead, I need to load the same runtime library and manually call the free function.

As a workaround, I'm trying to write a DLL wrapper that loads the correct runtime and provides a free function. This DLL is created using Visual Studio 2010 and depends on a separate runtime library. The execution of the LoadLibrary("msvcr80.dll") fails with error R6034, which I believe is caused by obvious problems.

Is it even possible to load msvcr80.dll using LoadLibrary ? Do I need to create a manifest, embed it in a DLL and store the msvcr80.dll file in the same directory as my DLL cover?

I understand that this is a flaw in a third-party library, but I'm pretty stuck in this version. Getting a provider to fix this is most likely not an option.

+6
source share
1 answer

There are probably better solutions, but if all else fails, you can find somewhere a copy of the VC ++ 2005 Express Edition (= free, piracy is not required ;) ) that uses version 8.0 of the compiler and therefore the same runtime defective dll.

Then you will create your dll wrapper for it, which will just call the free provided by its CRT (double check that you are using the dll version!).

+3
source

Source: https://habr.com/ru/post/897330/


All Articles