Could we have 2 DLLs with the same name being loaded in one process

后端 未结 2 697
心在旅途
心在旅途 2020-12-20 16:07

I am talking about win32 dlls, those plain pe files. I am confused after I doing a test compared to what I saw in explorer.exe process.

  1. I wrote a test with

相关标签:
2条回答
  • 2020-12-20 16:19

    It basically depens on if you load the dll with its full path or only by file name. The LoadLibraryEx docs cover this pretty well:

    If lpFileName does not include a path and there is more than one loaded module with the same base name and extension, the function returns a handle to the module that was loaded first.

    0 讨论(0)
  • 2020-12-20 16:34

    See http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/b3eaa07f-7f92-4693-8aa1-b8fee0b92d2f/ for a good discussion on how this can be done implicitly for WinXP and up, by activation context (manifests) to control the loading.

    0 讨论(0)
提交回复
热议问题