-
Notifications
You must be signed in to change notification settings - Fork 433
[1.8 servicing] Delay load RoMetadata, XmlLite, userenv dlls in WindowsAppRuntime #6401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Hemantxk
wants to merge
1
commit into
release/1.8-stable
Choose a base branch
from
user/hemakumar/delayLoad
base: release/1.8-stable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*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.dllas delay-load on <Ge, and VS doesn't support OS-version-dependent options for<DelayLoadDLLs>.Does
<DelayLoadDLLs>interfere with Detours? If so then deferringrometadata.dllwould be bad - app may load but calls to e.g.ApiInformationwill 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?There was a problem hiding this comment.
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?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.