在同一进程中加载 dll 的多个副本
我有一个由第三方生成的 dll,它具有某种内部数据结构,将其大小限制为 X 元素。
所以基本上,它有一个以 X 为限制的队列。
现在据我所知,DLL 是每个进程的,但是是否可以多次加载 DLL?也许每个线程?在 C# 中?或者在 C++/CLI 中?
我正在尝试加载本机 C++ dll。
I have a dll produced by a third party that has some sort of internal datastructure that limits it's size to X elements.
So basically, it has a Queue with X as the limit.
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?
I'm trying to load a native c++ dll.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,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 的多个副本,然后动态加载它们。
The only way you can do it is by having multiple copies of the same dll, and then load them dynamically.