From b58e43381303708852436bdd8bce1d17ee36720b Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Sat, 9 Nov 2024 18:24:05 -0800 Subject: [PATCH 01/24] Start of project. --- WindowsAppRuntime.sln | 4 +++ .../CompatibilityOptions.idl | 28 +++++++++++++++++++ .../CompatibilityOptions.vcxitems | 19 +++++++++++++ .../WindowsAppRuntime_DLL.vcxproj | 5 ++-- docs/Coding-Guidelines/GettingStarted.md | 2 +- 5 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 dev/CompatibilityOptions/CompatibilityOptions.idl create mode 100644 dev/CompatibilityOptions/CompatibilityOptions.vcxitems diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln index 266ae49a34..d223fe0843 100644 --- a/WindowsAppRuntime.sln +++ b/WindowsAppRuntime.sln @@ -566,6 +566,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IXP", "IXP", "{7B323048-439 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IXP.TransportPackage.PackageReference", "eng\PackageReference\IXP\IXP.TransportPackage.PackageReference.csproj", "{A949149D-29CA-4AA7-B1ED-0E571B4AD9BB}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompatibilityOptions", "dev\CompatibilityOptions\CompatibilityOptions.vcxitems", "{1F7B9E9F-9987-490B-9E6E-093C7F63FEC4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2188,6 +2190,7 @@ Global GlobalSection(SharedMSBuildProjectFiles) = preSolution test\inc\inc.vcxitems*{08bc78e0-63c6-49a7-81b3-6afc3deac4de}*SharedItemsImports = 4 dev\PushNotifications\PushNotifications.vcxitems*{103c0c23-7ba8-4d44-a63c-83488e2e3a81}*SharedItemsImports = 9 + dev\CompatibilityOptions\CompatibilityOptions.vcxitems*{1f7b9e9f-9987-490b-9e6e-093c7f63fec4}*SharedItemsImports = 9 dev\EnvironmentManager\API\Microsoft.Process.Environment.vcxitems*{2f3fad1b-d3df-4866-a3a3-c2c777d55638}*SharedItemsImports = 9 dev\OAuth\OAuth.vcxitems*{3e7fd510-8b66-40e7-a80b-780cb8972f83}*SharedItemsImports = 9 test\inc\inc.vcxitems*{412d023e-8635-4ad2-a0ea-e19e08d36915}*SharedItemsImports = 4 @@ -2208,6 +2211,7 @@ Global dev\ApplicationData\ApplicationData.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4 dev\BackgroundTask\BackgroundTaskBuilder\BackgroundTaskBuilder.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4 dev\Common\Common.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4 + dev\CompatibilityOptions\CompatibilityOptions.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4 dev\DynamicDependency\API\DynamicDependency.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4 dev\Licensing\Licensing.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4 dev\PackageManager\API\PackageManager.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4 diff --git a/dev/CompatibilityOptions/CompatibilityOptions.idl b/dev/CompatibilityOptions/CompatibilityOptions.idl new file mode 100644 index 0000000000..ff623b2e09 --- /dev/null +++ b/dev/CompatibilityOptions/CompatibilityOptions.idl @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// TODO: new feature +#include + +namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime +{ + [contractversion(1)] + apicontract CompatibilityContract {}; + + [contract(CompatibilityContract, 1), feature(Feature_OAuth)] + struct WindowsAppRuntimeVersion + { + UInt32 Major; + UInt32 Minor; + UInt32 Patch; + } + + // TODO: new feature + [contract(CompatibilityContract, 1), feature(Feature_OAuth)] + sealed runtimeclass CompatibilityOptions + { + IVector PatchModes; + IVector DisabledFixesList; + void Apply(); + } +} diff --git a/dev/CompatibilityOptions/CompatibilityOptions.vcxitems b/dev/CompatibilityOptions/CompatibilityOptions.vcxitems new file mode 100644 index 0000000000..ad412d47a9 --- /dev/null +++ b/dev/CompatibilityOptions/CompatibilityOptions.vcxitems @@ -0,0 +1,19 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + {1f7b9e9f-9987-490b-9e6e-093c7f63fec4} + + + + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory) + + + + + + + + + \ No newline at end of file diff --git a/dev/WindowsAppRuntime_DLL/WindowsAppRuntime_DLL.vcxproj b/dev/WindowsAppRuntime_DLL/WindowsAppRuntime_DLL.vcxproj index 62e67cef13..48ba84dc0d 100644 --- a/dev/WindowsAppRuntime_DLL/WindowsAppRuntime_DLL.vcxproj +++ b/dev/WindowsAppRuntime_DLL/WindowsAppRuntime_DLL.vcxproj @@ -101,7 +101,8 @@ - + + @@ -326,4 +327,4 @@ - + \ No newline at end of file diff --git a/docs/Coding-Guidelines/GettingStarted.md b/docs/Coding-Guidelines/GettingStarted.md index b5b5aa15cf..218c9b13ee 100644 --- a/docs/Coding-Guidelines/GettingStarted.md +++ b/docs/Coding-Guidelines/GettingStarted.md @@ -83,7 +83,7 @@ harmless if your configuration is current with no changes needed. # Tada! -Now you're ready to load `WindowsAppSDK.sln` and start development! +Now you're ready to load `WindowsAppRuntime.sln` and start development! Some tips: From a4edb3c6c842a2931113a23efff82dcadbd48a55 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Sun, 10 Nov 2024 21:40:42 -0800 Subject: [PATCH 02/24] Starter project. --- WindowsAppRuntime.sln | 4 +++ ...dowsAppSDK-SetupBuildEnvironment-Steps.yml | 8 +++++ ...nalVelocityFeatures-CompatibilityOptions.h | 32 +++++++++++++++++++ ...lVelocityFeatures-CompatibilityOptions.xml | 16 ++++++++++ .../CompatibilityOptions.idl | 22 +++++++++---- docs/Coding-Guidelines/GettingStarted.md | 2 ++ 6 files changed, 77 insertions(+), 7 deletions(-) create mode 100644 dev/Common/TerminalVelocityFeatures-CompatibilityOptions.h create mode 100644 dev/Common/TerminalVelocityFeatures-CompatibilityOptions.xml diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln index d223fe0843..18f6dd7973 100644 --- a/WindowsAppRuntime.sln +++ b/WindowsAppRuntime.sln @@ -568,6 +568,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IXP.TransportPackage.Packag EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompatibilityOptions", "dev\CompatibilityOptions\CompatibilityOptions.vcxitems", "{1F7B9E9F-9987-490B-9E6E-093C7F63FEC4}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CompatibilityOptions", "CompatibilityOptions", "{35972D8A-F47E-4875-A341-E8C25DB7A098}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2183,6 +2185,8 @@ Global {D5958784-4518-44F1-A518-80514B380ED5} = {E24C263A-DE3E-4844-BA50-842DA5AD7A49} {7B323048-439F-47E9-A3D4-7342C5ADE2A5} = {5C88AE1D-AC20-4A41-9299-1EEA15B80724} {A949149D-29CA-4AA7-B1ED-0E571B4AD9BB} = {7B323048-439F-47E9-A3D4-7342C5ADE2A5} + {1F7B9E9F-9987-490B-9E6E-093C7F63FEC4} = {35972D8A-F47E-4875-A341-E8C25DB7A098} + {35972D8A-F47E-4875-A341-E8C25DB7A098} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4B3D7591-CFEC-4762-9A07-ABE99938FB77} diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml index 49942af241..8ab3e9322a 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml @@ -171,6 +171,14 @@ steps: arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-PackageManager.xml -Channel $(channel) -Language C++ -Namespace Microsoft.Windows.Management.Deployment -Output $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-PackageManager.h workingDirectory: '$(Build.SourcesDirectory)' +- task: powershell@2 + displayName: 'Create CompatibilityOptions TerminalVelocity features' + inputs: + targetType: filePath + filePath: tools\TerminalVelocity\Generate-TerminalVelocityFeatures.ps1 + arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-CompatibilityOptions.xml -Channel $(channel) -Language C++ -Namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime -Output $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-CompatibilityOptions.h + workingDirectory: '$(Build.SourcesDirectory)' + - task: powershell@2 name: UpdateTraceloggingConfig inputs: diff --git a/dev/Common/TerminalVelocityFeatures-CompatibilityOptions.h b/dev/Common/TerminalVelocityFeatures-CompatibilityOptions.h new file mode 100644 index 0000000000..a2c4f72cac --- /dev/null +++ b/dev/Common/TerminalVelocityFeatures-CompatibilityOptions.h @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. + +// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT IT + +// INPUT FILE: .\dev\common\TerminalVelocityFeatures-CompatibilityOptions.xml +// OPTIONS: -Channel Experimental -Language C++ -Namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime -Path .\dev\common\TerminalVelocityFeatures-CompatibilityOptions.xml -Output dev\common\TerminalVelocityFeatures-CompatibilityOptions.h + +#if defined(__midlrt) +namespace features +{ + feature_name Feature_CompatibilityOptions = { DisabledByDefault, FALSE }; +} +#endif // defined(__midlrt) + +// Feature constants +#define WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_APPLICATIONMODEL_WINDOWSAPPRUNTIME_FEATURE_COMPATIBILITYOPTIONS_ENABLED 1 + +#if defined(__cplusplus) + +namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime +{ + +__pragma(detect_mismatch("ODR_violation_WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_APPLICATIONMODEL_WINDOWSAPPRUNTIME_FEATURE_COMPATIBILITYOPTIONS_ENABLED_mismatch", "AlwaysEnabled")) +struct Feature_CompatibilityOptions +{ + static constexpr bool IsEnabled() { return WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_APPLICATIONMODEL_WINDOWSAPPRUNTIME_FEATURE_COMPATIBILITYOPTIONS_ENABLED == 1; } +}; + +} // namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime + +#endif // defined(__cplusplus) diff --git a/dev/Common/TerminalVelocityFeatures-CompatibilityOptions.xml b/dev/Common/TerminalVelocityFeatures-CompatibilityOptions.xml new file mode 100644 index 0000000000..7df32a6942 --- /dev/null +++ b/dev/Common/TerminalVelocityFeatures-CompatibilityOptions.xml @@ -0,0 +1,16 @@ + + + + + + + + + + Feature_CompatibilityOptions + CompatibilityOptions for the WindowsAppRuntime + AlwaysEnabled + + diff --git a/dev/CompatibilityOptions/CompatibilityOptions.idl b/dev/CompatibilityOptions/CompatibilityOptions.idl index ff623b2e09..30d92b3e24 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.idl +++ b/dev/CompatibilityOptions/CompatibilityOptions.idl @@ -1,25 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -// TODO: new feature -#include +#include +namespace features +{ +#ifdef MUX_PRERELEASE + // In prerelease, the feature is disabled by default (giving it the [experimental] tag) + feature_name Feature_C = { DisabledByDefault, FALSE }; +#else + // In release, the experimental feature is disabled, removing it from the final WinMD + feature_name Feature_Experimental = { AlwaysDisabled, FALSE }; +#endif +} namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime { [contractversion(1)] apicontract CompatibilityContract {}; - [contract(CompatibilityContract, 1), feature(Feature_OAuth)] + [contract(CompatibilityContract, 1), feature(Feature_CompatibilityOptions)] struct WindowsAppRuntimeVersion { UInt32 Major; UInt32 Minor; UInt32 Patch; - } + }; - // TODO: new feature - [contract(CompatibilityContract, 1), feature(Feature_OAuth)] - sealed runtimeclass CompatibilityOptions + [contract(CompatibilityContract, 1), feature(Feature_CompatibilityOptions)] + runtimeclass CompatibilityOptions { IVector PatchModes; IVector DisabledFixesList; diff --git a/docs/Coding-Guidelines/GettingStarted.md b/docs/Coding-Guidelines/GettingStarted.md index 218c9b13ee..fa38f53bbc 100644 --- a/docs/Coding-Guidelines/GettingStarted.md +++ b/docs/Coding-Guidelines/GettingStarted.md @@ -87,6 +87,8 @@ Now you're ready to load `WindowsAppRuntime.sln` and start development! Some tips: +* If VS starts in a configuration of ``Any CPU``, switch to a specific architecture like `x64` + to succeessfully build. * Build everything in VS via the Build menu's `Build Solution` or `Rebuild Solution` * Right-click on individual projects in Solution Explorer to only build select projects. Dependencies and Build Order should be defined to build prerequisites (if necessary) for the From f2e4b2b7f461088bf3c7e444df97f37d42625cf3 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Sun, 10 Nov 2024 22:30:32 -0800 Subject: [PATCH 03/24] Stub source. Compiles! --- .../CompatibilityOptions.cpp | 22 +++++++++++++ .../CompatibilityOptions.h | 32 +++++++++++++++++++ .../CompatibilityOptions.idl | 4 +-- .../CompatibilityOptions.vcxitems | 6 ++++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 dev/CompatibilityOptions/CompatibilityOptions.cpp create mode 100644 dev/CompatibilityOptions/CompatibilityOptions.h diff --git a/dev/CompatibilityOptions/CompatibilityOptions.cpp b/dev/CompatibilityOptions/CompatibilityOptions.cpp new file mode 100644 index 0000000000..f312f283fd --- /dev/null +++ b/dev/CompatibilityOptions/CompatibilityOptions.cpp @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. + +#include "pch.h" +#include "CompatibilityOptions.h" +#include "Microsoft.Windows.ApplicationModel.WindowsAppRuntime.CompatibilityOptions.g.cpp" + +namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implementation +{ + winrt::Windows::Foundation::Collections::IVector CompatibilityOptions::PatchModes() + { + return m_patchModes; + } + winrt::Windows::Foundation::Collections::IVector CompatibilityOptions::DisabledFixesList() + { + return m_disabledFixesList; + } + void CompatibilityOptions::Apply() + { + throw hresult_not_implemented(); + } +} diff --git a/dev/CompatibilityOptions/CompatibilityOptions.h b/dev/CompatibilityOptions/CompatibilityOptions.h new file mode 100644 index 0000000000..6764bf5de9 --- /dev/null +++ b/dev/CompatibilityOptions/CompatibilityOptions.h @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. + +#pragma once + +#include "Microsoft.Windows.ApplicationModel.WindowsAppRuntime.CompatibilityOptions.g.h" + +namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implementation +{ + struct CompatibilityOptions : CompatibilityOptionsT + { + CompatibilityOptions() = default; + + winrt::Windows::Foundation::Collections::IVector PatchModes(); + winrt::Windows::Foundation::Collections::IVector DisabledFixesList(); + + void Apply(); + + private: + winrt::Windows::Foundation::Collections::IVector m_patchModes{ winrt::single_threaded_vector() }; + winrt::Windows::Foundation::Collections::IVector m_disabledFixesList{ winrt::single_threaded_vector() }; + }; +} + +#if FALSE +namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::factory_implementation +{ + struct CompatibilityOptions : CompatibilityOptionsT + { + }; +} +#endif diff --git a/dev/CompatibilityOptions/CompatibilityOptions.idl b/dev/CompatibilityOptions/CompatibilityOptions.idl index 30d92b3e24..4d46b01a4d 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.idl +++ b/dev/CompatibilityOptions/CompatibilityOptions.idl @@ -29,8 +29,8 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime [contract(CompatibilityContract, 1), feature(Feature_CompatibilityOptions)] runtimeclass CompatibilityOptions { - IVector PatchModes; - IVector DisabledFixesList; + IVector PatchModes { get; }; + IVector DisabledFixesList{ get; }; void Apply(); } } diff --git a/dev/CompatibilityOptions/CompatibilityOptions.vcxitems b/dev/CompatibilityOptions/CompatibilityOptions.vcxitems index ad412d47a9..6240a7e56b 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.vcxitems +++ b/dev/CompatibilityOptions/CompatibilityOptions.vcxitems @@ -16,4 +16,10 @@ + + + + + + \ No newline at end of file From a01f8c1444a197280c66e88734684ed8fbc0d38d Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Thu, 28 Nov 2024 19:45:52 -0800 Subject: [PATCH 04/24] Base impl. --- ...WindowsAppSDK.ContainmentSetter.CS.targets | 67 +++++++++++++++++++ ...Microsoft.WindowsAppSDK.Foundation.targets | 2 + ...SDK-Nuget-Native.ContainmentSetter.targets | 66 ++++++++++++++++++ .../WindowsAppSDK-Nuget-Native.targets | 2 + build/VersionInfo/AssemblyInfo.h | 14 ++++ build/VersionInfo/GenerateVersionInfo.ps1 | 22 +++++- .../CompatibilityOptions.cpp | 54 +++++++++++++-- .../CompatibilityOptions.h | 12 ++-- .../CompatibilityOptions.idl | 16 ++--- .../CompatibilityOptions.vcxitems | 9 ++- 10 files changed, 239 insertions(+), 25 deletions(-) create mode 100644 build/NuSpecs/Microsoft.WindowsAppSDK.ContainmentSetter.CS.targets create mode 100644 build/NuSpecs/WindowsAppSDK-Nuget-Native.ContainmentSetter.targets create mode 100644 build/VersionInfo/AssemblyInfo.h diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.ContainmentSetter.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.ContainmentSetter.CS.targets new file mode 100644 index 0000000000..bfe7a2d9b5 --- /dev/null +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.ContainmentSetter.CS.targets @@ -0,0 +1,67 @@ + + + + + + + $(GeneratedFilesDir)WinAppSDKContainmentSetterCS.cs + + compatibilityOptions.PatchMode1 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode))%3B + + + compatibilityOptions.PatchMode2 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode2))%3B + + + var disabledChangesArray = new System.UInt64[] { $(WindowsAppSDKDisabledChanges) }%3B + foreach (var changeId in disabledChangesArray) + { + compatibilityOptions.DisabledChanges.Add(changeId)%3B + } + + + +// This file is generated by the build based on project properties. +namespace WindowsAppRuntime.Containment.Configuration +{ +/* + struct WindowsAppRuntimeVersion + { + uint Major%3B uint Minor%3B uint Patch%3B + internal WindowsAppRuntimeVersion(uint major, uint minor, uint patch) { Major = major%3B Minor = minor%3B Patch = patch%3B } + public override string ToString() { return $"{Major}.{Minor}.{Patch}"%3B } + } + + class CompatibilityOptions + { + public WindowsAppRuntimeVersion PatchMode1 = null%3B + public WindowsAppRuntimeVersion PatchMode2 = null%3B + public System.Collections.Generic.IList<System.UInt64> DisabledChanges = new System.Collections.Generic.IList<System.UInt64>()%3B + public void Apply() { System.Diagnostics.Debug.WriteLine("Applying containment options. PatchModes: " + this.PatchMode1 + "," + this.PatchMode2 + " Disabled changes: " + string.Join(",",this.DisabledChanges.ToArray()))%3B } + } + */ + + class AutoInitialize + { + [global::System.Runtime.CompilerServices.ModuleInitializer] + internal static void ConfigureContainment() + { + var compatibilityOptions = new CompatibilityOptions()%3B +$(WinAppSDKContainmentPatchMode1Lines) +$(WinAppSDKContainmentPatchMode2Lines) +$(WinAppSDKContainmentDisabledChangesLines) + compatibilityOptions.Apply()%3B + } + } +} + + + + + + + diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets index 73434d043d..9d93133c71 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets @@ -13,6 +13,8 @@ + + diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.ContainmentSetter.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.ContainmentSetter.targets new file mode 100644 index 0000000000..29a8159c68 --- /dev/null +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.ContainmentSetter.targets @@ -0,0 +1,66 @@ + + + + + + + $(GeneratedFilesDir)WinAppSDKContainmentSetter.cpp + + compatibilityOptions.PatchMode1 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode))%3B + + + compatibilityOptions.PatchMode2 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode2))%3B + + + // TODO: compatibilityOptions.DisabledChanges.AddRange(new uint64_t[] { $(WindowsAppSDKDisabledChanges) })%3B + + + +// This file is generated by the build based on project properties. +#include <windows.h> +namespace WindowsAppRuntime::Containment::Configuration +{ + struct AutoInitialize + { + AutoInitialize() + { + Initialize()%3B + } + + ~AutoInitialize() = default%3B + + static void Initialize() + { + CompatibilityOptions compatibilityOptions%3B +$(WinAppSDKContainmentPatchMode1Lines) +$(WinAppSDKContainmentPatchMode2Lines) +$(WinAppSDKContainmentDisabledChangesLines) + compatibilityOptions.Apply()%3B + } + }%3B + static AutoInitialize g_autoInitialize%3B +} + + + + + + + NotUsing + + + + + + + $(BeforeClCompileTargets); WinAppSDKContainmentSetterTarget + + + + diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets index c18bdb650a..131cc5d77e 100644 --- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets @@ -144,4 +144,6 @@ + + diff --git a/build/VersionInfo/AssemblyInfo.h b/build/VersionInfo/AssemblyInfo.h new file mode 100644 index 0000000000..a333befe11 --- /dev/null +++ b/build/VersionInfo/AssemblyInfo.h @@ -0,0 +1,14 @@ +// WARNING: the values in the AssemblyInfo file are defaults for use in dev-loop. +// This file is meant to be overwritten by GenerateVersionInfo.ps1 +// Please modify the generation script in GenerateVersionInfo.ps1 to change any fields or values. + +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. + +#ifndef WINDOWSAPPSDK_RELEASE_MAJOR +#define WINDOWSAPPSDK_RELEASE_MAJOR 0 +#endif + +#ifndef WINDOWSAPPSDK_RELEASE_MINOR +#define WINDOWSAPPSDK_RELEASE_MINOR 0 +#endif diff --git a/build/VersionInfo/GenerateVersionInfo.ps1 b/build/VersionInfo/GenerateVersionInfo.ps1 index 31bbadf45b..3090a1f7e6 100644 --- a/build/VersionInfo/GenerateVersionInfo.ps1 +++ b/build/VersionInfo/GenerateVersionInfo.ps1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation and Contributors. # Licensed under the MIT License. -# This scripts overrides AssemblyInfo.cs and AssemblyInfo.ver in eng/common/VersionInfo. +# This script overrides AssemblyInfo.cs, AssemblyInfo.ver, and AssemblyInfo.h in build/VersionInfo. # The parameters ProductMajor and ProductMinor version will be used in the overwrite # for the ProductVersion field @@ -137,3 +137,23 @@ Write-Verbose $assemblyInfoVer $assemblyInfoVerPath = "$scriptFullPath/AssemblyInfo.ver" Write-Verbose "Writing $assemblyInfoVerPath..." [System.IO.File]::WriteAllLines($assemblyInfoVerPath, $assemblyInfoVer, $utf8NoBomEncoding) + +# Generating AssemblyInfo.h override +$assemblyInfoCs = @" +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. + +#ifndef WINDOWSAPPSDK_RELEASE_MAJOR +#define WINDOWSAPPSDK_RELEASE_MAJOR $ProductMajor +#endif + +#ifndef WINDOWSAPPSDK_RELEASE_MINOR +#define WINDOWSAPPSDK_RELEASE_MINOR $ProductMinor +#endif +"@ + +Write-Verbose $assemblyInfoCs +$assemblyInfoCsPath = "$scriptFullPath/AssemblyInfo.h" +Write-Verbose "Writing $assemblyInfoCsPath..." +[System.IO.File]::WriteAllLines($assemblyInfoCsPath, $assemblyInfoCs, $utf8NoBomEncoding) + diff --git a/dev/CompatibilityOptions/CompatibilityOptions.cpp b/dev/CompatibilityOptions/CompatibilityOptions.cpp index f312f283fd..b66515497f 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.cpp +++ b/dev/CompatibilityOptions/CompatibilityOptions.cpp @@ -4,19 +4,59 @@ #include "pch.h" #include "CompatibilityOptions.h" #include "Microsoft.Windows.ApplicationModel.WindowsAppRuntime.CompatibilityOptions.g.cpp" +#include "AssemblyInfo.h" + +#define DEFINE_WinAppSDKRuntimeConfiguration +#include namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implementation { - winrt::Windows::Foundation::Collections::IVector CompatibilityOptions::PatchModes() - { - return m_patchModes; - } - winrt::Windows::Foundation::Collections::IVector CompatibilityOptions::DisabledFixesList() + winrt::Windows::Foundation::Collections::IVector CompatibilityOptions::DisabledChanges() { - return m_disabledFixesList; + return m_disabledChanges; } void CompatibilityOptions::Apply() { - throw hresult_not_implemented(); + WinAppSdk::Containment::WinAppSDKRuntimeConfiguration config; + + // If both patch modes are set to the same major.minor version, error out if the patch versions are different. + if (m_patchMode1.Major == m_patchMode2.Major && m_patchMode1.Minor == m_patchMode2.Minor && + m_patchMode1.Major != 0) + { + if (m_patchMode1.Patch != m_patchMode2.Patch) + { + throw hresult_invalid_argument(L"Patch modes should target different Major.Minor versions or match Patch version."); + } + } + + // Apply the patch mode which applies to the major.minor version, if any. + if (m_patchMode1.Major == WINDOWSAPPSDK_RELEASE_MAJOR && m_patchMode1.Minor == WINDOWSAPPSDK_RELEASE_MINOR) + { + // Apply patch mode 1 + config.patchVersion = (WinAppSDKPatchVersion)WinAppSDKPatchVersionFromValues(m_patchMode1.Major, m_patchMode1.Minor, m_patchMode1.Patch); + } + else if (m_patchMode2.Major == WINDOWSAPPSDK_RELEASE_MAJOR && m_patchMode2.Minor == WINDOWSAPPSDK_RELEASE_MINOR) + { + // Apply patch mode 2 + config.patchVersion = (WinAppSDKPatchVersion)WinAppSDKPatchVersionFromValues(m_patchMode2.Major, m_patchMode2.Minor, m_patchMode2.Patch); + } + + // Add the set of disabled changes + for (auto changeId : m_disabledChanges) + { + // TODO: Telemetry! Log the changeId that was disabled. + // Currently only UINT32 is used internally for the changeId, so cast down to that. + config.disabledChanges.push_back(static_cast(changeId)); + } + + HRESULT hr = WinAppSdk::Containment::SetConfiguration(&config); + if (FAILED(hr)) + { + if (hr == E_ACCESSDENIED) + { + throw winrt::hresult_access_denied(L"Configuration already set or locked."); + } + winrt::throw_hresult(hr); + } } } diff --git a/dev/CompatibilityOptions/CompatibilityOptions.h b/dev/CompatibilityOptions/CompatibilityOptions.h index 6764bf5de9..457b4b74e1 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.h +++ b/dev/CompatibilityOptions/CompatibilityOptions.h @@ -11,14 +11,18 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem { CompatibilityOptions() = default; - winrt::Windows::Foundation::Collections::IVector PatchModes(); - winrt::Windows::Foundation::Collections::IVector DisabledFixesList(); + WindowsAppRuntimeVersion PatchMode1() { return m_patchMode1; } + void PatchMode1(WindowsAppRuntimeVersion const& value) { m_patchMode1 = value; } + WindowsAppRuntimeVersion PatchMode2() { return m_patchMode2; } + void PatchMode2(WindowsAppRuntimeVersion const& value) { m_patchMode2 = value; } + winrt::Windows::Foundation::Collections::IVector DisabledChanges(); void Apply(); private: - winrt::Windows::Foundation::Collections::IVector m_patchModes{ winrt::single_threaded_vector() }; - winrt::Windows::Foundation::Collections::IVector m_disabledFixesList{ winrt::single_threaded_vector() }; + WindowsAppRuntimeVersion m_patchMode1{ 0, 0, 0 }; + WindowsAppRuntimeVersion m_patchMode2{ 0, 0, 0 }; + winrt::Windows::Foundation::Collections::IVector m_disabledChanges{ winrt::single_threaded_vector() }; }; } diff --git a/dev/CompatibilityOptions/CompatibilityOptions.idl b/dev/CompatibilityOptions/CompatibilityOptions.idl index 4d46b01a4d..ddfa878d32 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.idl +++ b/dev/CompatibilityOptions/CompatibilityOptions.idl @@ -3,16 +3,6 @@ #include -namespace features -{ -#ifdef MUX_PRERELEASE - // In prerelease, the feature is disabled by default (giving it the [experimental] tag) - feature_name Feature_C = { DisabledByDefault, FALSE }; -#else - // In release, the experimental feature is disabled, removing it from the final WinMD - feature_name Feature_Experimental = { AlwaysDisabled, FALSE }; -#endif -} namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime { [contractversion(1)] @@ -26,11 +16,13 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime UInt32 Patch; }; + // TODO: Get agreement and add a generic Feature_Experimental [contract(CompatibilityContract, 1), feature(Feature_CompatibilityOptions)] runtimeclass CompatibilityOptions { - IVector PatchModes { get; }; - IVector DisabledFixesList{ get; }; + WindowsAppRuntimeVersion PatchMode1 { get; set; }; + WindowsAppRuntimeVersion PatchMode2 { get; set; }; + IVector DisabledChanges{ get; }; void Apply(); } } diff --git a/dev/CompatibilityOptions/CompatibilityOptions.vcxitems b/dev/CompatibilityOptions/CompatibilityOptions.vcxitems index 6240a7e56b..85891246c9 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.vcxitems +++ b/dev/CompatibilityOptions/CompatibilityOptions.vcxitems @@ -17,7 +17,14 @@ - + + $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories) + $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories) + $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories) + $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories) + $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories) + $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories) + From 4bfaad10da50d4ae224d54a9a8528bb477633832 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Sun, 1 Dec 2024 15:27:04 -0800 Subject: [PATCH 05/24] Initial tests. Fails to activate instance. --- WindowsAppRuntime.sln | 22 +++ build/NuSpecs/AppxManifest.xml | 3 + .../CompatibilityOptions.h | 2 - .../CompatibilityOptions.idl | 13 ++ test/ContainmentTests/ContainmentTests.cpp | 71 +++++++++ .../ContainmentTests/ContainmentTests.vcxproj | 147 ++++++++++++++++++ .../ContainmentTests.vcxproj.filters | 36 +++++ test/ContainmentTests/packages.config | 6 + test/ContainmentTests/pch.cpp | 8 + test/ContainmentTests/pch.h | 24 +++ 10 files changed, 330 insertions(+), 2 deletions(-) create mode 100644 test/ContainmentTests/ContainmentTests.cpp create mode 100644 test/ContainmentTests/ContainmentTests.vcxproj create mode 100644 test/ContainmentTests/ContainmentTests.vcxproj.filters create mode 100644 test/ContainmentTests/packages.config create mode 100644 test/ContainmentTests/pch.cpp create mode 100644 test/ContainmentTests/pch.h diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln index 18f6dd7973..4bf33c1eac 100644 --- a/WindowsAppRuntime.sln +++ b/WindowsAppRuntime.sln @@ -570,6 +570,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompatibilityOptions", "dev EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CompatibilityOptions", "CompatibilityOptions", "{35972D8A-F47E-4875-A341-E8C25DB7A098}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ContainmentTests", "test\ContainmentTests\ContainmentTests.vcxproj", "{040BB64B-012E-4E4F-BB02-E85EF46D3475}" + ProjectSection(ProjectDependencies) = postProject + {F76B776E-86F5-48C5-8FC7-D2795ECC9746} = {F76B776E-86F5-48C5-8FC7-D2795ECC9746} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2006,6 +2011,22 @@ Global {A949149D-29CA-4AA7-B1ED-0E571B4AD9BB}.Release|x64.Build.0 = Release|x64 {A949149D-29CA-4AA7-B1ED-0E571B4AD9BB}.Release|x86.ActiveCfg = Release|x86 {A949149D-29CA-4AA7-B1ED-0E571B4AD9BB}.Release|x86.Build.0 = Release|x86 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|Any CPU.ActiveCfg = Debug|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|Any CPU.Build.0 = Debug|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|ARM64.ActiveCfg = Debug|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|ARM64.Build.0 = Debug|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|x64.ActiveCfg = Debug|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|x64.Build.0 = Debug|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|x86.ActiveCfg = Debug|Win32 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|x86.Build.0 = Debug|Win32 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|Any CPU.ActiveCfg = Release|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|Any CPU.Build.0 = Release|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|ARM64.ActiveCfg = Release|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|ARM64.Build.0 = Release|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x64.ActiveCfg = Release|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x64.Build.0 = Release|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x86.ActiveCfg = Release|Win32 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2187,6 +2208,7 @@ Global {A949149D-29CA-4AA7-B1ED-0E571B4AD9BB} = {7B323048-439F-47E9-A3D4-7342C5ADE2A5} {1F7B9E9F-9987-490B-9E6E-093C7F63FEC4} = {35972D8A-F47E-4875-A341-E8C25DB7A098} {35972D8A-F47E-4875-A341-E8C25DB7A098} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A} + {040BB64B-012E-4E4F-BB02-E85EF46D3475} = {8630F7AA-2969-4DC9-8700-9B468C1DC21D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4B3D7591-CFEC-4762-9A07-ABE99938FB77} diff --git a/build/NuSpecs/AppxManifest.xml b/build/NuSpecs/AppxManifest.xml index e079468216..9f616da20e 100644 --- a/build/NuSpecs/AppxManifest.xml +++ b/build/NuSpecs/AppxManifest.xml @@ -111,6 +111,9 @@ + + + diff --git a/dev/CompatibilityOptions/CompatibilityOptions.h b/dev/CompatibilityOptions/CompatibilityOptions.h index 457b4b74e1..70d6150c19 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.h +++ b/dev/CompatibilityOptions/CompatibilityOptions.h @@ -26,11 +26,9 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem }; } -#if FALSE namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::factory_implementation { struct CompatibilityOptions : CompatibilityOptionsT { }; } -#endif diff --git a/dev/CompatibilityOptions/CompatibilityOptions.idl b/dev/CompatibilityOptions/CompatibilityOptions.idl index ddfa878d32..01ebc29bbc 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.idl +++ b/dev/CompatibilityOptions/CompatibilityOptions.idl @@ -16,13 +16,26 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime UInt32 Patch; }; + /// This object is used by the app to configure any desired compatibility options + /// for Windows App Runtime behavior of changes added in servicing updates. This + /// object is only used to set the runtime behavior and can't be used to query the + /// applied settings. // TODO: Get agreement and add a generic Feature_Experimental [contract(CompatibilityContract, 1), feature(Feature_CompatibilityOptions)] runtimeclass CompatibilityOptions { + CompatibilityOptions(); + + /// An optional patch mode to use if the runtime version matches the major.minor version. WindowsAppRuntimeVersion PatchMode1 { get; set; }; + + /// An optional patch mode to use if the runtime version matches the major.minor version. WindowsAppRuntimeVersion PatchMode2 { get; set; }; + + /// An optional list of specific servicing changes to disable. IVector DisabledChanges{ get; }; + + /// Apply the compatibility options to the runtime. void Apply(); } } diff --git a/test/ContainmentTests/ContainmentTests.cpp b/test/ContainmentTests/ContainmentTests.cpp new file mode 100644 index 0000000000..771448184a --- /dev/null +++ b/test/ContainmentTests/ContainmentTests.cpp @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. + +#include "pch.h" + +namespace TB = ::Test::Bootstrap; +namespace TP = ::Test::Packages; + +namespace Test::ContainmentTests +{ + class ContainmentTests + { + public: + BEGIN_TEST_CLASS(ContainmentTests) + TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA") + //TEST_CLASS_PROPERTY(L"RunFixtureAs:Class", L"RestrictedUser") + END_TEST_CLASS() + + TEST_CLASS_SETUP(ClassSetup) + { + //::Test::Bootstrap::SetupPackages(Test::Bootstrap::Packages::Framework); + //::Test::Bootstrap::SetupBootstrap(); + ::Test::Bootstrap::Setup(); + return true; + } + + TEST_CLASS_CLEANUP(ClassCleanup) + { + ::Test::Bootstrap::Cleanup(); + return true; + } + + TEST_METHOD(CanSetCompatibilityOptions) + { + WEX::Logging::Log::Comment(WEX::Common::String(L"Starting CanSetCompatibilityOptions...")); + winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options; + WEX::Logging::Log::Comment(WEX::Common::String(L" created CompatibilityOptions...")); + options.PatchMode1({ 1, 7, 3 }); + options.Apply(); + //VERIFY_FAIL(L"Success is not expected without Microsoft.WindowsAppRuntime.Insights.Resource.dll"); + try + { + winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options2; + options2.PatchMode1({ 1, 7, 6 }); + options2.Apply(); + VERIFY_FAIL(L"Success is not expected when setting a different configuration"); + } + catch (winrt::hresult_error& e) + { + VERIFY_ARE_EQUAL(HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND), e.code()); + } + } + + TEST_METHOD(VerifyNoMatchingPatchModeBehavior) + { + WEX::Logging::Log::Comment(WEX::Common::String(L"Setting CompatibilityOptions with no matching patch mode")); + winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options; + options.PatchMode1({ 0, 8, 3 }); + options.PatchMode1({ 1, 1, 4 }); + options.Apply(); + + // Set a CompatibilityOptions with no patch mode, which should be allowed since neither + // set a patch mode matching the runtime version. + winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options2; + options2.Apply(); + } + + // TODO: Test setting DisabledChanges. + // TODO: Can IsChangeEnabled be directly called to test patch mode check and DisabledChanges? + }; +} diff --git a/test/ContainmentTests/ContainmentTests.vcxproj b/test/ContainmentTests/ContainmentTests.vcxproj new file mode 100644 index 0000000000..7c69692cb0 --- /dev/null +++ b/test/ContainmentTests/ContainmentTests.vcxproj @@ -0,0 +1,147 @@ + + + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + 17.0 + Win32Proj + {040bb64b-012e-4e4f-bb02-e85ef46d3475} + ContainmentTests + 10.0 + + + DynamicLibrary + v143 + Unicode + + + false + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + Use + true + pch.h + $(RepoRoot)\test\inc;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories);$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)\..\WindowsAppRuntime_BootstrapDLL;$(RepoRoot)\dev\common + $(RepoRoot);%(AdditionalIncludeDirectories) + + + Windows + onecore.lib;onecoreuap.lib;Microsoft.WindowsAppRuntime.lib;wex.common.lib;wex.logger.lib;te.common.lib;%(AdditionalDependencies) + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories);$(OutDir)\..\WindowsAppRuntime_DLL + + + + + NDEBUG;%(PreprocessorDefinitions) + + + + + + + _DEBUG;%(PreprocessorDefinitions) + + + + + + + WIN32;%(PreprocessorDefinitions) + + + + + Create + + + + + + + + + + + + $(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd + true + + + + + {f76b776e-86f5-48c5-8fc7-d2795ecc9746} + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + \ No newline at end of file diff --git a/test/ContainmentTests/ContainmentTests.vcxproj.filters b/test/ContainmentTests/ContainmentTests.vcxproj.filters new file mode 100644 index 0000000000..e6a73fd7a6 --- /dev/null +++ b/test/ContainmentTests/ContainmentTests.vcxproj.filters @@ -0,0 +1,36 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/test/ContainmentTests/packages.config b/test/ContainmentTests/packages.config new file mode 100644 index 0000000000..63e5716140 --- /dev/null +++ b/test/ContainmentTests/packages.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/test/ContainmentTests/pch.cpp b/test/ContainmentTests/pch.cpp new file mode 100644 index 0000000000..a77728ba07 --- /dev/null +++ b/test/ContainmentTests/pch.cpp @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. + +// pch.cpp: source file corresponding to the pre-compiled header + +#include "pch.h" + +// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. diff --git a/test/ContainmentTests/pch.h b/test/ContainmentTests/pch.h new file mode 100644 index 0000000000..d9ababf69f --- /dev/null +++ b/test/ContainmentTests/pch.h @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. + +#ifndef PCH_H +#define PCH_H + +#include + +#include + +#include +#include + +#include + +#include + +#include +#include +#include + +#include + +#endif //PCH_H From c2db61f24a9748d64e6a41a9c40bc892a8a72d33 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Mon, 2 Dec 2024 21:47:13 -0800 Subject: [PATCH 06/24] Two passing tests. --- build/VersionInfo/AssemblyInfo.h | 4 +- .../CompatibilityOptions.cpp | 5 +- .../Containment-AppxManifest.xml | 55 +++++++++++++++++++ test/ContainmentTests/ContainmentTests.cpp | 42 ++++++++++++-- .../ContainmentTests/ContainmentTests.vcxproj | 9 ++- .../appxmanifest.xml | 6 ++ 6 files changed, 110 insertions(+), 11 deletions(-) create mode 100644 test/ContainmentTests/Containment-AppxManifest.xml diff --git a/build/VersionInfo/AssemblyInfo.h b/build/VersionInfo/AssemblyInfo.h index a333befe11..abc67be25e 100644 --- a/build/VersionInfo/AssemblyInfo.h +++ b/build/VersionInfo/AssemblyInfo.h @@ -6,9 +6,9 @@ // Licensed under the MIT License. #ifndef WINDOWSAPPSDK_RELEASE_MAJOR -#define WINDOWSAPPSDK_RELEASE_MAJOR 0 +#define WINDOWSAPPSDK_RELEASE_MAJOR 1 #endif #ifndef WINDOWSAPPSDK_RELEASE_MINOR -#define WINDOWSAPPSDK_RELEASE_MINOR 0 +#define WINDOWSAPPSDK_RELEASE_MINOR 7 #endif diff --git a/dev/CompatibilityOptions/CompatibilityOptions.cpp b/dev/CompatibilityOptions/CompatibilityOptions.cpp index b66515497f..300f3a3f26 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.cpp +++ b/dev/CompatibilityOptions/CompatibilityOptions.cpp @@ -42,12 +42,15 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem } // Add the set of disabled changes + std::vector disabledChanges; for (auto changeId : m_disabledChanges) { // TODO: Telemetry! Log the changeId that was disabled. // Currently only UINT32 is used internally for the changeId, so cast down to that. - config.disabledChanges.push_back(static_cast(changeId)); + disabledChanges.push_back(static_cast(changeId)); } + config.disabledChanges = disabledChanges.data(); + config.disabledChangesCount = static_cast(disabledChanges.size()); HRESULT hr = WinAppSdk::Containment::SetConfiguration(&config); if (FAILED(hr)) diff --git a/test/ContainmentTests/Containment-AppxManifest.xml b/test/ContainmentTests/Containment-AppxManifest.xml new file mode 100644 index 0000000000..b4c4da11ee --- /dev/null +++ b/test/ContainmentTests/Containment-AppxManifest.xml @@ -0,0 +1,55 @@ + + + + + + + + WindowsAppRuntime.Test.Containment for tests + Windows App SDK + taef.png + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/ContainmentTests/ContainmentTests.cpp b/test/ContainmentTests/ContainmentTests.cpp index 771448184a..15cacdf65f 100644 --- a/test/ContainmentTests/ContainmentTests.cpp +++ b/test/ContainmentTests/ContainmentTests.cpp @@ -2,6 +2,7 @@ // Licensed under the MIT License. #include "pch.h" +#include "AssemblyInfo.h" namespace TB = ::Test::Bootstrap; namespace TP = ::Test::Packages; @@ -13,7 +14,10 @@ namespace Test::ContainmentTests public: BEGIN_TEST_CLASS(ContainmentTests) TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA") - //TEST_CLASS_PROPERTY(L"RunFixtureAs:Class", L"RestrictedUser") + TEST_CLASS_PROPERTY(L"RunFixtureAs:Class", L"RestrictedUser") + TEST_CLASS_PROPERTY(L"RunAs", L"UAP") + TEST_CLASS_PROPERTY(L"UAP:AppxManifest", L"Containment-AppxManifest.xml") + TEST_CLASS_PROPERTY(L"IsolationLevel", L"Method") // each test sets its own containment END_TEST_CLASS() TEST_CLASS_SETUP(ClassSetup) @@ -30,24 +34,50 @@ namespace Test::ContainmentTests return true; } + TEST_METHOD_SETUP(MethodInit) + { + VERIFY_IS_TRUE(TP::IsPackageRegistered_WindowsAppRuntimeFramework()); + return true; + } + + TEST_METHOD_CLEANUP(MethodUninit) + { + VERIFY_IS_TRUE(TP::IsPackageRegistered_WindowsAppRuntimeFramework()); + return true; + } + TEST_METHOD(CanSetCompatibilityOptions) { WEX::Logging::Log::Comment(WEX::Common::String(L"Starting CanSetCompatibilityOptions...")); winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options; - WEX::Logging::Log::Comment(WEX::Common::String(L" created CompatibilityOptions...")); - options.PatchMode1({ 1, 7, 3 }); + WEX::Logging::Log::Comment(WEX::Common::String(L" Created CompatibilityOptions...")); + options.PatchMode1({ WINDOWSAPPSDK_RELEASE_MAJOR, WINDOWSAPPSDK_RELEASE_MINOR, 3 }); options.Apply(); - //VERIFY_FAIL(L"Success is not expected without Microsoft.WindowsAppRuntime.Insights.Resource.dll"); + WEX::Logging::Log::Comment(WEX::Common::String(L" Applied CompatibilityOptions...")); + try { + WEX::Logging::Log::Comment(WEX::Common::String(L" Applying CompatibilityOptions with different patch mode...")); winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options2; - options2.PatchMode1({ 1, 7, 6 }); + options2.PatchMode1({ WINDOWSAPPSDK_RELEASE_MAJOR, WINDOWSAPPSDK_RELEASE_MINOR, 6 }); options2.Apply(); VERIFY_FAIL(L"Success is not expected when setting a different configuration"); } catch (winrt::hresult_error& e) { - VERIFY_ARE_EQUAL(HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND), e.code()); + VERIFY_ARE_EQUAL(E_ACCESSDENIED, e.code()); + } + + try + { + WEX::Logging::Log::Comment(WEX::Common::String(L" Applying CompatibilityOptions with no patch mode...")); + winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options3; + options3.Apply(); + VERIFY_FAIL(L"Success is not expected when setting a different configuration"); + } + catch (winrt::hresult_error& e) + { + VERIFY_ARE_EQUAL(E_ACCESSDENIED, e.code()); } } diff --git a/test/ContainmentTests/ContainmentTests.vcxproj b/test/ContainmentTests/ContainmentTests.vcxproj index 7c69692cb0..610dd383e1 100644 --- a/test/ContainmentTests/ContainmentTests.vcxproj +++ b/test/ContainmentTests/ContainmentTests.vcxproj @@ -106,11 +106,16 @@ Create - + + $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories) + + + + @@ -144,4 +149,4 @@ - \ No newline at end of file + diff --git a/test/DynamicDependency/data/Microsoft.WindowsAppRuntime.Framework/appxmanifest.xml b/test/DynamicDependency/data/Microsoft.WindowsAppRuntime.Framework/appxmanifest.xml index aed4d038b8..521f1aecda 100644 --- a/test/DynamicDependency/data/Microsoft.WindowsAppRuntime.Framework/appxmanifest.xml +++ b/test/DynamicDependency/data/Microsoft.WindowsAppRuntime.Framework/appxmanifest.xml @@ -148,6 +148,12 @@ + + + Microsoft.WindowsAppRuntime.dll + + + PushNotificationsLongRunningTask.ProxyStub.dll From c62b743bb183e9ffb2ecc2fa1916931105cc7765 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Sat, 7 Dec 2024 15:37:00 -0800 Subject: [PATCH 07/24] Updated based on spec and core feedback. --- .../CompatibilityOptions.cpp | 10 +++--- .../CompatibilityOptions.h | 4 +-- .../CompatibilityOptions.idl | 12 ++++++- test/ContainmentTests/ContainmentTests.cpp | 31 ++++++++++++++++--- .../ContainmentTests/ContainmentTests.vcxproj | 2 ++ .../ContainmentTests.vcxproj.filters | 3 ++ 6 files changed, 49 insertions(+), 13 deletions(-) diff --git a/dev/CompatibilityOptions/CompatibilityOptions.cpp b/dev/CompatibilityOptions/CompatibilityOptions.cpp index 300f3a3f26..824f1af375 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.cpp +++ b/dev/CompatibilityOptions/CompatibilityOptions.cpp @@ -5,13 +5,11 @@ #include "CompatibilityOptions.h" #include "Microsoft.Windows.ApplicationModel.WindowsAppRuntime.CompatibilityOptions.g.cpp" #include "AssemblyInfo.h" - -#define DEFINE_WinAppSDKRuntimeConfiguration #include namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implementation { - winrt::Windows::Foundation::Collections::IVector CompatibilityOptions::DisabledChanges() + winrt::Windows::Foundation::Collections::IVector CompatibilityOptions::DisabledChanges() { return m_disabledChanges; } @@ -46,7 +44,7 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem for (auto changeId : m_disabledChanges) { // TODO: Telemetry! Log the changeId that was disabled. - // Currently only UINT32 is used internally for the changeId, so cast down to that. + // UINT32 is used internally for the changeId, so cast from the enum's Int32 to that. disabledChanges.push_back(static_cast(changeId)); } config.disabledChanges = disabledChanges.data(); @@ -55,9 +53,9 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem HRESULT hr = WinAppSdk::Containment::SetConfiguration(&config); if (FAILED(hr)) { - if (hr == E_ACCESSDENIED) + if (hr == E_ILLEGAL_STATE_CHANGE) { - throw winrt::hresult_access_denied(L"Configuration already set or locked."); + throw winrt::hresult_illegal_state_change(L"Configuration already set or locked."); } winrt::throw_hresult(hr); } diff --git a/dev/CompatibilityOptions/CompatibilityOptions.h b/dev/CompatibilityOptions/CompatibilityOptions.h index 70d6150c19..5bfb25c69d 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.h +++ b/dev/CompatibilityOptions/CompatibilityOptions.h @@ -15,14 +15,14 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem void PatchMode1(WindowsAppRuntimeVersion const& value) { m_patchMode1 = value; } WindowsAppRuntimeVersion PatchMode2() { return m_patchMode2; } void PatchMode2(WindowsAppRuntimeVersion const& value) { m_patchMode2 = value; } - winrt::Windows::Foundation::Collections::IVector DisabledChanges(); + winrt::Windows::Foundation::Collections::IVector DisabledChanges(); void Apply(); private: WindowsAppRuntimeVersion m_patchMode1{ 0, 0, 0 }; WindowsAppRuntimeVersion m_patchMode2{ 0, 0, 0 }; - winrt::Windows::Foundation::Collections::IVector m_disabledChanges{ winrt::single_threaded_vector() }; + winrt::Windows::Foundation::Collections::IVector m_disabledChanges{ winrt::single_threaded_vector() }; }; } diff --git a/dev/CompatibilityOptions/CompatibilityOptions.idl b/dev/CompatibilityOptions/CompatibilityOptions.idl index 01ebc29bbc..320040abe8 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.idl +++ b/dev/CompatibilityOptions/CompatibilityOptions.idl @@ -5,6 +5,16 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime { + enum CompatibilityChange + { + None = 0, // do not use this value + + // Add real changes here: + + // 1.7.1 + // ... + }; + [contractversion(1)] apicontract CompatibilityContract {}; @@ -33,7 +43,7 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime WindowsAppRuntimeVersion PatchMode2 { get; set; }; /// An optional list of specific servicing changes to disable. - IVector DisabledChanges{ get; }; + IVector DisabledChanges{ get; }; /// Apply the compatibility options to the runtime. void Apply(); diff --git a/test/ContainmentTests/ContainmentTests.cpp b/test/ContainmentTests/ContainmentTests.cpp index 15cacdf65f..b7caf46ac6 100644 --- a/test/ContainmentTests/ContainmentTests.cpp +++ b/test/ContainmentTests/ContainmentTests.cpp @@ -4,9 +4,14 @@ #include "pch.h" #include "AssemblyInfo.h" +#include +#include + namespace TB = ::Test::Bootstrap; namespace TP = ::Test::Packages; +namespace WAR = winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime; + namespace Test::ContainmentTests { class ContainmentTests @@ -65,7 +70,7 @@ namespace Test::ContainmentTests } catch (winrt::hresult_error& e) { - VERIFY_ARE_EQUAL(E_ACCESSDENIED, e.code()); + VERIFY_ARE_EQUAL(E_ILLEGAL_STATE_CHANGE, e.code()); } try @@ -77,7 +82,7 @@ namespace Test::ContainmentTests } catch (winrt::hresult_error& e) { - VERIFY_ARE_EQUAL(E_ACCESSDENIED, e.code()); + VERIFY_ARE_EQUAL(E_ILLEGAL_STATE_CHANGE, e.code()); } } @@ -95,7 +100,25 @@ namespace Test::ContainmentTests options2.Apply(); } - // TODO: Test setting DisabledChanges. - // TODO: Can IsChangeEnabled be directly called to test patch mode check and DisabledChanges? + TEST_METHOD(VerifyDisabledChanges) + { + winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options; + options.PatchMode1({ WINDOWSAPPSDK_RELEASE_MAJOR, WINDOWSAPPSDK_RELEASE_MINOR, 3 }); + options.DisabledChanges().Append((WAR::CompatibilityChange)12345); + options.DisabledChanges().Append((WAR::CompatibilityChange)23456); + options.DisabledChanges().Append((WAR::CompatibilityChange)34567); + options.DisabledChanges().Append(WAR::CompatibilityChange::None); // just to confirm compilation using a real enum value + options.Apply(); + + WEX::Logging::Log::Comment(WEX::Common::String(L"CompatibilityOptions with DisabledChanges applied.")); + + // Verify that the specified DisabledChanges are disabled. + VERIFY_IS_FALSE((WinAppSdk::Containment::IsChangeEnabled<12345, WinAppSDK_Security>())); + VERIFY_IS_FALSE((WinAppSdk::Containment::IsChangeEnabled<23456, WinAppSDK_Security>())); + VERIFY_IS_FALSE((WinAppSdk::Containment::IsChangeEnabled<34567, WinAppSDK_Security>())); + + // A different value not in DisabledChanges should remain enabled. + VERIFY_IS_TRUE((WinAppSdk::Containment::IsChangeEnabled<99999, WinAppSDK_Security>())); + } }; } diff --git a/test/ContainmentTests/ContainmentTests.vcxproj b/test/ContainmentTests/ContainmentTests.vcxproj index 610dd383e1..4b665a6cb0 100644 --- a/test/ContainmentTests/ContainmentTests.vcxproj +++ b/test/ContainmentTests/ContainmentTests.vcxproj @@ -135,6 +135,7 @@ + @@ -148,5 +149,6 @@ + diff --git a/test/ContainmentTests/ContainmentTests.vcxproj.filters b/test/ContainmentTests/ContainmentTests.vcxproj.filters index e6a73fd7a6..f48268d4ce 100644 --- a/test/ContainmentTests/ContainmentTests.vcxproj.filters +++ b/test/ContainmentTests/ContainmentTests.vcxproj.filters @@ -33,4 +33,7 @@ Header Files + + + \ No newline at end of file From 1c4112ebc03d620f30e55fd7a0b635e43ec4698b Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Sat, 7 Dec 2024 15:51:06 -0800 Subject: [PATCH 08/24] Add new targets to the nupkg. --- BuildAll.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BuildAll.ps1 b/BuildAll.ps1 index 94347154fd..a67f0698c8 100644 --- a/BuildAll.ps1 +++ b/BuildAll.ps1 @@ -310,6 +310,7 @@ Try { Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.C.props" -Destination "$BasePath\build\native" Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.WinRt.props" -Destination "$BasePath\build\native" Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.Bootstrap.targets" -Destination "$BasePath\build\native" + Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.ContainmentSetter.targets" -Destination "$BasePath\build\native" Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.DeploymentManager.targets" -Destination "$BasePath\build\native" Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.UndockedRegFreeWinRT.targets" -Destination "$BasePath\build\native" @@ -317,6 +318,7 @@ Try { Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.Foundation.props" -Destination "$BasePath\build" Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.Bootstrap.CS.targets" -Destination "$BasePath\build" Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.BootstrapCommon.targets" -Destination "$BasePath\build" + Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.ContainmentSetter.CS.targets" -Destination "$BasePath\build" Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.DeploymentManager.CS.targets" -Destination "$BasePath\build" Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.DeploymentManagerCommon.targets" -Destination "$BasePath\build" Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.UndockedRegFreeWinRT.CS.targets" -Destination "$BasePath\build" From 352ebd86700f63b17c6ddf71bca36cee02cf5dd0 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Sun, 8 Dec 2024 21:44:24 -0800 Subject: [PATCH 09/24] Renamed tests and .targets to Compatibility instead of Containment. --- WindowsAppRuntime.sln | 2 +- ...osoft.WindowsAppSDK.CompatibilitySetter.CS.targets} | 0 .../NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets | 2 +- ...owsAppSDK-Nuget-Native.CompatibilitySetter.targets} | 0 build/NuSpecs/WindowsAppSDK-Nuget-Native.targets | 2 +- .../Compatibility-AppxManifest.xml} | 8 ++++---- .../CompatibilityTests.cpp} | 10 +++++----- .../CompatibilityTests.vcxproj} | 6 +++--- .../CompatibilityTests.vcxproj.filters} | 6 +++--- .../packages.config | 0 test/{ContainmentTests => CompatibilityTests}/pch.cpp | 0 test/{ContainmentTests => CompatibilityTests}/pch.h | 0 12 files changed, 18 insertions(+), 18 deletions(-) rename build/NuSpecs/{Microsoft.WindowsAppSDK.ContainmentSetter.CS.targets => Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets} (100%) rename build/NuSpecs/{WindowsAppSDK-Nuget-Native.ContainmentSetter.targets => WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets} (100%) rename test/{ContainmentTests/Containment-AppxManifest.xml => CompatibilityTests/Compatibility-AppxManifest.xml} (88%) rename test/{ContainmentTests/ContainmentTests.cpp => CompatibilityTests/CompatibilityTests.cpp} (95%) rename test/{ContainmentTests/ContainmentTests.vcxproj => CompatibilityTests/CompatibilityTests.vcxproj} (97%) rename test/{ContainmentTests/ContainmentTests.vcxproj.filters => CompatibilityTests/CompatibilityTests.vcxproj.filters} (89%) rename test/{ContainmentTests => CompatibilityTests}/packages.config (100%) rename test/{ContainmentTests => CompatibilityTests}/pch.cpp (100%) rename test/{ContainmentTests => CompatibilityTests}/pch.h (100%) diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln index 4bf33c1eac..587a48bd6e 100644 --- a/WindowsAppRuntime.sln +++ b/WindowsAppRuntime.sln @@ -570,7 +570,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompatibilityOptions", "dev EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CompatibilityOptions", "CompatibilityOptions", "{35972D8A-F47E-4875-A341-E8C25DB7A098}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ContainmentTests", "test\ContainmentTests\ContainmentTests.vcxproj", "{040BB64B-012E-4E4F-BB02-E85EF46D3475}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompatibilityTests", "test\CompatibilityTests\CompatibilityTests.vcxproj", "{040BB64B-012E-4E4F-BB02-E85EF46D3475}" ProjectSection(ProjectDependencies) = postProject {F76B776E-86F5-48C5-8FC7-D2795ECC9746} = {F76B776E-86F5-48C5-8FC7-D2795ECC9746} EndProjectSection diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.ContainmentSetter.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets similarity index 100% rename from build/NuSpecs/Microsoft.WindowsAppSDK.ContainmentSetter.CS.targets rename to build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets index 9d93133c71..ab6192c4b8 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets @@ -13,7 +13,7 @@ - + diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.ContainmentSetter.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets similarity index 100% rename from build/NuSpecs/WindowsAppSDK-Nuget-Native.ContainmentSetter.targets rename to build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets index 131cc5d77e..a60ee2953b 100644 --- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets @@ -144,6 +144,6 @@ - + diff --git a/test/ContainmentTests/Containment-AppxManifest.xml b/test/CompatibilityTests/Compatibility-AppxManifest.xml similarity index 88% rename from test/ContainmentTests/Containment-AppxManifest.xml rename to test/CompatibilityTests/Compatibility-AppxManifest.xml index b4c4da11ee..525f949bac 100644 --- a/test/ContainmentTests/Containment-AppxManifest.xml +++ b/test/CompatibilityTests/Compatibility-AppxManifest.xml @@ -9,12 +9,12 @@ IgnorableNamespaces="uap uap5 com rescap"> - WindowsAppRuntime.Test.Containment for tests + WindowsAppRuntime.Test.Compatibility for tests Windows App SDK taef.png @@ -36,10 +36,10 @@ Executable="Te.ProcessHost.uap.exe" EntryPoint="ProcessHostApplication"> diff --git a/test/ContainmentTests/ContainmentTests.cpp b/test/CompatibilityTests/CompatibilityTests.cpp similarity index 95% rename from test/ContainmentTests/ContainmentTests.cpp rename to test/CompatibilityTests/CompatibilityTests.cpp index b7caf46ac6..eb0052c612 100644 --- a/test/ContainmentTests/ContainmentTests.cpp +++ b/test/CompatibilityTests/CompatibilityTests.cpp @@ -12,17 +12,17 @@ namespace TP = ::Test::Packages; namespace WAR = winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime; -namespace Test::ContainmentTests +namespace Test::CompatibilityTests { - class ContainmentTests + class CompatibilityTests { public: - BEGIN_TEST_CLASS(ContainmentTests) + BEGIN_TEST_CLASS(CompatibilityTests) TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA") TEST_CLASS_PROPERTY(L"RunFixtureAs:Class", L"RestrictedUser") TEST_CLASS_PROPERTY(L"RunAs", L"UAP") - TEST_CLASS_PROPERTY(L"UAP:AppxManifest", L"Containment-AppxManifest.xml") - TEST_CLASS_PROPERTY(L"IsolationLevel", L"Method") // each test sets its own containment + TEST_CLASS_PROPERTY(L"UAP:AppxManifest", L"Compatibility-AppxManifest.xml") + TEST_CLASS_PROPERTY(L"IsolationLevel", L"Method") // each test sets its own Compatibility END_TEST_CLASS() TEST_CLASS_SETUP(ClassSetup) diff --git a/test/ContainmentTests/ContainmentTests.vcxproj b/test/CompatibilityTests/CompatibilityTests.vcxproj similarity index 97% rename from test/ContainmentTests/ContainmentTests.vcxproj rename to test/CompatibilityTests/CompatibilityTests.vcxproj index 4b665a6cb0..cda582f540 100644 --- a/test/ContainmentTests/ContainmentTests.vcxproj +++ b/test/CompatibilityTests/CompatibilityTests.vcxproj @@ -32,7 +32,7 @@ 17.0 Win32Proj {040bb64b-012e-4e4f-bb02-e85ef46d3475} - ContainmentTests + CompatibilityTests 10.0 @@ -106,7 +106,7 @@ Create - + $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories) @@ -114,7 +114,7 @@ - + diff --git a/test/ContainmentTests/ContainmentTests.vcxproj.filters b/test/CompatibilityTests/CompatibilityTests.vcxproj.filters similarity index 89% rename from test/ContainmentTests/ContainmentTests.vcxproj.filters rename to test/CompatibilityTests/CompatibilityTests.vcxproj.filters index f48268d4ce..9a70a980e7 100644 --- a/test/ContainmentTests/ContainmentTests.vcxproj.filters +++ b/test/CompatibilityTests/CompatibilityTests.vcxproj.filters @@ -21,7 +21,7 @@ - + Source Files @@ -34,6 +34,6 @@ - + - \ No newline at end of file + diff --git a/test/ContainmentTests/packages.config b/test/CompatibilityTests/packages.config similarity index 100% rename from test/ContainmentTests/packages.config rename to test/CompatibilityTests/packages.config diff --git a/test/ContainmentTests/pch.cpp b/test/CompatibilityTests/pch.cpp similarity index 100% rename from test/ContainmentTests/pch.cpp rename to test/CompatibilityTests/pch.cpp diff --git a/test/ContainmentTests/pch.h b/test/CompatibilityTests/pch.h similarity index 100% rename from test/ContainmentTests/pch.h rename to test/CompatibilityTests/pch.h From 0aa898b6319300209299c696b112ae5821af8b68 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Sun, 8 Dec 2024 22:06:54 -0800 Subject: [PATCH 10/24] Update .targets. Prepare for project file tests. --- WindowsAppRuntime.sln | 5 +- ...ndowsAppSDK.CompatibilitySetter.CS.targets | 57 +++++++------------ ...K-Nuget-Native.CompatibilitySetter.targets | 34 +++++------ 3 files changed, 43 insertions(+), 53 deletions(-) diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln index 587a48bd6e..ec1f8cb6ec 100644 --- a/WindowsAppRuntime.sln +++ b/WindowsAppRuntime.sln @@ -575,6 +575,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompatibilityTests", "test\ {F76B776E-86F5-48C5-8FC7-D2795ECC9746} = {F76B776E-86F5-48C5-8FC7-D2795ECC9746} EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compatibility", "Compatibility", "{423E7BAC-0125-46F4-944D-E8F138B3C654}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2208,7 +2210,8 @@ Global {A949149D-29CA-4AA7-B1ED-0E571B4AD9BB} = {7B323048-439F-47E9-A3D4-7342C5ADE2A5} {1F7B9E9F-9987-490B-9E6E-093C7F63FEC4} = {35972D8A-F47E-4875-A341-E8C25DB7A098} {35972D8A-F47E-4875-A341-E8C25DB7A098} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A} - {040BB64B-012E-4E4F-BB02-E85EF46D3475} = {8630F7AA-2969-4DC9-8700-9B468C1DC21D} + {040BB64B-012E-4E4F-BB02-E85EF46D3475} = {423E7BAC-0125-46F4-944D-E8F138B3C654} + {423E7BAC-0125-46F4-944D-E8F138B3C654} = {8630F7AA-2969-4DC9-8700-9B468C1DC21D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4B3D7591-CFEC-4762-9A07-ABE99938FB77} diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets index bfe7a2d9b5..2634fc37bf 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets @@ -2,62 +2,49 @@ - - $(GeneratedFilesDir)WinAppSDKContainmentSetterCS.cs - + $(GeneratedFilesDir)WinAppSDKCompatibilitySetterCS.cs + compatibilityOptions.PatchMode1 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode))%3B - - + + compatibilityOptions.PatchMode2 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode2))%3B - - - var disabledChangesArray = new System.UInt64[] { $(WindowsAppSDKDisabledChanges) }%3B + + + $([System.Text.RegularExpressions.Regex]::Replace($(WindowsAppSDKDisabledChanges), "\s+", "")) + + var disabledChangesArray = new CompatibilityChange[] { CompatibilityChange.$([System.Text.RegularExpressions.Regex]::Replace($(WinAppSDKCompatibilityDisabledChangesNoSpaces), ",([A-Za-z])", ", CompatibilityChange.$1")) }%3B foreach (var changeId in disabledChangesArray) { compatibilityOptions.DisabledChanges.Add(changeId)%3B } - - - + + + +using Microsoft.Windows.ApplicationModel.WindowsAppRuntime; + // This file is generated by the build based on project properties. -namespace WindowsAppRuntime.Containment.Configuration +namespace WindowsAppRuntime.Compatibility.Configuration { -/* - struct WindowsAppRuntimeVersion - { - uint Major%3B uint Minor%3B uint Patch%3B - internal WindowsAppRuntimeVersion(uint major, uint minor, uint patch) { Major = major%3B Minor = minor%3B Patch = patch%3B } - public override string ToString() { return $"{Major}.{Minor}.{Patch}"%3B } - } - - class CompatibilityOptions - { - public WindowsAppRuntimeVersion PatchMode1 = null%3B - public WindowsAppRuntimeVersion PatchMode2 = null%3B - public System.Collections.Generic.IList<System.UInt64> DisabledChanges = new System.Collections.Generic.IList<System.UInt64>()%3B - public void Apply() { System.Diagnostics.Debug.WriteLine("Applying containment options. PatchModes: " + this.PatchMode1 + "," + this.PatchMode2 + " Disabled changes: " + string.Join(",",this.DisabledChanges.ToArray()))%3B } - } - */ - class AutoInitialize { [global::System.Runtime.CompilerServices.ModuleInitializer] - internal static void ConfigureContainment() + internal static void ConfigureCompatibility() { var compatibilityOptions = new CompatibilityOptions()%3B -$(WinAppSDKContainmentPatchMode1Lines) -$(WinAppSDKContainmentPatchMode2Lines) -$(WinAppSDKContainmentDisabledChangesLines) +$(WinAppSDKCompatibilityPatchMode1Lines) +$(WinAppSDKCompatibilityPatchMode2Lines) +$(WinAppSDKCompatibilityDisabledChangesLines) compatibilityOptions.Apply()%3B } } } - + - - $(GeneratedFilesDir)WinAppSDKContainmentSetter.cpp - + $(GeneratedFilesDir)WinAppSDKCompatibilitySetter.cpp + compatibilityOptions.PatchMode1 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode))%3B - - + + compatibilityOptions.PatchMode2 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode2))%3B - - + + // TODO: compatibilityOptions.DisabledChanges.AddRange(new uint64_t[] { $(WindowsAppSDKDisabledChanges) })%3B - + - + // This file is generated by the build based on project properties. #include <windows.h> -namespace WindowsAppRuntime::Containment::Configuration +namespace WindowsAppRuntime::Compatibility::Configuration { struct AutoInitialize { @@ -33,22 +33,22 @@ namespace WindowsAppRuntime::Containment::Configuration static void Initialize() { CompatibilityOptions compatibilityOptions%3B -$(WinAppSDKContainmentPatchMode1Lines) -$(WinAppSDKContainmentPatchMode2Lines) -$(WinAppSDKContainmentDisabledChangesLines) +$(WinAppSDKCompatibilityPatchMode1Lines) +$(WinAppSDKCompatibilityPatchMode2Lines) +$(WinAppSDKCompatibilityDisabledChangesLines) compatibilityOptions.Apply()%3B } }%3B static AutoInitialize g_autoInitialize%3B } - + - + @@ -59,7 +59,7 @@ $(WinAppSDKContainmentDisabledChangesLines) - $(BeforeClCompileTargets); WinAppSDKContainmentSetterTarget + $(BeforeClCompileTargets); WinAppSDKCompatibilitySetterTarget From ec62fb6d3dd4562520aec5f1febd47560bb7d621 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Mon, 9 Dec 2024 11:12:23 -0800 Subject: [PATCH 11/24] Fixed C++ CompatibilitySetter. Added compile-time test for C++. --- WindowsAppRuntime.sln | 19 ++ ...ndowsAppSDK.CompatibilitySetter.CS.targets | 4 +- ...K-Nuget-Native.CompatibilitySetter.targets | 21 ++- .../Test_CompatibilitySetter_CPP.vcxproj | 164 ++++++++++++++++++ ...st_CompatibilitySetter_CPP.vcxproj.filters | 17 ++ .../Test_CompatibilitySetter_CPP/main.cpp | 10 ++ .../Test_CompatibilitySetter_CPP/pch.cpp | 8 + .../Test_CompatibilitySetter_CPP/pch.h | 24 +++ .../CompatibilityTests/CompatibilityTests.cpp | 2 +- 9 files changed, 261 insertions(+), 8 deletions(-) create mode 100644 test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj create mode 100644 test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj.filters create mode 100644 test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp create mode 100644 test/Compatibility/Test_CompatibilitySetter_CPP/pch.cpp create mode 100644 test/Compatibility/Test_CompatibilitySetter_CPP/pch.h diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln index ec1f8cb6ec..9e6298ffab 100644 --- a/WindowsAppRuntime.sln +++ b/WindowsAppRuntime.sln @@ -577,6 +577,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompatibilityTests", "test\ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compatibility", "Compatibility", "{423E7BAC-0125-46F4-944D-E8F138B3C654}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test_CompatibilitySetter_CPP", "test\Compatibility\Test_CompatibilitySetter_CPP\Test_CompatibilitySetter_CPP.vcxproj", "{7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2029,6 +2031,22 @@ Global {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x64.Build.0 = Release|x64 {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x86.ActiveCfg = Release|Win32 {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x86.Build.0 = Release|Win32 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|Any CPU.ActiveCfg = Debug|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|Any CPU.Build.0 = Debug|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|ARM64.ActiveCfg = Debug|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|ARM64.Build.0 = Debug|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|x64.ActiveCfg = Debug|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|x64.Build.0 = Debug|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|x86.ActiveCfg = Debug|Win32 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|x86.Build.0 = Debug|Win32 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|Any CPU.ActiveCfg = Release|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|Any CPU.Build.0 = Release|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|ARM64.ActiveCfg = Release|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|ARM64.Build.0 = Release|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x64.ActiveCfg = Release|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x64.Build.0 = Release|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x86.ActiveCfg = Release|Win32 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2212,6 +2230,7 @@ Global {35972D8A-F47E-4875-A341-E8C25DB7A098} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A} {040BB64B-012E-4E4F-BB02-E85EF46D3475} = {423E7BAC-0125-46F4-944D-E8F138B3C654} {423E7BAC-0125-46F4-944D-E8F138B3C654} = {8630F7AA-2969-4DC9-8700-9B468C1DC21D} + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA} = {423E7BAC-0125-46F4-944D-E8F138B3C654} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4B3D7591-CFEC-4762-9A07-ABE99938FB77} diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets index 2634fc37bf..4962424c34 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets @@ -7,10 +7,10 @@ $(GeneratedFilesDir)WinAppSDKCompatibilitySetterCS.cs - compatibilityOptions.PatchMode1 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode))%3B + compatibilityOptions.PatchMode1 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode.Replace(".", ",")))%3B - compatibilityOptions.PatchMode2 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode2))%3B + compatibilityOptions.PatchMode2 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode2.Replace(".", ",")))%3B $([System.Text.RegularExpressions.Regex]::Replace($(WindowsAppSDKDisabledChanges), "\s+", "")) diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets index e097e77515..0b9aea9b6f 100644 --- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets @@ -7,18 +7,29 @@ $(GeneratedFilesDir)WinAppSDKCompatibilitySetter.cpp - compatibilityOptions.PatchMode1 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode))%3B + compatibilityOptions.PatchMode1({$(WindowsAppSDKRuntimePatchMode.Replace(".", ","))})%3B - compatibilityOptions.PatchMode2 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode2))%3B + compatibilityOptions.PatchMode2({$(WindowsAppSDKRuntimePatchMode2.Replace(".", ","))})%3B - - // TODO: compatibilityOptions.DisabledChanges.AddRange(new uint64_t[] { $(WindowsAppSDKDisabledChanges) })%3B + $([System.Text.RegularExpressions.Regex]::Replace($(WindowsAppSDKDisabledChanges), "\s+", "")) + + CompatibilityChange disabledChangesArray[] = { CompatibilityChange::$([System.Text.RegularExpressions.Regex]::Replace($(WinAppSDKCompatibilityDisabledChangesNoSpaces), ",([A-Za-z])", ", CompatibilityChange::$1")) }%3B + for (auto changeId : disabledChangesArray) + { + compatibilityOptions.DisabledChanges().Append(changeId)%3B + } // This file is generated by the build based on project properties. -#include <windows.h> +#include <winrt/Windows.Foundation.h> +#include <winrt/Windows.Foundation.Collections.h> + +#include <winrt/Microsoft.Windows.ApplicationModel.WindowsAppRuntime.h> + +using namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime%3B + namespace WindowsAppRuntime::Compatibility::Configuration { struct AutoInitialize diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj new file mode 100644 index 0000000000..07a45e705c --- /dev/null +++ b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj @@ -0,0 +1,164 @@ + + + + + 1.7.3 + 1.8.2 + None, None, (CompatibilityChange)23456, None + + + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + 17.0 + Win32Proj + {7fafcbd2-bdd5-433c-b3d4-700b5c5a67aa} + TestCompatibilitySetterCPP + 10.0 + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Use + true + pch.h + $(RepoRoot)\test\inc;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories);$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)\..\WindowsAppRuntime_BootstrapDLL;$(RepoRoot)\dev\common + $(RepoRoot);%(AdditionalIncludeDirectories) + + + Windows + onecore.lib;onecoreuap.lib;Microsoft.WindowsAppRuntime.lib;%(AdditionalDependencies) + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories);$(OutDir)\..\WindowsAppRuntime_DLL + + + + + NDEBUG;%(PreprocessorDefinitions) + + + + + + + _DEBUG;%(PreprocessorDefinitions) + + + + + + + WIN32;%(PreprocessorDefinitions) + + + + + Create + + + + + + $(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd + true + + + + + {f76b776e-86f5-48c5-8fc7-d2795ecc9746} + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj.filters b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj.filters new file mode 100644 index 0000000000..a8a65633bf --- /dev/null +++ b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + \ No newline at end of file diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp b/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp new file mode 100644 index 0000000000..1931658b9b --- /dev/null +++ b/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. + +#include "pch.h" +#include + +int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, PSTR /*lpCmdLine*/, int /*nCmdShow*/) +{ + return 0; +} diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/pch.cpp b/test/Compatibility/Test_CompatibilitySetter_CPP/pch.cpp new file mode 100644 index 0000000000..a77728ba07 --- /dev/null +++ b/test/Compatibility/Test_CompatibilitySetter_CPP/pch.cpp @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. + +// pch.cpp: source file corresponding to the pre-compiled header + +#include "pch.h" + +// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/pch.h b/test/Compatibility/Test_CompatibilitySetter_CPP/pch.h new file mode 100644 index 0000000000..7efade56bc --- /dev/null +++ b/test/Compatibility/Test_CompatibilitySetter_CPP/pch.h @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. + +#ifndef PCH_H +#define PCH_H + +#include + +#include + +#include +#include + +#include + +//#include + +//#include +//#include +//#include + +#include + +#endif //PCH_H diff --git a/test/CompatibilityTests/CompatibilityTests.cpp b/test/CompatibilityTests/CompatibilityTests.cpp index eb0052c612..2946b78dde 100644 --- a/test/CompatibilityTests/CompatibilityTests.cpp +++ b/test/CompatibilityTests/CompatibilityTests.cpp @@ -91,7 +91,7 @@ namespace Test::CompatibilityTests WEX::Logging::Log::Comment(WEX::Common::String(L"Setting CompatibilityOptions with no matching patch mode")); winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options; options.PatchMode1({ 0, 8, 3 }); - options.PatchMode1({ 1, 1, 4 }); + options.PatchMode2({ 1, 1, 4 }); options.Apply(); // Set a CompatibilityOptions with no patch mode, which should be allowed since neither From 173a511c7d60f34e154a61931b2ed930068b80d7 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Mon, 9 Dec 2024 11:18:26 -0800 Subject: [PATCH 12/24] Moved CompatibilityTests down inside Compatibility --- WindowsAppRuntime.sln | 2 +- .../CompatibilityTests/Compatibility-AppxManifest.xml | 0 .../CompatibilityTests/CompatibilityTests.cpp | 2 +- .../CompatibilityTests/CompatibilityTests.vcxproj | 2 +- .../CompatibilityTests/CompatibilityTests.vcxproj.filters | 0 test/{ => Compatibility}/CompatibilityTests/packages.config | 0 test/{ => Compatibility}/CompatibilityTests/pch.cpp | 0 test/{ => Compatibility}/CompatibilityTests/pch.h | 0 8 files changed, 3 insertions(+), 3 deletions(-) rename test/{ => Compatibility}/CompatibilityTests/Compatibility-AppxManifest.xml (100%) rename test/{ => Compatibility}/CompatibilityTests/CompatibilityTests.cpp (99%) rename test/{ => Compatibility}/CompatibilityTests/CompatibilityTests.vcxproj (98%) rename test/{ => Compatibility}/CompatibilityTests/CompatibilityTests.vcxproj.filters (100%) rename test/{ => Compatibility}/CompatibilityTests/packages.config (100%) rename test/{ => Compatibility}/CompatibilityTests/pch.cpp (100%) rename test/{ => Compatibility}/CompatibilityTests/pch.h (100%) diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln index 9e6298ffab..2605bd9558 100644 --- a/WindowsAppRuntime.sln +++ b/WindowsAppRuntime.sln @@ -570,7 +570,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompatibilityOptions", "dev EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CompatibilityOptions", "CompatibilityOptions", "{35972D8A-F47E-4875-A341-E8C25DB7A098}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompatibilityTests", "test\CompatibilityTests\CompatibilityTests.vcxproj", "{040BB64B-012E-4E4F-BB02-E85EF46D3475}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompatibilityTests", "test\Compatibility\CompatibilityTests\CompatibilityTests.vcxproj", "{040BB64B-012E-4E4F-BB02-E85EF46D3475}" ProjectSection(ProjectDependencies) = postProject {F76B776E-86F5-48C5-8FC7-D2795ECC9746} = {F76B776E-86F5-48C5-8FC7-D2795ECC9746} EndProjectSection diff --git a/test/CompatibilityTests/Compatibility-AppxManifest.xml b/test/Compatibility/CompatibilityTests/Compatibility-AppxManifest.xml similarity index 100% rename from test/CompatibilityTests/Compatibility-AppxManifest.xml rename to test/Compatibility/CompatibilityTests/Compatibility-AppxManifest.xml diff --git a/test/CompatibilityTests/CompatibilityTests.cpp b/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp similarity index 99% rename from test/CompatibilityTests/CompatibilityTests.cpp rename to test/Compatibility/CompatibilityTests/CompatibilityTests.cpp index 2946b78dde..d145cdcd8f 100644 --- a/test/CompatibilityTests/CompatibilityTests.cpp +++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp @@ -22,7 +22,7 @@ namespace Test::CompatibilityTests TEST_CLASS_PROPERTY(L"RunFixtureAs:Class", L"RestrictedUser") TEST_CLASS_PROPERTY(L"RunAs", L"UAP") TEST_CLASS_PROPERTY(L"UAP:AppxManifest", L"Compatibility-AppxManifest.xml") - TEST_CLASS_PROPERTY(L"IsolationLevel", L"Method") // each test sets its own Compatibility + TEST_CLASS_PROPERTY(L"IsolationLevel", L"Method") // each test sets its own CompatibilityOptions END_TEST_CLASS() TEST_CLASS_SETUP(ClassSetup) diff --git a/test/CompatibilityTests/CompatibilityTests.vcxproj b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj similarity index 98% rename from test/CompatibilityTests/CompatibilityTests.vcxproj rename to test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj index cda582f540..14dea6567c 100644 --- a/test/CompatibilityTests/CompatibilityTests.vcxproj +++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj @@ -126,7 +126,7 @@ - + {f76b776e-86f5-48c5-8fc7-d2795ecc9746} diff --git a/test/CompatibilityTests/CompatibilityTests.vcxproj.filters b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj.filters similarity index 100% rename from test/CompatibilityTests/CompatibilityTests.vcxproj.filters rename to test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj.filters diff --git a/test/CompatibilityTests/packages.config b/test/Compatibility/CompatibilityTests/packages.config similarity index 100% rename from test/CompatibilityTests/packages.config rename to test/Compatibility/CompatibilityTests/packages.config diff --git a/test/CompatibilityTests/pch.cpp b/test/Compatibility/CompatibilityTests/pch.cpp similarity index 100% rename from test/CompatibilityTests/pch.cpp rename to test/Compatibility/CompatibilityTests/pch.cpp diff --git a/test/CompatibilityTests/pch.h b/test/Compatibility/CompatibilityTests/pch.h similarity index 100% rename from test/CompatibilityTests/pch.h rename to test/Compatibility/CompatibilityTests/pch.h From 6a42f6e518afd0df694d4c110ef8554207067aeb Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Mon, 9 Dec 2024 15:58:59 -0800 Subject: [PATCH 13/24] Working CompatibilitySetter and compile test for C#. --- WindowsAppRuntime.sln | 19 ++++++++++++ ...ndowsAppSDK.CompatibilitySetter.CS.targets | 11 ++++--- .../Test_CompatibilitySetter_CPP.vcxproj | 3 +- .../Test_CompatibilitySetter_CS/Program.cs | 13 +++++++++ .../Test_CompatibilitySetter_CS.csproj | 29 +++++++++++++++++++ 5 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 test/Compatibility/Test_CompatibilitySetter_CS/Program.cs create mode 100644 test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln index 2605bd9558..64779125b0 100644 --- a/WindowsAppRuntime.sln +++ b/WindowsAppRuntime.sln @@ -579,6 +579,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compatibility", "Compatibil EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test_CompatibilitySetter_CPP", "test\Compatibility\Test_CompatibilitySetter_CPP\Test_CompatibilitySetter_CPP.vcxproj", "{7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_CompatibilitySetter_CS", "test\Compatibility\Test_CompatibilitySetter_CS\Test_CompatibilitySetter_CS.csproj", "{42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2047,6 +2049,22 @@ Global {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x64.Build.0 = Release|x64 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x86.ActiveCfg = Release|Win32 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x86.Build.0 = Release|Win32 + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|ARM64.Build.0 = Debug|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x64.ActiveCfg = Debug|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x64.Build.0 = Debug|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x86.ActiveCfg = Debug|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x86.Build.0 = Debug|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|Any CPU.Build.0 = Release|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|ARM64.ActiveCfg = Release|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|ARM64.Build.0 = Release|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x64.ActiveCfg = Release|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x64.Build.0 = Release|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x86.ActiveCfg = Release|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2231,6 +2249,7 @@ Global {040BB64B-012E-4E4F-BB02-E85EF46D3475} = {423E7BAC-0125-46F4-944D-E8F138B3C654} {423E7BAC-0125-46F4-944D-E8F138B3C654} = {8630F7AA-2969-4DC9-8700-9B468C1DC21D} {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA} = {423E7BAC-0125-46F4-944D-E8F138B3C654} + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9} = {423E7BAC-0125-46F4-944D-E8F138B3C654} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4B3D7591-CFEC-4762-9A07-ABE99938FB77} diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets index 4962424c34..0aa9298637 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets @@ -5,7 +5,7 @@ - $(GeneratedFilesDir)WinAppSDKCompatibilitySetterCS.cs + $(GeneratedFilesDir)WinAppSDKCompatibilitySetter.cs compatibilityOptions.PatchMode1 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode.Replace(".", ",")))%3B @@ -23,7 +23,7 @@ -using Microsoft.Windows.ApplicationModel.WindowsAppRuntime; +using Microsoft.Windows.ApplicationModel.WindowsAppRuntime%3B // This file is generated by the build based on project properties. namespace WindowsAppRuntime.Compatibility.Configuration @@ -43,12 +43,15 @@ $(WinAppSDKCompatibilityDisabledChangesLines) } + - + + + + diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj index 07a45e705c..743cb8eaa6 100644 --- a/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj +++ b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj @@ -7,6 +7,7 @@ None, None, (CompatibilityChange)23456, None + @@ -145,7 +146,7 @@ - + diff --git a/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs b/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs new file mode 100644 index 0000000000..5a39915140 --- /dev/null +++ b/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using System; + +class Program +{ + static void Main(string[] args) + { + Console.WriteLine("hello world"); + Environment.Exit(0); + } +} diff --git a/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj b/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj new file mode 100644 index 0000000000..a89a71d2df --- /dev/null +++ b/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj @@ -0,0 +1,29 @@ + + + + Exe + net6.0 + net6.0-windows10.0.19041.0 + 10.0.17763.0 + x86;x64;arm64;AnyCPU + + + + + + + + + 1.7.3 + 1.8.2 + None, None, (CompatibilityChange)23456, None + + + + + + + + + + From e0eef561d755807d0a40c8d6729f91a0ae6fd444 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Mon, 9 Dec 2024 21:44:14 -0800 Subject: [PATCH 14/24] Cleanup .targets. --- ...ndowsAppSDK.CompatibilitySetter.CS.targets | 20 ++++++------- ...K-Nuget-Native.CompatibilitySetter.targets | 29 +++++++++---------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets index 0aa9298637..81bcf919e1 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets @@ -41,17 +41,17 @@ $(WinAppSDKCompatibilityDisabledChangesLines) } } } - - + + - + - - - - + + + + diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets index 0b9aea9b6f..8e39cc7c3a 100644 --- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets @@ -52,21 +52,20 @@ $(WinAppSDKCompatibilityDisabledChangesLines) }%3B static AutoInitialize g_autoInitialize%3B } - - - - - - - NotUsing - - - + + + + + + + + NotUsing + + + From 8e302e58250adaf5e10de0e0cad5a83b97bca985 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Tue, 10 Dec 2024 14:23:27 -0800 Subject: [PATCH 15/24] Implemented central auto-initializer for C# --- build/CopyFilesToStagingDir.ps1 | 4 +++ ...t.WindowsAppSDK.AutoInitializer.CS.targets | 18 ++++++++++ ...indowsAppSDK.AutoInitializerCommon.targets | 16 +++++++++ ...ndowsAppSDK.CompatibilitySetter.CS.targets | 8 +++-- ...Microsoft.WindowsAppSDK.Foundation.targets | 3 ++ ...K-Nuget-Native.CompatibilitySetter.targets | 2 +- dev/Common/Common.vcxitems | 5 ++- .../WindowsAppRuntimeAutoInitializer.cs | 35 +++++++++++++++++++ .../DeploymentManagerAutoInitializer.cs | 2 +- .../UndockedRegFreeWinRT-AutoInitializer.cs | 2 +- .../MddBootstrapAutoInitializer.cs | 2 +- .../Test_CompatibilitySetter_CS/Program.cs | 3 ++ .../Test_CompatibilitySetter_CS.csproj | 14 ++++++++ ...entManagerAutoInitialize_CS_Default.csproj | 17 +++++++++ ...erAutoInitialize_CS_Options_Default.csproj | 17 +++++++++ ...erAutoInitialize_CS_Options_Defined.csproj | 17 +++++++++ ...nagerAutoInitialize_CS_Options_None.csproj | 17 +++++++++ ..._BootstrapAutoInitialize_CS_Default.csproj | 17 +++++++++ ...apAutoInitialize_CS_Options_Default.csproj | 17 +++++++++ ...apAutoInitialize_CS_Options_Defined.csproj | 17 +++++++++ ...strapAutoInitialize_CS_Options_None.csproj | 17 +++++++++ 21 files changed, 243 insertions(+), 7 deletions(-) create mode 100644 build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets create mode 100644 build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializerCommon.targets create mode 100644 dev/Common/WindowsAppRuntimeAutoInitializer.cs diff --git a/build/CopyFilesToStagingDir.ps1 b/build/CopyFilesToStagingDir.ps1 index 3c261aaac2..cab4991719 100644 --- a/build/CopyFilesToStagingDir.ps1 +++ b/build/CopyFilesToStagingDir.ps1 @@ -210,6 +210,10 @@ PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windo PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.System.winmd $NugetDir\lib\uap10.0 PublishFile $FullBuildOutput\WindowsAppRuntime_UniversalBGTaskDLL\Microsoft.Windows.ApplicationModel.Background.UniversalBGTask.winmd $NugetDir\lib\uap10.0 # +# Common Auto-Initializer Files +PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\WindowsAppRuntimeAutoInitializer.cpp $NugetDir\include +PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\WindowsAppRuntimeAutoInitializer.cs $NugetDir\include +# # Bootstrap Auto-Initializer Files PublishFile $FullBuildOutput\WindowsAppRuntime_BootstrapDLL\MddBootstrapAutoInitializer.cpp $NugetDir\include PublishFile $FullBuildOutput\WindowsAppRuntime_BootstrapDLL\MddBootstrapAutoInitializer.cs $NugetDir\include diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets new file mode 100644 index 0000000000..6a07f12ee4 --- /dev/null +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets @@ -0,0 +1,18 @@ + + + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY + + + + + + + + + diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializerCommon.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializerCommon.targets new file mode 100644 index 0000000000..c98e63bec0 --- /dev/null +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializerCommon.targets @@ -0,0 +1,16 @@ + + + + + + + + + true + + + diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets index 81bcf919e1..e8e05f89a9 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets @@ -2,6 +2,10 @@ + + true + + @@ -26,11 +30,11 @@ using Microsoft.Windows.ApplicationModel.WindowsAppRuntime%3B // This file is generated by the build based on project properties. -namespace WindowsAppRuntime.Compatibility.Configuration +namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Compatibility { class AutoInitialize { - [global::System.Runtime.CompilerServices.ModuleInitializer] + // Called by WindowsAppRuntimeAutoInitializer.cs internal static void ConfigureCompatibility() { var compatibilityOptions = new CompatibilityOptions()%3B diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets index ab6192c4b8..c5e0abfd0c 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets @@ -14,6 +14,9 @@ + + + diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets index 8e39cc7c3a..e96c714048 100644 --- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets @@ -30,7 +30,7 @@ using namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime%3B -namespace WindowsAppRuntime::Compatibility::Configuration +namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility { struct AutoInitialize { diff --git a/dev/Common/Common.vcxitems b/dev/Common/Common.vcxitems index 9fe4e51244..aff5384007 100644 --- a/dev/Common/Common.vcxitems +++ b/dev/Common/Common.vcxitems @@ -32,4 +32,7 @@ - \ No newline at end of file + + + + diff --git a/dev/Common/WindowsAppRuntimeAutoInitializer.cs b/dev/Common/WindowsAppRuntimeAutoInitializer.cs new file mode 100644 index 0000000000..e947953fc4 --- /dev/null +++ b/dev/Common/WindowsAppRuntimeAutoInitializer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// +// Exclude this file from StyleCop analysis. This file isn't generated but is added to projects. +// DO NOT MODIFY. Changes to this file may cause incorrect behavior and will be lost on updates. +// + + +namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Common +{ + class AutoInitialize + { + [global::System.Runtime.CompilerServices.ModuleInitializer] + internal static void InitializeWindowsAppSDK() + { + // Call the AutoInitialize functions, as needed, starting with those initializing the WindowsAppRuntime +#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + Microsoft.Windows.ApplicationModel.DynamicDependency.BootstrapCS.AutoInitialize.AccessWindowsAppSDK(); +#endif +#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER + Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManagerCS.AutoInitialize.AccessWindowsAppSDK(); +#endif +#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT + Microsoft.Windows.Foundation.UndockedRegFreeWinRTCS.AutoInitialize.AccessWindowsAppSDK(); +#endif + + // Compatibility happens just after initializing WindowsAppRuntime +#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY + Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Compatibility.AutoInitialize.ConfigureCompatibility(); +#endif + } + } +} + diff --git a/dev/Deployment/DeploymentManagerAutoInitializer.cs b/dev/Deployment/DeploymentManagerAutoInitializer.cs index 3031f8012c..f31259f157 100644 --- a/dev/Deployment/DeploymentManagerAutoInitializer.cs +++ b/dev/Deployment/DeploymentManagerAutoInitializer.cs @@ -24,7 +24,7 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManager { class AutoInitialize { - [global::System.Runtime.CompilerServices.ModuleInitializer] + // Called by WindowsAppRuntimeAutoInitializer.cs internal static void AccessWindowsAppSDK() { var options = Options; diff --git a/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cs b/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cs index e9a29c56f1..2e07c542df 100644 --- a/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cs +++ b/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cs @@ -20,7 +20,7 @@ internal static class NativeMethods class AutoInitialize { - [global::System.Runtime.CompilerServices.ModuleInitializer] + // Called by WindowsAppRuntimeAutoInitializer.cs internal static void AccessWindowsAppSDK() { // Set base directory env var for PublishSingleFile support (referenced by SxS redirection) diff --git a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cs b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cs index bbd9503bdc..19b7ec350e 100644 --- a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cs +++ b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cs @@ -28,7 +28,7 @@ namespace Microsoft.Windows.ApplicationModel.DynamicDependency.BootstrapCS { class AutoInitialize { - [global::System.Runtime.CompilerServices.ModuleInitializer] + // Called by WindowsAppRuntimeAutoInitializer.cs internal static void AccessWindowsAppSDK() { uint majorMinorVersion = global::Microsoft.WindowsAppSDK.Release.MajorMinor; diff --git a/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs b/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs index 5a39915140..fd7eee9890 100644 --- a/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs +++ b/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs @@ -7,6 +7,9 @@ class Program { static void Main(string[] args) { + // Note: This test app currently only tests that the compatibility properties set in + // the project file generates the ConfigureCompatibility() function and compiles successfully. + Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Compatibility.AutoInitialize.ConfigureCompatibility(); Console.WriteLine("hello world"); Environment.Exit(0); } diff --git a/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj b/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj index a89a71d2df..0ffab6d197 100644 --- a/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj +++ b/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj @@ -23,7 +23,21 @@ + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY + + + + + + + diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Default/Test_DeploymentManagerAutoInitialize_CS_Default.csproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Default/Test_DeploymentManagerAutoInitialize_CS_Default.csproj index cdd19c17fb..32f30e2bdf 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Default/Test_DeploymentManagerAutoInitialize_CS_Default.csproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Default/Test_DeploymentManagerAutoInitialize_CS_Default.csproj @@ -28,4 +28,21 @@ + + true + + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY + + + + + + + diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Default/Test_DeploymentManagerAutoInitialize_CS_Options_Default.csproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Default/Test_DeploymentManagerAutoInitialize_CS_Options_Default.csproj index 667c0a8d09..cad9d4c118 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Default/Test_DeploymentManagerAutoInitialize_CS_Options_Default.csproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Default/Test_DeploymentManagerAutoInitialize_CS_Options_Default.csproj @@ -32,4 +32,21 @@ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_DEPLOYMENTMANAGER_AUTO_INITIALIZE_OPTIONS_DEFAULT + + true + + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY + + + + + + + diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Defined/Test_DeploymentManagerAutoInitialize_CS_Options_Defined.csproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Defined/Test_DeploymentManagerAutoInitialize_CS_Options_Defined.csproj index 9c2e6cd230..7cd30f6bbd 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Defined/Test_DeploymentManagerAutoInitialize_CS_Options_Defined.csproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Defined/Test_DeploymentManagerAutoInitialize_CS_Options_Defined.csproj @@ -32,4 +32,21 @@ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_DEPLOYMENTMANAGER_AUTO_INITIALIZE_OPTIONS_ONERROR_SHOWUI + + true + + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY + + + + + + + diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_None/Test_DeploymentManagerAutoInitialize_CS_Options_None.csproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_None/Test_DeploymentManagerAutoInitialize_CS_Options_None.csproj index dd7cb976ff..32c1527e0d 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_None/Test_DeploymentManagerAutoInitialize_CS_Options_None.csproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_None/Test_DeploymentManagerAutoInitialize_CS_Options_None.csproj @@ -32,4 +32,21 @@ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_DEPLOYMENTMANAGER_AUTO_INITIALIZE_OPTIONS_NONE + + true + + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY + + + + + + + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj index 7b04aad9e2..01a95ce732 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj @@ -44,4 +44,21 @@ + + true + + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY + + + + + + + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj index 698b55808d..6670ed342e 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj @@ -48,4 +48,21 @@ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_DEFAULT + + true + + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY + + + + + + + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj index decac1ca42..9ebe00d7c2 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj @@ -52,4 +52,21 @@ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONPACKAGEIDENTITY_NOOP + + true + + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY + + + + + + + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj index 76cd979f05..f226eaa000 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj @@ -48,4 +48,21 @@ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_NONE + + true + + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY + + + + + + + From 46235cd80e11bfa5e7938b30255451fe5a7ae004 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Wed, 11 Dec 2024 10:24:38 -0800 Subject: [PATCH 16/24] C++ common AutoInitializer. --- ...t.WindowsAppSDK.AutoInitializer.CS.targets | 4 +- ...ppSDK-Nuget-Native.AutoInitializer.targets | 17 ++++++ ...K-Nuget-Native.CompatibilitySetter.targets | 17 +++--- .../WindowsAppSDK-Nuget-Native.targets | 3 + dev/Common/Common.vcxitems | 1 + .../WindowsAppRuntimeAutoInitializer.cpp | 59 +++++++++++++++++++ .../DeploymentManagerAutoInitializer.cpp | 13 +--- .../UndockedRegFreeWinRT-AutoInitializer.cpp | 6 +- .../MddBootstrapAutoInitializer.cpp | 14 ++--- .../Test_CompatibilitySetter_CPP.vcxproj | 13 ++++ .../Test_CompatibilitySetter_CPP/main.cpp | 11 ++++ .../Test_CompatibilitySetter_CS/Program.cs | 3 + ...tManagerAutoInitialize_CPP_Default.vcxproj | 17 ++++++ ...AutoInitialize_CPP_Options_Default.vcxproj | 17 ++++++ ...AutoInitialize_CPP_Options_Defined.vcxproj | 17 ++++++ ...gerAutoInitialize_CPP_Options_None.vcxproj | 17 ++++++ ...ootstrapAutoInitialize_CPP_Default.vcxproj | 17 ++++++ ...AutoInitialize_CPP_Options_Default.vcxproj | 17 ++++++ ...AutoInitialize_CPP_Options_Defined.vcxproj | 17 ++++++ ...rapAutoInitialize_CPP_Options_None.vcxproj | 17 ++++++ 20 files changed, 263 insertions(+), 34 deletions(-) create mode 100644 build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets create mode 100644 dev/Common/WindowsAppRuntimeAutoInitializer.cpp diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets index 6a07f12ee4..6b34a1b09a 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets @@ -10,8 +10,8 @@ - - + + diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets new file mode 100644 index 0000000000..d562afb212 --- /dev/null +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets @@ -0,0 +1,17 @@ + + + + + + + + NotUsing + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) + + + + + diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets index e96c714048..d9d8659dbb 100644 --- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets @@ -2,6 +2,10 @@ + + true + + @@ -32,16 +36,10 @@ using namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime%3 namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility { - struct AutoInitialize + namespace AutoInitialize { - AutoInitialize() - { - Initialize()%3B - } - - ~AutoInitialize() = default%3B - - static void Initialize() + // Called by WindowsAppRuntimeAutoInitializer.cpp + void Initialize() { CompatibilityOptions compatibilityOptions%3B $(WinAppSDKCompatibilityPatchMode1Lines) @@ -50,7 +48,6 @@ $(WinAppSDKCompatibilityDisabledChangesLines) compatibilityOptions.Apply()%3B } }%3B - static AutoInitialize g_autoInitialize%3B } diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets index a60ee2953b..de2a3ebf13 100644 --- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets @@ -146,4 +146,7 @@ + + + diff --git a/dev/Common/Common.vcxitems b/dev/Common/Common.vcxitems index aff5384007..6b554ac6f2 100644 --- a/dev/Common/Common.vcxitems +++ b/dev/Common/Common.vcxitems @@ -34,5 +34,6 @@ + diff --git a/dev/Common/WindowsAppRuntimeAutoInitializer.cpp b/dev/Common/WindowsAppRuntimeAutoInitializer.cpp new file mode 100644 index 0000000000..7596fb1e3b --- /dev/null +++ b/dev/Common/WindowsAppRuntimeAutoInitializer.cpp @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// Forward-declare the various AutoInitialize functions +namespace Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap +{ + namespace AutoInitialize { void Initialize(); void Shutdown(); }; +} +namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentManager +{ + namespace AutoInitialize { void Initialize(); }; +} +namespace Microsoft::Windows::Foundation::UndockedRegFreeWinRT +{ + namespace AutoInitialize { void Initialize(); }; +} +namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility +{ + namespace AutoInitialize { void Initialize(); }; +} + +// The common AutoInitialize struct that calls the various AutoInitialize functions +namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Common +{ + struct AutoInitialize + { + AutoInitialize() + { + Initialize(); + } + + ~AutoInitialize() + { +#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap::AutoInitialize::Shutdown(); +#endif + } + + static void Initialize() + { + // Call the AutoInitialize functions, as needed, starting with those initializing the WindowsAppRuntime +#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap::AutoInitialize::Initialize(); +#endif +#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER + Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentManager::AutoInitialize::Initialize(); +#endif +#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT + Microsoft::Windows::Foundation::UndockedRegFreeWinRT::AutoInitialize::Initialize(); +#endif + + // Compatibility happens just after initializing WindowsAppRuntime +#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY + Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility::AutoInitialize::Initialize(); +#endif + } + }; + static AutoInitialize g_autoInitialize; +} diff --git a/dev/Deployment/DeploymentManagerAutoInitializer.cpp b/dev/Deployment/DeploymentManagerAutoInitializer.cpp index f48b7be070..07a3bcaf7e 100644 --- a/dev/Deployment/DeploymentManagerAutoInitializer.cpp +++ b/dev/Deployment/DeploymentManagerAutoInitializer.cpp @@ -24,15 +24,8 @@ namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentManager { - struct AutoInitialize + namespace AutoInitialize { - AutoInitialize() - { - Initialize(); - } - - ~AutoInitialize() = default; - static ::winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentInitializeOptions Options() { ::winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentInitializeOptions options; @@ -50,7 +43,8 @@ namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentMan return options; } - static void Initialize() + // Called by WindowsAppRuntimeAutoInitializer.cpp + void Initialize() { auto options{ Options() }; auto deploymentResult{ ::winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentManager::Initialize(options) }; @@ -61,5 +55,4 @@ namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentMan } } }; - static AutoInitialize g_autoInitialize; } diff --git a/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cpp b/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cpp index e22415b6c3..2ca590db64 100644 --- a/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cpp +++ b/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cpp @@ -12,9 +12,10 @@ STDAPI WindowsAppRuntime_EnsureIsLoaded(); namespace Microsoft::Windows::Foundation::UndockedRegFreeWinRT { - struct AutoInitialize + namespace AutoInitialize { - AutoInitialize() + // Called by WindowsAppRuntimeAutoInitializer.cpp + void Initialize() { // Load the Windows App SDK runtime DLL. The only reason this could fail // is if the loading application using WinAppSDK/SelfContained has a @@ -38,5 +39,4 @@ namespace Microsoft::Windows::Foundation::UndockedRegFreeWinRT #endif } }; - static AutoInitialize g_autoInitialize; } diff --git a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp index 777a696e84..f2aa32d42a 100644 --- a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp +++ b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp @@ -24,14 +24,10 @@ namespace Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap { - struct AutoInitialize + namespace AutoInitialize { - AutoInitialize() - { - Initialize(); - } - - ~AutoInitialize() + // Called by WindowsAppRuntimeAutoInitializer.cpp + void Shutdown() { ::MddBootstrapShutdown(); } @@ -66,7 +62,8 @@ namespace Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap #endif } - static void Initialize() + // Called by WindowsAppRuntimeAutoInitializer.cpp + void Initialize() { const UINT32 c_majorMinorVersion{ WINDOWSAPPSDK_RELEASE_MAJORMINOR }; PCWSTR c_versionTag{ WINDOWSAPPSDK_RELEASE_VERSION_TAG_W }; @@ -79,5 +76,4 @@ namespace Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap } } }; - static AutoInitialize g_autoInitialize; } diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj index 743cb8eaa6..3a4abb8bab 100644 --- a/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj +++ b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj @@ -147,9 +147,22 @@ + + + + + NotUsing + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) + + + + diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp b/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp index 1931658b9b..5828920135 100644 --- a/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp +++ b/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp @@ -4,7 +4,18 @@ #include "pch.h" #include +namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility +{ + namespace AutoInitialize { void Initialize(); }; +} + int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, PSTR /*lpCmdLine*/, int /*nCmdShow*/) { + // Note: This test app currently only tests that the compatibility properties set in + // the project file generates the ConfigureCompatibility() function and compiles successfully. + Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility::AutoInitialize::Initialize(); + // App using the or project properties should + // NOT directly call the above function. This test calls it just to verify that the function is generated. + return 0; } diff --git a/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs b/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs index fd7eee9890..024580e217 100644 --- a/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs +++ b/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs @@ -10,6 +10,9 @@ static void Main(string[] args) // Note: This test app currently only tests that the compatibility properties set in // the project file generates the ConfigureCompatibility() function and compiles successfully. Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Compatibility.AutoInitialize.ConfigureCompatibility(); + // App using the or project properties should + // NOT directly call the above function. This test calls it just to verify that the function is generated. + Console.WriteLine("hello world"); Environment.Exit(0); } diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Default/Test_DeploymentManagerAutoInitialize_CPP_Default.vcxproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Default/Test_DeploymentManagerAutoInitialize_CPP_Default.vcxproj index d45927dca1..0a7a4dd421 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Default/Test_DeploymentManagerAutoInitialize_CPP_Default.vcxproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Default/Test_DeploymentManagerAutoInitialize_CPP_Default.vcxproj @@ -104,6 +104,23 @@ + + + true + + + + + + NotUsing + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) + + + + $(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Default/Test_DeploymentManagerAutoInitialize_CPP_Options_Default.vcxproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Default/Test_DeploymentManagerAutoInitialize_CPP_Options_Default.vcxproj index c12c69907e..84c8789ccd 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Default/Test_DeploymentManagerAutoInitialize_CPP_Options_Default.vcxproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Default/Test_DeploymentManagerAutoInitialize_CPP_Options_Default.vcxproj @@ -105,6 +105,23 @@ + + + true + + + + + + NotUsing + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) + + + + $(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined.vcxproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined.vcxproj index 7f5cd6010a..26647704fb 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined.vcxproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined.vcxproj @@ -105,6 +105,23 @@ + + + true + + + + + + NotUsing + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) + + + + $(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_None/Test_DeploymentManagerAutoInitialize_CPP_Options_None.vcxproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_None/Test_DeploymentManagerAutoInitialize_CPP_Options_None.vcxproj index 2fea49a7fe..4929a29724 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_None/Test_DeploymentManagerAutoInitialize_CPP_Options_None.vcxproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_None/Test_DeploymentManagerAutoInitialize_CPP_Options_None.vcxproj @@ -105,6 +105,23 @@ + + + true + + + + + + NotUsing + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) + + + + $(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj index 6ae0e95ea3..7bcd3e975e 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj @@ -104,6 +104,23 @@ + + + true + + + + + + NotUsing + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) + + + + {f76b776e-86f5-48c5-8fc7-d2795ecc9746} diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj index 06b51e1b63..a15d493a18 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj @@ -105,6 +105,23 @@ + + + true + + + + + + NotUsing + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) + + + + {f76b776e-86f5-48c5-8fc7-d2795ecc9746} diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj index c56712e266..e9d515ed0a 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj @@ -109,6 +109,23 @@ + + + true + + + + + + NotUsing + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) + + + + {f76b776e-86f5-48c5-8fc7-d2795ecc9746} diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj index 2fe73168e1..f586a6959c 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj @@ -105,6 +105,23 @@ + + + true + + + + + + NotUsing + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) + + + + {f76b776e-86f5-48c5-8fc7-d2795ecc9746} From 8ba75295ff9c4dc994208320c05ce3daa7553c20 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Fri, 13 Dec 2024 10:40:36 -0800 Subject: [PATCH 17/24] Comment changes in the idl --- dev/CompatibilityOptions/CompatibilityOptions.idl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dev/CompatibilityOptions/CompatibilityOptions.idl b/dev/CompatibilityOptions/CompatibilityOptions.idl index 320040abe8..42554cecf2 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.idl +++ b/dev/CompatibilityOptions/CompatibilityOptions.idl @@ -5,9 +5,10 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime { + /// The set of servicing changes that can be disabled. enum CompatibilityChange { - None = 0, // do not use this value + None = 0, /// do not use this value // Add real changes here: @@ -18,6 +19,7 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime [contractversion(1)] apicontract CompatibilityContract {}; + /// Represents a version of the Windows App Runtime. [contract(CompatibilityContract, 1), feature(Feature_CompatibilityOptions)] struct WindowsAppRuntimeVersion { @@ -29,7 +31,7 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime /// This object is used by the app to configure any desired compatibility options /// for Windows App Runtime behavior of changes added in servicing updates. This /// object is only used to set the runtime behavior and can't be used to query the - /// applied settings. + /// applied options. // TODO: Get agreement and add a generic Feature_Experimental [contract(CompatibilityContract, 1), feature(Feature_CompatibilityOptions)] runtimeclass CompatibilityOptions From 629e5d97859d9c4948678d18327c507b659e594f Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Sat, 14 Dec 2024 17:10:00 -0800 Subject: [PATCH 18/24] Fix .targets copying. --- BuildAll.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/BuildAll.ps1 b/BuildAll.ps1 index a67f0698c8..a3ac3486d4 100644 --- a/BuildAll.ps1 +++ b/BuildAll.ps1 @@ -309,16 +309,19 @@ Try { Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.props" -Destination "$BasePath\build\native\Microsoft.WindowsAppSDK.Foundation.props" Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.C.props" -Destination "$BasePath\build\native" Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.WinRt.props" -Destination "$BasePath\build\native" + Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.AutoInitializer.targets" -Destination "$BasePath\build\native" Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.Bootstrap.targets" -Destination "$BasePath\build\native" - Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.ContainmentSetter.targets" -Destination "$BasePath\build\native" + Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets" -Destination "$BasePath\build\native" Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.DeploymentManager.targets" -Destination "$BasePath\build\native" Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.UndockedRegFreeWinRT.targets" -Destination "$BasePath\build\native" Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.Foundation.targets" -Destination "$BasePath\build" Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.Foundation.props" -Destination "$BasePath\build" + Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.AutoInitializer.CS.targets" -Destination "$BasePath\build" + Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.AutoInitializerCommon.targets" -Destination "$BasePath\build" Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.Bootstrap.CS.targets" -Destination "$BasePath\build" Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.BootstrapCommon.targets" -Destination "$BasePath\build" - Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.ContainmentSetter.CS.targets" -Destination "$BasePath\build" + Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets" -Destination "$BasePath\build" Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.DeploymentManager.CS.targets" -Destination "$BasePath\build" Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.DeploymentManagerCommon.targets" -Destination "$BasePath\build" Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.UndockedRegFreeWinRT.CS.targets" -Destination "$BasePath\build" From 92ef2921c2a59a940ac683ecac15c29d25fb2173 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Sun, 15 Dec 2024 10:23:59 -0800 Subject: [PATCH 19/24] Add CompatibilityTests in TestAll runs. --- .../CompatibilityTests/CompatibilityTests.testdef | 11 +++++++++++ .../CompatibilityTests/CompatibilityTests.vcxproj | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 test/Compatibility/CompatibilityTests/CompatibilityTests.testdef diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.testdef b/test/Compatibility/CompatibilityTests/CompatibilityTests.testdef new file mode 100644 index 0000000000..74ab26c2d6 --- /dev/null +++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.testdef @@ -0,0 +1,11 @@ +{ + "Tests": [ + { + "Description": "CompatibilityOptions tests (x86 not currently enabled)", + "Filename": "CompatibilityTests.dll", + "Parameters": "", + "Architectures": ["x64", "arm64"], + "Status": "Enabled" + } + ] +} diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj index 14dea6567c..48034d3f8d 100644 --- a/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj +++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj @@ -151,4 +151,7 @@ + + + From 965f5132135cd7d48eae7bc7ac0175b49bd93ac3 Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Sun, 15 Dec 2024 20:26:30 -0800 Subject: [PATCH 20/24] Fix Bootstrap use to run unpackaged. --- .../Compatibility-AppxManifest.xml | 55 ------------------- .../CompatibilityTests/CompatibilityTests.cpp | 15 ++--- .../CompatibilityTests.vcxproj | 7 +-- .../CompatibilityTests.vcxproj.filters | 5 +- 4 files changed, 11 insertions(+), 71 deletions(-) delete mode 100644 test/Compatibility/CompatibilityTests/Compatibility-AppxManifest.xml diff --git a/test/Compatibility/CompatibilityTests/Compatibility-AppxManifest.xml b/test/Compatibility/CompatibilityTests/Compatibility-AppxManifest.xml deleted file mode 100644 index 525f949bac..0000000000 --- a/test/Compatibility/CompatibilityTests/Compatibility-AppxManifest.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - WindowsAppRuntime.Test.Compatibility for tests - Windows App SDK - taef.png - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp b/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp index d145cdcd8f..60bb7d149c 100644 --- a/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp +++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp @@ -18,36 +18,37 @@ namespace Test::CompatibilityTests { public: BEGIN_TEST_CLASS(CompatibilityTests) - TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA") + TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA") // MTA is required for ::Test::Bootstrap::Setup() TEST_CLASS_PROPERTY(L"RunFixtureAs:Class", L"RestrictedUser") - TEST_CLASS_PROPERTY(L"RunAs", L"UAP") - TEST_CLASS_PROPERTY(L"UAP:AppxManifest", L"Compatibility-AppxManifest.xml") TEST_CLASS_PROPERTY(L"IsolationLevel", L"Method") // each test sets its own CompatibilityOptions END_TEST_CLASS() TEST_CLASS_SETUP(ClassSetup) { - //::Test::Bootstrap::SetupPackages(Test::Bootstrap::Packages::Framework); - //::Test::Bootstrap::SetupBootstrap(); - ::Test::Bootstrap::Setup(); + ::Test::Bootstrap::SetupPackages(); return true; } TEST_CLASS_CLEANUP(ClassCleanup) { - ::Test::Bootstrap::Cleanup(); + ::Test::Bootstrap::CleanupPackages(); return true; } TEST_METHOD_SETUP(MethodInit) { VERIFY_IS_TRUE(TP::IsPackageRegistered_WindowsAppRuntimeFramework()); + + // The test method setup and execution is on a different thread than the class setup. + // Initialize the framework for the test thread. + ::Test::Bootstrap::SetupBootstrap(); return true; } TEST_METHOD_CLEANUP(MethodUninit) { VERIFY_IS_TRUE(TP::IsPackageRegistered_WindowsAppRuntimeFramework()); + ::Test::Bootstrap::CleanupBootstrap(); return true; } diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj index 48034d3f8d..2d45fbefd5 100644 --- a/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj +++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj @@ -113,9 +113,6 @@ - - - @@ -151,7 +148,7 @@ - + - + \ No newline at end of file diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj.filters b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj.filters index 9a70a980e7..dc1c446641 100644 --- a/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj.filters +++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj.filters @@ -33,7 +33,4 @@ Header Files - - - - + \ No newline at end of file From 26adfd635ea1acd327d5827988751be2bcea950e Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Sun, 15 Dec 2024 21:45:35 -0800 Subject: [PATCH 21/24] Minor cleanup. --- ...dowsAppSDK-Nuget-Native.CompatibilitySetter.targets | 2 +- build/VersionInfo/GenerateVersionInfo.ps1 | 10 +++++----- dev/CompatibilityOptions/CompatibilityOptions.cpp | 1 + docs/Coding-Guidelines/GettingStarted.md | 2 +- .../CompatibilityTests/CompatibilityTests.cpp | 2 +- .../CompatibilityTests/CompatibilityTests.vcxproj | 6 ++---- .../Test_CompatibilitySetter_CPP.vcxproj | 2 ++ .../Test_CompatibilitySetter_CPP/main.cpp | 6 +++--- .../Test_CompatibilitySetter_CS/Program.cs | 4 ++-- .../Test_CompatibilitySetter_CS.csproj | 2 ++ 10 files changed, 20 insertions(+), 17 deletions(-) diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets index d9d8659dbb..dd2fbc2d73 100644 --- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets @@ -47,7 +47,7 @@ $(WinAppSDKCompatibilityPatchMode2Lines) $(WinAppSDKCompatibilityDisabledChangesLines) compatibilityOptions.Apply()%3B } - }%3B + } } diff --git a/build/VersionInfo/GenerateVersionInfo.ps1 b/build/VersionInfo/GenerateVersionInfo.ps1 index 3090a1f7e6..e2e8ec583f 100644 --- a/build/VersionInfo/GenerateVersionInfo.ps1 +++ b/build/VersionInfo/GenerateVersionInfo.ps1 @@ -139,7 +139,7 @@ Write-Verbose "Writing $assemblyInfoVerPath..." [System.IO.File]::WriteAllLines($assemblyInfoVerPath, $assemblyInfoVer, $utf8NoBomEncoding) # Generating AssemblyInfo.h override -$assemblyInfoCs = @" +$assemblyInfoH = @" // Copyright (c) Microsoft Corporation and Contributors. // Licensed under the MIT License. @@ -152,8 +152,8 @@ $assemblyInfoCs = @" #endif "@ -Write-Verbose $assemblyInfoCs -$assemblyInfoCsPath = "$scriptFullPath/AssemblyInfo.h" -Write-Verbose "Writing $assemblyInfoCsPath..." -[System.IO.File]::WriteAllLines($assemblyInfoCsPath, $assemblyInfoCs, $utf8NoBomEncoding) +Write-Verbose $assemblyInfoH +$assemblyInfoHPath = "$scriptFullPath/AssemblyInfo.h" +Write-Verbose "Writing $assemblyInfoHPath..." +[System.IO.File]::WriteAllLines($assemblyInfoHPath, $assemblyInfoH, $utf8NoBomEncoding) diff --git a/dev/CompatibilityOptions/CompatibilityOptions.cpp b/dev/CompatibilityOptions/CompatibilityOptions.cpp index 824f1af375..8f41e0d586 100644 --- a/dev/CompatibilityOptions/CompatibilityOptions.cpp +++ b/dev/CompatibilityOptions/CompatibilityOptions.cpp @@ -13,6 +13,7 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem { return m_disabledChanges; } + void CompatibilityOptions::Apply() { WinAppSdk::Containment::WinAppSDKRuntimeConfiguration config; diff --git a/docs/Coding-Guidelines/GettingStarted.md b/docs/Coding-Guidelines/GettingStarted.md index fa38f53bbc..9c2ef2bb31 100644 --- a/docs/Coding-Guidelines/GettingStarted.md +++ b/docs/Coding-Guidelines/GettingStarted.md @@ -87,7 +87,7 @@ Now you're ready to load `WindowsAppRuntime.sln` and start development! Some tips: -* If VS starts in a configuration of ``Any CPU``, switch to a specific architecture like `x64` +* If VS starts in a configuration of `Any CPU`, switch to a specific architecture like `x64` to succeessfully build. * Build everything in VS via the Build menu's `Build Solution` or `Rebuild Solution` * Right-click on individual projects in Solution Explorer to only build select projects. diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp b/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp index 60bb7d149c..2d4b010652 100644 --- a/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp +++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp @@ -18,7 +18,7 @@ namespace Test::CompatibilityTests { public: BEGIN_TEST_CLASS(CompatibilityTests) - TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA") // MTA is required for ::Test::Bootstrap::Setup() + TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA") // MTA is required for ::Test::Bootstrap::SetupPackages() TEST_CLASS_PROPERTY(L"RunFixtureAs:Class", L"RestrictedUser") TEST_CLASS_PROPERTY(L"IsolationLevel", L"Method") // each test sets its own CompatibilityOptions END_TEST_CLASS() diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj index 2d45fbefd5..ee37756ff4 100644 --- a/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj +++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj @@ -137,6 +137,7 @@ + @@ -148,7 +149,4 @@ - - - - \ No newline at end of file + diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj index 3a4abb8bab..6f33715e69 100644 --- a/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj +++ b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj @@ -4,6 +4,8 @@ 1.7.3 1.8.2 + None, None, (CompatibilityChange)23456, None diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp b/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp index 5828920135..9c977dbf3e 100644 --- a/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp +++ b/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp @@ -11,10 +11,10 @@ namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, PSTR /*lpCmdLine*/, int /*nCmdShow*/) { - // Note: This test app currently only tests that the compatibility properties set in - // the project file generates the ConfigureCompatibility() function and compiles successfully. + // Note: This test app currently only tests that the compatibility properties specified in + // the project file generates the Initialize() function and compiles successfully. Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility::AutoInitialize::Initialize(); - // App using the or project properties should + // Apps using the or project properties should // NOT directly call the above function. This test calls it just to verify that the function is generated. return 0; diff --git a/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs b/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs index 024580e217..a66d210f15 100644 --- a/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs +++ b/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs @@ -7,10 +7,10 @@ class Program { static void Main(string[] args) { - // Note: This test app currently only tests that the compatibility properties set in + // Note: This test app currently only tests that the compatibility properties specified in // the project file generates the ConfigureCompatibility() function and compiles successfully. Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Compatibility.AutoInitialize.ConfigureCompatibility(); - // App using the or project properties should + // Apps using the or project properties should // NOT directly call the above function. This test calls it just to verify that the function is generated. Console.WriteLine("hello world"); diff --git a/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj b/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj index 0ffab6d197..c37e18bfc7 100644 --- a/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj +++ b/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj @@ -16,6 +16,8 @@ 1.7.3 1.8.2 + None, None, (CompatibilityChange)23456, None From 575c5de88ad4fb7ba89840c38db4e8ede3da33be Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Mon, 16 Dec 2024 14:44:42 -0800 Subject: [PATCH 22/24] CR feedback. --- WindowsAppRuntime.sln | 40 +++++++++---------- ...t.WindowsAppSDK.AutoInitializer.CS.targets | 2 +- ...indowsAppSDK.AutoInitializerCommon.targets | 2 +- ...ndowsAppSDK.CompatibilitySetter.CS.targets | 36 ++++++++--------- ...Microsoft.WindowsAppSDK.Foundation.targets | 2 +- ...ppSDK-Nuget-Native.AutoInitializer.targets | 2 +- ...K-Nuget-Native.CompatibilitySetter.targets | 36 ++++++++--------- .../WindowsAppSDK-Nuget-Native.targets | 2 +- docs/Coding-Guidelines/GettingStarted.md | 2 +- .../CompatibilityTests/CompatibilityTests.cpp | 17 ++++++++ .../Test_CompatibilitySetter_CPP.vcxproj | 15 +------ .../Test_CompatibilitySetter_CS.csproj | 16 +------- ...tManagerAutoInitialize_CPP_Default.vcxproj | 13 +----- ...AutoInitialize_CPP_Options_Default.vcxproj | 13 +----- ...AutoInitialize_CPP_Options_Defined.vcxproj | 13 +----- ...gerAutoInitialize_CPP_Options_None.vcxproj | 13 +----- ...entManagerAutoInitialize_CS_Default.csproj | 14 +------ ...erAutoInitialize_CS_Options_Default.csproj | 14 +------ ...nagerAutoInitialize_CS_Options_None.csproj | 14 +------ ...ootstrapAutoInitialize_CPP_Default.vcxproj | 13 +----- ...AutoInitialize_CPP_Options_Default.vcxproj | 13 +----- ...AutoInitialize_CPP_Options_Defined.vcxproj | 13 +----- ...rapAutoInitialize_CPP_Options_None.vcxproj | 13 +----- ..._BootstrapAutoInitialize_CS_Default.csproj | 14 +------ ...apAutoInitialize_CS_Options_Default.csproj | 14 +------ ...apAutoInitialize_CS_Options_Defined.csproj | 14 +------ ...strapAutoInitialize_CS_Options_None.csproj | 14 +------ test/test.autoinitializer.CS.targets | 20 ++++++++++ test/test.autoinitializer.Native.targets | 19 +++++++++ 29 files changed, 137 insertions(+), 276 deletions(-) create mode 100644 test/test.autoinitializer.CS.targets create mode 100644 test/test.autoinitializer.Native.targets diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln index 853cc899e3..2d8f0e9b39 100644 --- a/WindowsAppRuntime.sln +++ b/WindowsAppRuntime.sln @@ -2046,52 +2046,52 @@ Global {A243A58D-ABD7-4520-8C71-F492247B7B92}.Release|x86.Build.0 = Release|Any CPU {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|Any CPU.ActiveCfg = Debug|x64 {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|Any CPU.Build.0 = Debug|x64 - {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|ARM64.ActiveCfg = Debug|x64 - {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|ARM64.Build.0 = Debug|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|ARM64.Build.0 = Debug|ARM64 {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|x64.ActiveCfg = Debug|x64 {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|x64.Build.0 = Debug|x64 {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|x86.ActiveCfg = Debug|Win32 {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|x86.Build.0 = Debug|Win32 {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|Any CPU.ActiveCfg = Release|x64 {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|Any CPU.Build.0 = Release|x64 - {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|ARM64.ActiveCfg = Release|x64 - {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|ARM64.Build.0 = Release|x64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|ARM64.ActiveCfg = Release|ARM64 + {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|ARM64.Build.0 = Release|ARM64 {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x64.ActiveCfg = Release|x64 {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x64.Build.0 = Release|x64 {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x86.ActiveCfg = Release|Win32 {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x86.Build.0 = Release|Win32 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|Any CPU.ActiveCfg = Debug|x64 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|Any CPU.Build.0 = Debug|x64 - {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|ARM64.ActiveCfg = Debug|x64 - {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|ARM64.Build.0 = Debug|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|ARM64.Build.0 = Debug|ARM64 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|x64.ActiveCfg = Debug|x64 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|x64.Build.0 = Debug|x64 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|x86.ActiveCfg = Debug|Win32 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|x86.Build.0 = Debug|Win32 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|Any CPU.ActiveCfg = Release|x64 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|Any CPU.Build.0 = Release|x64 - {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|ARM64.ActiveCfg = Release|x64 - {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|ARM64.Build.0 = Release|x64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|ARM64.ActiveCfg = Release|ARM64 + {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|ARM64.Build.0 = Release|ARM64 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x64.ActiveCfg = Release|x64 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x64.Build.0 = Release|x64 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x86.ActiveCfg = Release|Win32 {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x86.Build.0 = Release|Win32 {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|ARM64.Build.0 = Debug|Any CPU - {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x64.ActiveCfg = Debug|Any CPU - {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x64.Build.0 = Debug|Any CPU - {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x86.ActiveCfg = Debug|Any CPU - {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x86.Build.0 = Debug|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|ARM64.Build.0 = Debug|ARM64 + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x64.ActiveCfg = Debug|x64 + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x64.Build.0 = Debug|x64 + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x86.ActiveCfg = Debug|x86 + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x86.Build.0 = Debug|x86 {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|Any CPU.ActiveCfg = Release|Any CPU {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|Any CPU.Build.0 = Release|Any CPU - {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|ARM64.ActiveCfg = Release|Any CPU - {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|ARM64.Build.0 = Release|Any CPU - {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x64.ActiveCfg = Release|Any CPU - {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x64.Build.0 = Release|Any CPU - {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x86.ActiveCfg = Release|Any CPU - {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x86.Build.0 = Release|Any CPU + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|ARM64.ActiveCfg = Release|ARM64 + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|ARM64.Build.0 = Release|ARM64 + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x64.ActiveCfg = Release|x64 + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x64.Build.0 = Release|x64 + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x86.ActiveCfg = Release|x86 + {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets index 6b34a1b09a..a0544f0ac1 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets @@ -9,7 +9,7 @@ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY - + diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializerCommon.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializerCommon.targets index c98e63bec0..287befbad2 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializerCommon.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializerCommon.targets @@ -10,7 +10,7 @@ '$(WindowsAppSdkDeploymentManagerInitialize)' == 'true' or '$(WindowsAppSdkCompatibilityInitialize)' == 'true')"> - true + true diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets index e8e05f89a9..dcfac01d7e 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets @@ -6,27 +6,27 @@ true - - $(GeneratedFilesDir)WinAppSDKCompatibilitySetter.cs - + $(GeneratedFilesDir)WindowsAppSDKCompatibilitySetter.cs + compatibilityOptions.PatchMode1 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode.Replace(".", ",")))%3B - - + + compatibilityOptions.PatchMode2 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode2.Replace(".", ",")))%3B - + - $([System.Text.RegularExpressions.Regex]::Replace($(WindowsAppSDKDisabledChanges), "\s+", "")) - - var disabledChangesArray = new CompatibilityChange[] { CompatibilityChange.$([System.Text.RegularExpressions.Regex]::Replace($(WinAppSDKCompatibilityDisabledChangesNoSpaces), ",([A-Za-z])", ", CompatibilityChange.$1")) }%3B + $([System.Text.RegularExpressions.Regex]::Replace($(WindowsAppSDKDisabledChanges), "\s+", "")) + + var disabledChangesArray = new CompatibilityChange[] { CompatibilityChange.$([System.Text.RegularExpressions.Regex]::Replace($(WindowsAppSDKCompatibilityDisabledChangesNoSpaces), ",([A-Za-z])", ", CompatibilityChange.$1")) }%3B foreach (var changeId in disabledChangesArray) { compatibilityOptions.DisabledChanges.Add(changeId)%3B } - + - + using Microsoft.Windows.ApplicationModel.WindowsAppRuntime%3B // This file is generated by the build based on project properties. @@ -38,23 +38,23 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Compatibility internal static void ConfigureCompatibility() { var compatibilityOptions = new CompatibilityOptions()%3B -$(WinAppSDKCompatibilityPatchMode1Lines) -$(WinAppSDKCompatibilityPatchMode2Lines) -$(WinAppSDKCompatibilityDisabledChangesLines) +$(WindowsAppSDKCompatibilityPatchMode1Lines) +$(WindowsAppSDKCompatibilityPatchMode2Lines) +$(WindowsAppSDKCompatibilityDisabledChangesLines) compatibilityOptions.Apply()%3B } } } - + - - + + diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets index c5e0abfd0c..3a98933c31 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets @@ -16,7 +16,7 @@ - + diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets index d562afb212..5d9926cffa 100644 --- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets @@ -2,7 +2,7 @@ - + NotUsing diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets index dd2fbc2d73..845d3b2ff5 100644 --- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets @@ -6,26 +6,26 @@ true - - $(GeneratedFilesDir)WinAppSDKCompatibilitySetter.cpp - + $(GeneratedFilesDir)WindowsAppSDKCompatibilitySetter.cpp + compatibilityOptions.PatchMode1({$(WindowsAppSDKRuntimePatchMode.Replace(".", ","))})%3B - - + + compatibilityOptions.PatchMode2({$(WindowsAppSDKRuntimePatchMode2.Replace(".", ","))})%3B - - $([System.Text.RegularExpressions.Regex]::Replace($(WindowsAppSDKDisabledChanges), "\s+", "")) - - CompatibilityChange disabledChangesArray[] = { CompatibilityChange::$([System.Text.RegularExpressions.Regex]::Replace($(WinAppSDKCompatibilityDisabledChangesNoSpaces), ",([A-Za-z])", ", CompatibilityChange::$1")) }%3B + + $([System.Text.RegularExpressions.Regex]::Replace($(WindowsAppSDKDisabledChanges), "\s+", "")) + + CompatibilityChange disabledChangesArray[] = { CompatibilityChange::$([System.Text.RegularExpressions.Regex]::Replace($(WindowsAppSDKCompatibilityDisabledChangesNoSpaces), ",([A-Za-z])", ", CompatibilityChange::$1")) }%3B for (auto changeId : disabledChangesArray) { compatibilityOptions.DisabledChanges().Append(changeId)%3B } - + - + // This file is generated by the build based on project properties. #include <winrt/Windows.Foundation.h> #include <winrt/Windows.Foundation.Collections.h> @@ -42,23 +42,23 @@ namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility void Initialize() { CompatibilityOptions compatibilityOptions%3B -$(WinAppSDKCompatibilityPatchMode1Lines) -$(WinAppSDKCompatibilityPatchMode2Lines) -$(WinAppSDKCompatibilityDisabledChangesLines) +$(WindowsAppSDKCompatibilityPatchMode1Lines) +$(WindowsAppSDKCompatibilityPatchMode2Lines) +$(WindowsAppSDKCompatibilityDisabledChangesLines) compatibilityOptions.Apply()%3B } } } - + - + NotUsing @@ -66,7 +66,7 @@ $(WinAppSDKCompatibilityDisabledChangesLines) - $(BeforeClCompileTargets); WinAppSDKCompatibilitySetterTarget + $(BeforeClCompileTargets); WindowsAppSDKCompatibilitySetterTarget; diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets index 96e25198e3..1977958aac 100644 --- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets @@ -155,6 +155,6 @@ - + diff --git a/docs/Coding-Guidelines/GettingStarted.md b/docs/Coding-Guidelines/GettingStarted.md index 9c2ef2bb31..e66de020fe 100644 --- a/docs/Coding-Guidelines/GettingStarted.md +++ b/docs/Coding-Guidelines/GettingStarted.md @@ -88,7 +88,7 @@ Now you're ready to load `WindowsAppRuntime.sln` and start development! Some tips: * If VS starts in a configuration of `Any CPU`, switch to a specific architecture like `x64` - to succeessfully build. + to successfully build. * Build everything in VS via the Build menu's `Build Solution` or `Rebuild Solution` * Right-click on individual projects in Solution Explorer to only build select projects. Dependencies and Build Order should be defined to build prerequisites (if necessary) for the diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp b/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp index 2d4b010652..8bbe369856 100644 --- a/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp +++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp @@ -101,6 +101,23 @@ namespace Test::CompatibilityTests options2.Apply(); } + TEST_METHOD(VerifyConflictingPatchModeBehavior) + { + WEX::Logging::Log::Comment(WEX::Common::String(L"Setting CompatibilityOptions with conflicting patch modes")); + winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options; + options.PatchMode1({ 1, 7, 3 }); + options.PatchMode2({ 1, 7, 6 }); // Conflicting patch mode for 1.7.x! Apply should fail. + try + { + options.Apply(); + VERIFY_FAIL(L"Success is not expected when setting a conflicting configuration"); + } + catch (winrt::hresult_error& e) + { + VERIFY_ARE_EQUAL(E_INVALIDARG, e.code()); + } + } + TEST_METHOD(VerifyDisabledChanges) { winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options; diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj index 6f33715e69..827c45f4b5 100644 --- a/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj +++ b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj @@ -148,23 +148,12 @@ - + + - - - - NotUsing - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) - - - - diff --git a/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj b/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj index c37e18bfc7..be47f8a972 100644 --- a/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj +++ b/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj @@ -24,22 +24,10 @@ - + + - - - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY - - - - - - - diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Default/Test_DeploymentManagerAutoInitialize_CPP_Default.vcxproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Default/Test_DeploymentManagerAutoInitialize_CPP_Default.vcxproj index 0a7a4dd421..4b42c2047d 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Default/Test_DeploymentManagerAutoInitialize_CPP_Default.vcxproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Default/Test_DeploymentManagerAutoInitialize_CPP_Default.vcxproj @@ -108,18 +108,7 @@ true - - - - - NotUsing - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) - - - + diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Default/Test_DeploymentManagerAutoInitialize_CPP_Options_Default.vcxproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Default/Test_DeploymentManagerAutoInitialize_CPP_Options_Default.vcxproj index 84c8789ccd..e3d453339b 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Default/Test_DeploymentManagerAutoInitialize_CPP_Options_Default.vcxproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Default/Test_DeploymentManagerAutoInitialize_CPP_Options_Default.vcxproj @@ -109,18 +109,7 @@ true - - - - - NotUsing - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) - - - + diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined.vcxproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined.vcxproj index 26647704fb..bd4cd76a70 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined.vcxproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined.vcxproj @@ -109,18 +109,7 @@ true - - - - - NotUsing - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) - - - + diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_None/Test_DeploymentManagerAutoInitialize_CPP_Options_None.vcxproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_None/Test_DeploymentManagerAutoInitialize_CPP_Options_None.vcxproj index 4929a29724..4ead437416 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_None/Test_DeploymentManagerAutoInitialize_CPP_Options_None.vcxproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_None/Test_DeploymentManagerAutoInitialize_CPP_Options_None.vcxproj @@ -109,18 +109,7 @@ true - - - - - NotUsing - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) - - - + diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Default/Test_DeploymentManagerAutoInitialize_CS_Default.csproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Default/Test_DeploymentManagerAutoInitialize_CS_Default.csproj index 32f30e2bdf..f50fac0f73 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Default/Test_DeploymentManagerAutoInitialize_CS_Default.csproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Default/Test_DeploymentManagerAutoInitialize_CS_Default.csproj @@ -31,18 +31,6 @@ true - - - - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY - - - - - - + diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Default/Test_DeploymentManagerAutoInitialize_CS_Options_Default.csproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Default/Test_DeploymentManagerAutoInitialize_CS_Options_Default.csproj index cad9d4c118..22d03b0f0d 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Default/Test_DeploymentManagerAutoInitialize_CS_Options_Default.csproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Default/Test_DeploymentManagerAutoInitialize_CS_Options_Default.csproj @@ -35,18 +35,6 @@ true - - - - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY - - - - - - + diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_None/Test_DeploymentManagerAutoInitialize_CS_Options_None.csproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_None/Test_DeploymentManagerAutoInitialize_CS_Options_None.csproj index 32c1527e0d..621efc53c0 100644 --- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_None/Test_DeploymentManagerAutoInitialize_CS_Options_None.csproj +++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_None/Test_DeploymentManagerAutoInitialize_CS_Options_None.csproj @@ -35,18 +35,6 @@ true - - - - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY - - - - - - + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj index 7bcd3e975e..d6e38a1fc7 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj @@ -108,18 +108,7 @@ true - - - - - NotUsing - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) - - - + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj index a15d493a18..00fff1528a 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj @@ -109,18 +109,7 @@ true - - - - - NotUsing - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) - - - + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj index e9d515ed0a..5a34d17988 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj @@ -113,18 +113,7 @@ true - - - - - NotUsing - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) - - - + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj index f586a6959c..cef7c4d1b9 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj @@ -109,18 +109,7 @@ true - - - - - NotUsing - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) - MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) - - - + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj index 01a95ce732..b047757058 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj @@ -47,18 +47,6 @@ true - - - - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY - - - - - - + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj index 6670ed342e..13e52bf6e9 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj @@ -51,18 +51,6 @@ true - - - - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY - - - - - - + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj index 9ebe00d7c2..0e4a8f04b5 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj @@ -55,18 +55,6 @@ true - - - - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY - - - - - - + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj index f226eaa000..d115efc614 100644 --- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj @@ -51,18 +51,6 @@ true - - - - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY - - - - - - + diff --git a/test/test.autoinitializer.CS.targets b/test/test.autoinitializer.CS.targets new file mode 100644 index 0000000000..23a79d8d53 --- /dev/null +++ b/test/test.autoinitializer.CS.targets @@ -0,0 +1,20 @@ + + + + + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY + + + + + + + + + diff --git a/test/test.autoinitializer.Native.targets b/test/test.autoinitializer.Native.targets new file mode 100644 index 0000000000..5213188830 --- /dev/null +++ b/test/test.autoinitializer.Native.targets @@ -0,0 +1,19 @@ + + + + + + + + + + NotUsing + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions) + + + + + From b819737339fee83014285346d44e5fd5d6fb534e Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Thu, 19 Dec 2024 13:41:08 -0800 Subject: [PATCH 23/24] Fix issues in .targets. --- .../Microsoft.WindowsAppSDK.AutoInitializer.CS.targets | 3 ++- ...Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets | 7 +++++-- .../WindowsAppSDK-Nuget-Native.AutoInitializer.targets | 8 +++++++- build/NuSpecs/WindowsAppSDK-Nuget-Native.targets | 2 +- test/test.autoinitializer.CS.targets | 3 ++- test/test.autoinitializer.Native.targets | 6 ++++++ 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets index a0544f0ac1..309ac6058e 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets @@ -9,7 +9,8 @@ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY - + + diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets index dcfac01d7e..6c2924fc3b 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets @@ -6,10 +6,13 @@ true - - $(GeneratedFilesDir)WindowsAppSDKCompatibilitySetter.cs + $(GeneratedFilesDir)\WindowsAppSDK\ + $([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)', '$(IntermediateOutputPath)', 'Generated Files', 'WindowsAppSDK')) + + $(WindowsAppSDKGeneratedFilesDir)WindowsAppSDKCompatibilitySetter.cs compatibilityOptions.PatchMode1 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode.Replace(".", ",")))%3B diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets index 5d9926cffa..ae3313a43a 100644 --- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets @@ -4,7 +4,7 @@ - + NotUsing MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions) MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions) @@ -14,4 +14,10 @@ + + + $(BeforeClCompileTargets); WindowsAppRuntimeAutoInitializer; + + + diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets index 1977958aac..a51d55d97c 100644 --- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets +++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets @@ -154,7 +154,7 @@ - + diff --git a/test/test.autoinitializer.CS.targets b/test/test.autoinitializer.CS.targets index 23a79d8d53..017fada5ee 100644 --- a/test/test.autoinitializer.CS.targets +++ b/test/test.autoinitializer.CS.targets @@ -11,7 +11,8 @@ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY - + + diff --git a/test/test.autoinitializer.Native.targets b/test/test.autoinitializer.Native.targets index 5213188830..fd0b286896 100644 --- a/test/test.autoinitializer.Native.targets +++ b/test/test.autoinitializer.Native.targets @@ -16,4 +16,10 @@ + + + $(BeforeClCompileTargets); WindowsAppRuntimeAutoInitializer; + + + From 143bcc7c911a803b17b149f87f885316b6b0b02d Mon Sep 17 00:00:00 2001 From: Michael Crider Date: Thu, 19 Dec 2024 17:42:08 -0800 Subject: [PATCH 24/24] Update file path check. --- .../Test_CompatibilitySetter_CS.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj b/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj index be47f8a972..603519686e 100644 --- a/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj +++ b/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj @@ -24,7 +24,7 @@ - +