Windows如何并排(WINSXS)机制工作?

发布于 2025-01-25 14:55:29 字数 689 浏览 2 评论 0原文

如果我没有错,则如果应用程序在其清单中指定依赖关系,则Windows Loader将从c:\ Windows \ winsxs \ xxx \ xxx \文件夹中加载DLL的指定版本。

当我在c:\ Windows \ System32 \ dccw.exe - 这是Windows上的“显示颜色校准”应用程序时,我看到了这种奇怪的行为:

Application manifest has only one dependency - "Microsoft.Windows.Common-Controls"
 which is basically the - comctl32.dll

”“

但是,当您运行dccw.exe时,它会从winsxs folder加载两个dll; comctl32.dll如预期的,还gdiplus.dll

“”

不是gdiplus.dll的依赖性。还是我不明白winsxs的工作原理?

If I'm not wrong, if an application specifies dependency in its manifest, Windows loader will load the specified version of the DLL from C:\Windows\WinSxS\xxx\ folder.

While I was researching on C:\Windows\System32\dccw.exe - which is the "Display Color Calibration" app on windows, I saw this weird behavior:

Application manifest has only one dependency - "Microsoft.Windows.Common-Controls"
 which is basically the - comctl32.dll

However when you run dccw.exe, it loads two DLL from WinSXS folder; comctl32.dll as expected and also GdiPlus.dll.

Isn't a dependency for GdiPlus.dll should have been present in the manifest. Or did I not understand how WinSxS works correctly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一杆小烟枪 2025-02-01 14:55:29

不需要在应用程序清单中指定所有依赖项。您可以添加一些,但遗漏了其他。

正如汉斯在评论中提到的那样,gdiplus winsxssystem32中是同一文件的硬链接:

    > C:\Windows\system32>fsutil.exe hardlink list GdiPlus.dll

    \Windows\WinSxS\amd64_microsoft.windows.gdiplus.systemcopy_31bf3856ad364e35_10.0.
         19041.1645_none_5b73408eab60fd9c\GdiPlus.dll
    \Windows\System32\GdiPlus.dll

因此,从功能上讲,哪个无关紧要'复制该文件的加载。


关于为什么该过程似乎从winsxs加载...两个硬链接是难以区分。有没有任何记录建议WINSXS默认情况下用作DLL搜索位置。

这可能只是过程监视器选择报告文件位置(?)的方式。如果您与其他工具进行比较,例如(古)依赖关系沃克或依赖项您会得到不同的结果。一个显示winsxs位置,另一个显示system32

“在此处输入图像说明”

”

It is not required that all dependencies be specified in the application manifest. You can add some but leave out others.

As Hans mentioned in a comment, gdiplus under WinSxS is a hardlink to the same file in system32:

    > C:\Windows\system32>fsutil.exe hardlink list GdiPlus.dll

    \Windows\WinSxS\amd64_microsoft.windows.gdiplus.systemcopy_31bf3856ad364e35_10.0.
         19041.1645_none_5b73408eab60fd9c\GdiPlus.dll
    \Windows\System32\GdiPlus.dll

So functionally it doesn't matter which 'copy' of that file gets loaded.


As to WHY the process seems to load from WinSxS ... the two hard links are indistinguishable. There is nothing documented to suggest that WinSxS would be used as a DLL search location by default.

This may just be how Process Monitor chooses to report the file's location (?). If you compare to other tools like (archaic) Dependency Walker or Dependencies you get different results. One shows the WinSxS location, the other shows system32:

enter image description here

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文