Windows如何并排(WINSXS)机制工作?
如果我没有错,则如果应用程序在其清单中指定依赖关系,则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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不需要在应用程序清单中指定所有依赖项。您可以添加一些,但遗漏了其他。
正如汉斯在评论中提到的那样,
gdiplus
winsxs
在system32
中是同一文件的硬链接:因此,从功能上讲,哪个无关紧要'复制该文件的加载。
关于为什么该过程似乎从
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
underWinSxS
is a hardlink to the same file insystem32
: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 showssystem32
: