Skip to content
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

Delegate to OS RegFreeWinRT when available (>=24H1) #4728

Merged
merged 35 commits into from
Nov 23, 2024

Conversation

DrusTheAxe
Copy link
Member

@DrusTheAxe DrusTheAxe commented Sep 17, 2024

Delegate to OS RegFreeWinRT when available (>=24H1)

Don't detour APIs to our Undocked Reg-Free WinRT implementation if the OS supports Reg-Free WinRT (>=24H1)

https://task.ms/47326505

@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

…se). Added -CheckTAEFService -CheckVisualStudio -CheckDeveloperMode to 'DevCheck: Setup/Verify developer environment' to cover the missing checks
@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

…S RFW on >=24H1 (where DynDep will delegate to OS DynDep). Fixed some bad sprintfs. Changed Is*Supported(PackageDeploymentFeature::PackageUriScheme_ms_uup) to use the Is*Supported function
@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe DrusTheAxe changed the title Delegate to OS RegFreeWinRT when available (>=19H1) Delegate to OS RegFreeWinRT when available (>=24H1) Nov 14, 2024
Copy link

@wcheng-msft wcheng-msft left a comment

Choose a reason for hiding this comment

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

:shipit:

@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DrusTheAxe
Copy link
Member Author

Eyeballed 24H2 Run TAEF Tests logs verifying success:

DynamicDependency_Test_Win32.dll Summary: Total=71, Passed=71, Failed=0, Blocked=0, Not Run=0, Skipped=0

DynamicDependency_Test_WinRT.dll Summary: Total=36, Passed=36, Failed=0, Blocked=0, Not Run=0, Skipped=0

Fire in the hole!

@DrusTheAxe DrusTheAxe merged commit 6839e95 into main Nov 23, 2024
26 checks passed
@DrusTheAxe DrusTheAxe deleted the user/drustheaxe/no-urfw branch November 23, 2024 06:46
@@ -237,15 +239,23 @@ namespace Test::ApplicationData::Tests
TEST_METHOD(MachineFolderAndPath_Main_NotSupported)
{
winrt::hstring packageFamilyName{ Main_PackageFamilyName };
WEX::Logging::Log::Comment(WEX::Common::String().Format(L"A1: %ls", packageFamilyName.c_str()));
Copy link
Member

Choose a reason for hiding this comment

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

Nit, too late I guess - questionable indentation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually leftover debugging code. Harmless but should go. I'll clean it up in a follow up PR.

@@ -33,30 +33,35 @@ inline bool IsExportPresent(

inline bool IsWindows10_19H1OrGreater()
{
// GetPackageInfo2() added to kernelbase.dll in NTDDI_WIN10_19H1 (aka 19H1)
// GetPackageInfo2() added to kernelbase.dll in 19H1 (aka NTDDI_WIN10_19H1)
return IsExportPresent(L"kernelbase.dll", "GetPackageInfo2");
Copy link
Member

Choose a reason for hiding this comment

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

Here's where Gov would ask you to probe for specific features, rather than a blanket "am I on Win10 20H1"

Copy link
Member Author

Choose a reason for hiding this comment

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

This is used sparingly, primarily where we need to detect downlevel behavior or implementation details that has no overt advertisement or detection mechanism. But now I'm curious. I'll do an all up review and see if some of these can be changed to more direct feature-probing-for-feature-behavior. Thanks for sparking the itch

kythant added a commit that referenced this pull request Dec 4, 2024
kythant added a commit that referenced this pull request Dec 4, 2024
DrusTheAxe added a commit that referenced this pull request Dec 10, 2024
codendone pushed a commit that referenced this pull request Jan 10, 2025
* Delegate to OS RegFreeWinRT when available (>=19H1)

* Changed DevCheck to emit expected TAEF version found (not just -Verbose). Added -CheckTAEFService -CheckVisualStudio -CheckDeveloperMode to 'DevCheck: Setup/Verify developer environment' to cover the missing checks

* Removed redundant checks done later in pipelines

* Added diagnostics for troubleshooting. Fixed compiler warnings

* More debuggery

* Added IsWindows11_24H2OrGreater(). Changed URFW to only delegate to OS RFW on >=24H1 (where DynDep will delegate to OS DynDep). Fixed some bad sprintfs. Changed Is*Supported(PackageDeploymentFeature::PackageUriScheme_ms_uup) to use the Is*Supported function

* More diagnostics

* Bumped TAEF to latest version 10.95.240918004

* Moar debugging

* Fixes

* Minor fix

* Removed previous interim block disabling Dynamic Dependencies delegation to OS Dynamic Dependencies. Let's take it for a spin and see how it handles...

* Fixed DevCheck not getting VS' path thus not checking VS stuff

* Split IsReady tests into RestrictedUser vs ElevatedUser

* Fix mis-tagging of TAEF properties (though according to TAEF folks TEST_CLASS_PROPERTY is treated same as TEST_METHOD_PROPERTY if inside a BEGIN/END_METHOD_PROPERTIES() block because it's been a common mistake, so TAEF now treats it effectively as TEST_PROPERTY() scoped to the surrounding BEGIN/END_*_PROPERTY()

* DevCheck -SyncDependencies update

* Removed FrameworkUdk references in packages.config. Added Build Dependencies in WindowsAppRuntime.sln for anything using FrUdk on the Microsoft.FrameworkUdk.PackageReferences.csproj as th SexyNewfangledWay(TM) to restore FrameworkUdk (when necessary)

* PackageManager test tweaks

* Expanded enablement for further test investigation

* Fixed test to account for OS vs WinAppSDK error detection

* Fixed RegisterNewerIfAvailable

* Removed 22H2 testing

* Fixed h/cpp mismatch

* Removed non-existent GUID/reference (bad merge?)

* Fixed test bug not handling all behavior coming out of OS API

* Fixed tests

* Updated WinRT tests akin to Win32
codendone pushed a commit that referenced this pull request Jan 10, 2025
DrusTheAxe added a commit that referenced this pull request Feb 4, 2025
…#4935) (#4949)

* Reapply "Delegate to OS RegFreeWinRT when available (>=24H1) (#4728)" (#4935)

This reverts commit c088336.

* Added missing dependencies for OAuth2ManagerTests

* Expanded tests

* Modified IsSupported with temporary debugging hack to expedite testing. Added local hackery for Architectures=None (but is it needed?)

* Removed debug hackery

* Test fixes

* More test fiddling

* Microsoft.Windows.BadgeNotifications.Projection project is missing a build-order dependency on WindowsAppRuntime_DLL so depending on timing and beefy machine it can try to build before the dependency is built and boom :-(

* Removed redundant Import

* Fixed bad merge

* Fixed WinAppSDK framework package family name construction in GetFrameworkPackageFamilyName() [MddBootstrap.cpp]. This is used in production when delegating to OS DynDep but not when using WinAppSDK DynDep (and test support used different codepath). That's why test packages with blah-major.minor... package names worked in test and on Win10 but not when delegating to OS DynDep on Win11. Added additional test tools to aid verification and debugging (now and in any future changes).

* Fixed DevCheck -CheckDependencies if packages.config has no <package> elements. Ran DevCheck -SyncDependencies to update stale dependencies

* Fix test framework package Name from name-major.minor to name.major.minor

* Workaround Windows bug https://task.ms/54835001 where IsPackage*ReadyOrNewerAvailable() doesn't correctly handle ProcessorArchitectureFilter=None

* Ran devcheck -syncdependencies

* Fixed failing PackageManagementTests

* Updated dependnecies via DevCheck -SyncDependencies. Removed unused Microsoft.Windows.SDK.BuildTools and Microsoft.WindowsAppSDK references in WindowsAppRuntime_UniversalBGTaskDLL's packages.config. Removed dead readme.txt in WindowsAppRuntime_UniversalBGTaskDLL projectdir (artifact of VS File/NewProject...).

* Updated link to latest SDK rev

* Fixed dependencies (syntax and usage

* Put WindowsAppRuntime_UniversalBGTaskDLL back to what's in main. No idea why that works but changing it -- in what should be innocuous ways -- breaks local + pipeline builds. Deferring that problem to Will Thant in its own right (not relevant to my changes)

* Fixed hardcoded versions in OAuthTestApp.vcxproj (wasn't using version macro)

* Fixed more bad projects - Import Microsoft.Cpp.Default.props not at the top, .. pathing to nugets and hardwired nuget versions

* Fixed WindowsAppRuntime_UniversalBGTaskDLL - Import Microsoft.Cpp.Default.props not at top of file, not using $(NugetPackageDirectory) for pathing to nugets, hardwired versions for nugets, unnecessary Microsoft.WindowsAppSDK in packages.config

* Added -ShowSystemInfo (default=$true) to Testall so test run output includes basic system info

* Fixed up test Main+Singleton+DDLM naming/constants

* Fixed bug in package name constant

* Added missing project dependencies. Updated ConfigurationManager to build test packages on ARM64 too (some were only build for x64|x86)

* Fixed bad merge

* Fixed a bad merge

* Removed temporary debugging code

* Some test packages lacked ARM64 support, plus those and others weren't getting built for ARM64. And some projects built not-ARM64 for ARM64. Mostly fixed. Some test projects lack ARM64 support but not touched as not blocking here and overdue already; they can (and will) be handled in a separate follow up effort

* Fixed one more ARM configuration manager misconfiguration

---------

Co-authored-by: Kyaw Thant <[email protected]>
DrusTheAxe added a commit that referenced this pull request Feb 6, 2025
…#4935) (#4949)

* Reapply "Delegate to OS RegFreeWinRT when available (>=24H1) (#4728)" (#4935)

This reverts commit c088336.

* Added missing dependencies for OAuth2ManagerTests

* Expanded tests

* Modified IsSupported with temporary debugging hack to expedite testing. Added local hackery for Architectures=None (but is it needed?)

* Removed debug hackery

* Test fixes

* More test fiddling

* Microsoft.Windows.BadgeNotifications.Projection project is missing a build-order dependency on WindowsAppRuntime_DLL so depending on timing and beefy machine it can try to build before the dependency is built and boom :-(

* Removed redundant Import

* Fixed bad merge

* Fixed WinAppSDK framework package family name construction in GetFrameworkPackageFamilyName() [MddBootstrap.cpp]. This is used in production when delegating to OS DynDep but not when using WinAppSDK DynDep (and test support used different codepath). That's why test packages with blah-major.minor... package names worked in test and on Win10 but not when delegating to OS DynDep on Win11. Added additional test tools to aid verification and debugging (now and in any future changes).

* Fixed DevCheck -CheckDependencies if packages.config has no <package> elements. Ran DevCheck -SyncDependencies to update stale dependencies

* Fix test framework package Name from name-major.minor to name.major.minor

* Workaround Windows bug https://task.ms/54835001 where IsPackage*ReadyOrNewerAvailable() doesn't correctly handle ProcessorArchitectureFilter=None

* Ran devcheck -syncdependencies

* Fixed failing PackageManagementTests

* Updated dependnecies via DevCheck -SyncDependencies. Removed unused Microsoft.Windows.SDK.BuildTools and Microsoft.WindowsAppSDK references in WindowsAppRuntime_UniversalBGTaskDLL's packages.config. Removed dead readme.txt in WindowsAppRuntime_UniversalBGTaskDLL projectdir (artifact of VS File/NewProject...).

* Updated link to latest SDK rev

* Fixed dependencies (syntax and usage

* Put WindowsAppRuntime_UniversalBGTaskDLL back to what's in main. No idea why that works but changing it -- in what should be innocuous ways -- breaks local + pipeline builds. Deferring that problem to Will Thant in its own right (not relevant to my changes)

* Fixed hardcoded versions in OAuthTestApp.vcxproj (wasn't using version macro)

* Fixed more bad projects - Import Microsoft.Cpp.Default.props not at the top, .. pathing to nugets and hardwired nuget versions

* Fixed WindowsAppRuntime_UniversalBGTaskDLL - Import Microsoft.Cpp.Default.props not at top of file, not using $(NugetPackageDirectory) for pathing to nugets, hardwired versions for nugets, unnecessary Microsoft.WindowsAppSDK in packages.config

* Added -ShowSystemInfo (default=$true) to Testall so test run output includes basic system info

* Fixed up test Main+Singleton+DDLM naming/constants

* Fixed bug in package name constant

* Added missing project dependencies. Updated ConfigurationManager to build test packages on ARM64 too (some were only build for x64|x86)

* Fixed bad merge

* Fixed a bad merge

* Removed temporary debugging code

* Some test packages lacked ARM64 support, plus those and others weren't getting built for ARM64. And some projects built not-ARM64 for ARM64. Mostly fixed. Some test projects lack ARM64 support but not touched as not blocking here and overdue already; they can (and will) be handled in a separate follow up effort

* Fixed one more ARM configuration manager misconfiguration

---------

Co-authored-by: Kyaw Thant <[email protected]>
DrusTheAxe added a commit that referenced this pull request Feb 8, 2025
…ailable (>=24H1) (#5112)

* Reapply "Delegate to OS RegFreeWinRT when available (>=24H1) (#4728)" (#4935) (#4949)

* Reapply "Delegate to OS RegFreeWinRT when available (>=24H1) (#4728)" (#4935)

This reverts commit c088336.

* Added missing dependencies for OAuth2ManagerTests

* Expanded tests

* Modified IsSupported with temporary debugging hack to expedite testing. Added local hackery for Architectures=None (but is it needed?)

* Removed debug hackery

* Test fixes

* More test fiddling

* Microsoft.Windows.BadgeNotifications.Projection project is missing a build-order dependency on WindowsAppRuntime_DLL so depending on timing and beefy machine it can try to build before the dependency is built and boom :-(

* Removed redundant Import

* Fixed bad merge

* Fixed WinAppSDK framework package family name construction in GetFrameworkPackageFamilyName() [MddBootstrap.cpp]. This is used in production when delegating to OS DynDep but not when using WinAppSDK DynDep (and test support used different codepath). That's why test packages with blah-major.minor... package names worked in test and on Win10 but not when delegating to OS DynDep on Win11. Added additional test tools to aid verification and debugging (now and in any future changes).

* Fixed DevCheck -CheckDependencies if packages.config has no <package> elements. Ran DevCheck -SyncDependencies to update stale dependencies

* Fix test framework package Name from name-major.minor to name.major.minor

* Workaround Windows bug https://task.ms/54835001 where IsPackage*ReadyOrNewerAvailable() doesn't correctly handle ProcessorArchitectureFilter=None

* Ran devcheck -syncdependencies

* Fixed failing PackageManagementTests

* Updated dependnecies via DevCheck -SyncDependencies. Removed unused Microsoft.Windows.SDK.BuildTools and Microsoft.WindowsAppSDK references in WindowsAppRuntime_UniversalBGTaskDLL's packages.config. Removed dead readme.txt in WindowsAppRuntime_UniversalBGTaskDLL projectdir (artifact of VS File/NewProject...).

* Updated link to latest SDK rev

* Fixed dependencies (syntax and usage

* Put WindowsAppRuntime_UniversalBGTaskDLL back to what's in main. No idea why that works but changing it -- in what should be innocuous ways -- breaks local + pipeline builds. Deferring that problem to Will Thant in its own right (not relevant to my changes)

* Fixed hardcoded versions in OAuthTestApp.vcxproj (wasn't using version macro)

* Fixed more bad projects - Import Microsoft.Cpp.Default.props not at the top, .. pathing to nugets and hardwired nuget versions

* Fixed WindowsAppRuntime_UniversalBGTaskDLL - Import Microsoft.Cpp.Default.props not at top of file, not using $(NugetPackageDirectory) for pathing to nugets, hardwired versions for nugets, unnecessary Microsoft.WindowsAppSDK in packages.config

* Added -ShowSystemInfo (default=$true) to Testall so test run output includes basic system info

* Fixed up test Main+Singleton+DDLM naming/constants

* Fixed bug in package name constant

* Added missing project dependencies. Updated ConfigurationManager to build test packages on ARM64 too (some were only build for x64|x86)

* Fixed bad merge

* Fixed a bad merge

* Removed temporary debugging code

* Some test packages lacked ARM64 support, plus those and others weren't getting built for ARM64. And some projects built not-ARM64 for ARM64. Mostly fixed. Some test projects lack ARM64 support but not touched as not blocking here and overdue already; they can (and will) be handled in a separate follow up effort

* Fixed one more ARM configuration manager misconfiguration

---------

Co-authored-by: Kyaw Thant <[email protected]>

* Bootstrapper missed an update resulting in FindDDLMViaEnumeration() looking for DDLM packages named ...ddlm-version... rather than ...ddlm.version... Local tests passed as they were named with dash but product DDLMs are named with . causing toplevel tests using production packages to fail. Fixed and updated local tests to use naming consistent with product to prevent future confusion (#5106)

---------

Co-authored-by: Kyaw Thant <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants