Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions dev/WindowsAppRuntime_DLL/WindowsAppRuntime_DLL.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>onecore.lib;onecoreuap.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>WindowsAppRuntime.def</ModuleDefinitionFile>
<DelayLoadDLLs>Microsoft.Internal.FrameworkUdk.dll;shell32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>Microsoft.Internal.FrameworkUdk.dll;shell32.dll;rometadata.dll;xmllite.dll;userenv.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
Copy link
Copy Markdown
Member

@DrusTheAxe DrusTheAxe Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but this was not observed being called in a sample launch path

*What platforms did you observe this? WinAppSDK runs down to RS5 desktop (and server 2019) and the behavior and implementation varies.

xmllite.dll is required by UndockedRegFreeWinRT (parses Fusion manifests) and WinAppSDK Dynamic Dependencies (parses AppxManifest.xml)

On Windows >=Ge (10.0.26100.0) the DynDep APIs are passthrough to the OS DynDep and don't Detour OS APIs, and URFW is ignored entirely Detour'ing nothing (OS RegFreeWinRT handles RegFree WinRT demands).

Thus thus there's no value (negative value?) marking xmllite.dll as delay-load on <Ge, and VS doesn't support OS-version-dependent options for <DelayLoadDLLs>.

Does <DelayLoadDLLs> interfere with Detours? If so then deferring rometadata.dll would be bad - app may load but calls to e.g. ApiInformation will be problematic at runtime.

userenv.dll may be worthy of DelayLoad. Of course this assumes the app's code (and non-WinAppSDK libraries used by the app) have no need for userenv exports, especially if said exports were added after RS5. Failure to find a delay-load'd import at runtime would crash the app.

This concern is why we haven't routinely added <DelayLoadDLLs> to WinAppSDK's templates (it was suggested in a previous Issue or PR) -- we don't know all the ways apps are written, and delay-loading Windows DLLs isn't a routine thing developers expect by default (the Platform SDK and Visual Studio templates never defaulted to this behavior). If this goes wrong it likely will give developers a painful surprise. Is this worthy to set by default?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that the userenv.dll delay-load makes sense, as this is API-specific (conditional on client code).

I have no problem with xmllite.dll, since this scenario is bound to diminish with time, as more devices move up to Ge+.

The Detours concern is valid - have we tested to ensure that rometadata.dll is handled correctly if loaded after Detours is initialized?

Copy link
Copy Markdown
Member

@DrusTheAxe DrusTheAxe Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI xmllite.dll's used by various parts of Windows e.g. the Fusion manifest parser. If the exe has a Fusion manifest xmllite.dll was loaded as part of process creation so this is probably a warm load - already in disk cache so just need initialization for current process. That should be inexpensive, all things considered.

</Link>
<Midl>
<AdditionalIncludeDirectories>$(RepoRoot)\dev\common</AdditionalIncludeDirectories>
Expand All @@ -176,7 +176,7 @@
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>onecore.lib;onecoreuap.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>WindowsAppRuntime.def</ModuleDefinitionFile>
<DelayLoadDLLs>Microsoft.Internal.FrameworkUdk.dll;shell32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>Microsoft.Internal.FrameworkUdk.dll;shell32.dll;rometadata.dll;xmllite.dll;userenv.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<Midl>
<AdditionalIncludeDirectories>$(RepoRoot)\dev\common</AdditionalIncludeDirectories>
Expand All @@ -194,7 +194,7 @@
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>onecore.lib;onecoreuap.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>WindowsAppRuntime.def</ModuleDefinitionFile>
<DelayLoadDLLs>Microsoft.Internal.FrameworkUdk.dll;shell32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>Microsoft.Internal.FrameworkUdk.dll;shell32.dll;rometadata.dll;xmllite.dll;userenv.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<Midl>
<AdditionalIncludeDirectories>$(RepoRoot)\dev\common</AdditionalIncludeDirectories>
Expand All @@ -212,7 +212,7 @@
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>onecore.lib;onecoreuap.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>WindowsAppRuntime.def</ModuleDefinitionFile>
<DelayLoadDLLs>Microsoft.Internal.FrameworkUdk.dll;shell32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>Microsoft.Internal.FrameworkUdk.dll;shell32.dll;rometadata.dll;xmllite.dll;userenv.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<Midl>
<AdditionalIncludeDirectories>$(RepoRoot)\dev\common</AdditionalIncludeDirectories>
Expand All @@ -230,7 +230,7 @@
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>onecore.lib;onecoreuap.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>WindowsAppRuntime.def</ModuleDefinitionFile>
<DelayLoadDLLs>Microsoft.Internal.FrameworkUdk.dll;shell32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>Microsoft.Internal.FrameworkUdk.dll;shell32.dll;rometadata.dll;xmllite.dll;userenv.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<Midl>
<AdditionalIncludeDirectories>$(RepoRoot)\dev\common</AdditionalIncludeDirectories>
Expand All @@ -248,7 +248,7 @@
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>onecore.lib;onecoreuap.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>WindowsAppRuntime.def</ModuleDefinitionFile>
<DelayLoadDLLs>Microsoft.Internal.FrameworkUdk.dll;shell32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>Microsoft.Internal.FrameworkUdk.dll;shell32.dll;rometadata.dll;xmllite.dll;userenv.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<Midl>
<AdditionalIncludeDirectories>$(RepoRoot)\dev\common</AdditionalIncludeDirectories>
Expand Down