forked from microsoft/WindowsAppSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DynamicDependencies: Use Win11 APIs if available (microsoft#3704)
DynamicDependencies: Use Win11 APIs if available Leverage the Win11 Dynamic Dependency API if available, otherwise use WinAppSDK's implementation (aka polyfill). The WinAppSDK DynDep C API handles this, thus benefiting all callers of WinAppSDK's C and WinRT DynDep API (e.g. C# via projections). This happens on Win11 >= 22H2 (aka SV2). NOTE: This makes the DDLM irrelevant on Win11 22H2+ (>SV2). A future (separate) PR will change the intaller to not install the DDLM packages on these systems. *NOTE:* Persisted definitions aren't imported into the OS after OSupgrade to Win11 22H2+. If you create a persisted definition (LifetimeKind=FilePath|RegistryKey) on older you'll need to re-create them after the OS upgrades. *NOTE:* MddGetResolvedPackageFullNameForPackageDependency()'s behavior differed from GetResolvedPackageFullNameForPackageDependency(). Both return null vs package full name when the PackageDependencyId is not resolved vs resolved but the HRESULT return value differed |PackageDependencyId|WinAppSDK |OS API| |-------------------|----------------------------------|------| |unknown |HRESULT_FROM_WIN32(ERROR_NO_MATCH)|S_OK | |not resolved |S_OK |S_OK | |resolved |S_OK |S_OK | MddGetResolvedPackageFullNameForPackageDependency() has been changed to match the OS API. A new OS API will be needed to distinguish between a known valid PackageDependencyId that's not been resolved yet vs an invalid/unknown PackageDependencyId. NOTE: This change is compatible with the documented behavior. It'll be noted in the release notes. NOTE: As a byproduct of return MddGetResolvedPackageFullNameForPackageDependency() error handling the WinRT APIs `PackageDependency.GetFromId()` and `PackageDependency.GetFromIdForSystem()` no longer fail for an unknown/invalid id e.g. `PackageDependency.GetFromId("not a valid id")`. Inappropriate later use will fail e.g. ``` var pd = PackageDependency.GetFromId("not a valid id"); var context = pd.Add(); // Add() fails and throws an exception ``` NOTE: A new OS API is needed to determine if a `PackageDependencyId` is a valid (known) value. WinAppSDK will be updated to use that when available. https://task.ms/47326537 NOTE: Did the work to support Win11 21H2 but the OS may not fully support it. Left IsSupported() unchanged (Win11 >=22H2) for now while I investigate further P.S. Increase test timeout to 120m
- Loading branch information
1 parent
202c9ef
commit f0d6f3b
Showing
54 changed files
with
1,050 additions
and
1,202 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.