简体   繁体   中英

How does windows handle loading two different versions of a DLL?

Question

I am writing a software that uses a specific DLL version. I have located the specific DLL in the execution directory, so the program uses that one. But now i don't know what happens if the specific DLL is loaded and a other program is started that need a newer version. Does anyone know what will happen? Does the other program crash or does mine crash?

Other

This question is for the OS: Windows 10 and windows 7. The workstation is is running windows updates so the DLL will be up to date. Writing code in C++.

Different dlls can be loaded in different processes.

The address spaces of the different processes are independent, and will not interfere with each other.

If the DLL uses a global named thing (eg file on disk, mutex, shared memory), then the interoperability of the specific dll could interfere with each other.

If they had a single path to the database, which was at version 12, if the older DLL didn't understand version 12, it may crash.

Two different versions of the same DLL can be loaded using LoadLibrary into the same process. This will require one DLL being called through GetProcAddress, or some other secondary method, but both DLLs can exist and work in the same process.

Two DLLs in the same process can also interfere when accessing named objects.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM