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?
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
: