WinSxS 如何将 DLL 名称解析为 DLL 位置?
如果我将一个模块链接到使用 WinSxS 部署的 mydll.dll,则我的模块中的 PE 标头将简单地引用“mydll.dll”。 Windows 在运行时如何确定,首先应该通过 WinSxS 加载此依赖项,其次它位于哪个程序集中?
If I link a module against mydll.dll, which is deployed using WinSxS, the PE header in my module will simply reference "mydll.dll". How does Windows determine at runtime, firstly that this dependency should be loaded via WinSxS, and secondly what assembly it's in?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它通过“激活上下文”来实现这一点。在我看来,在您了解激活上下文及其管理方式之前,WinSxS 没有任何意义。
我在 http://omnicognate.wordpress 上发表了一篇相当长的博客文章来解释详细信息.com/2009/10/05/winsxs/。
总结本文,激活上下文是 WinSxS 在运行时使用的一种结构,用于将未版本化的对象名称(例如 DLL 名称)解析为有关如何定位它们的完整信息。 WinSxS 中“清单”的目的是构建激活上下文。如果不了解这些激活上下文的构建方式和时间以及管理方式(它们保存在线程本地堆栈上),则无法推理通过 WinSxS 加载 DLL 所涉及的步骤,因此无法进行诊断可能出现的大多数问题。
It does so via the "activation context". In my opinion, WinSxS does not make any sense until you learn about the activation context and how it is managed.
I've put a rather long blog post explaining the details at http://omnicognate.wordpress.com/2009/10/05/winsxs/.
To summarise the article, the activation context is a structure that WinSxS uses at runtime to resolve unversioned object names (eg. DLL names) to the full information about how to locate them. The purpose of "manifests" in WinSxS is to construct activation contexts. Without understanding how and when these activation contexts are constructed and how they are managed (they are held on a thread-local stack), it is not possible to reason through the steps involved in loading a DLL via WinSxS and it is therefore impossible to diagnose the majority of problems that can arise.