在相同的过程中加载dll的多个副本 [英] Load multiple copies of dll in same process

查看:153
本文介绍了在相同的过程中加载dll的多个副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由第三方生成的dll,它具有某种内部数据结构,将其大小限制为X元素。

I have a dll produced by a third party that has some sort of internal datastructure that limits it's size to X elements.

所以基本上,它有一个队列X作为限制。

So basically, it has a Queue with X as the limit.

现在从我所知道的DLL是每个进程,但是可以多次加载DLL吗?也许每个线程?在C#中?或者在C ++ / CLI中?

Now from what I've known DLL's are per process, but is it possible to load a DLL more than once? Maybe per thread? In C#? or in C++/CLI?

我正在尝试加载本机c ++ dll。

I'm trying to load a native c++ dll.

推荐答案

不幸的是,NT核心 DLL加载程序不要公开公共接口来跳过已经加载的DLL的池。因此,您只剩下几个选择:

Unfortunately, the NT core DLL loader routines don't expose a public interface to skip the pool of already-loaded DLLs. As such, you're left with just a few choices:


  • 复制,硬链接,符号链接和/或使用重新分解点来愚弄加载器认为你有多个不同的DLL。

  • 使用多个进程,每个进程加载一个DLL。

  • 编写一个新的DLL加载器引导DLL的供应商修复它(可能比编写DLL加载器更困难)。

这篇关于在相同的过程中加载dll的多个副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆