From 53a24ce80ffcab581051025a5679e5cfa971feba Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 15 Mar 2022 02:26:09 +0000 Subject: [PATCH 01/11] Update dependencies from https://github.com/microsoft/CsWinRT build 1.6.1.220314.1 CsWinRT.Dependency.WindowsSdkPackage , CsWinRT.Dependency.DotNetCoreRuntime , CsWinRT.Dependency.DotNetCoreSdk , Microsoft.Windows.CsWinRT From Version 23 -> To Version 24 --- eng/Version.Details.xml | 13 ++++++------- eng/Versions.props | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index bbadf683fc..40315cc766 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,22 +7,21 @@ - + https://github.com/microsoft/CsWinRT - 394ce3a7fb435b99010ee4ed8690789944e08870 + 9b4a4df6144ac1f1642307046cc2468ce4664b0a https://github.com/microsoft/CsWinRT - - + 9b4a4df6144ac1f1642307046cc2468ce4664b0a https://github.com/microsoft/CsWinRT - 394ce3a7fb435b99010ee4ed8690789944e08870 + 9b4a4df6144ac1f1642307046cc2468ce4664b0a - + https://github.com/microsoft/CsWinRT - 394ce3a7fb435b99010ee4ed8690789944e08870 + 9b4a4df6144ac1f1642307046cc2468ce4664b0a https://dev.azure.com/microsoft/ProjectReunion/_git/ProjectReunionInternal diff --git a/eng/Versions.props b/eng/Versions.props index f756fec384..b492712faf 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,10 +1,10 @@ - 1.5.0 + 1.6.1 5.0.404 5.0.13 - 23 + 24 $(CsWinRTDependencyDotNetCoreSdkPackageVersion) From 7e58e6549dcee9a4214b73340efc510ca9fe362e Mon Sep 17 00:00:00 2001 From: Will Thant Date: Fri, 1 Apr 2022 17:39:30 -0700 Subject: [PATCH 02/11] test push --- build/ProjectReunion-BuildFoundation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/ProjectReunion-BuildFoundation.yml b/build/ProjectReunion-BuildFoundation.yml index 7d123bf2e5..8be79eb677 100644 --- a/build/ProjectReunion-BuildFoundation.yml +++ b/build/ProjectReunion-BuildFoundation.yml @@ -81,7 +81,7 @@ jobs: nuGetServiceConnections: 'TelemetryInternal' - task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2 - displayName: 'NuGet restore of packages' + displayName: 'NuGet restore of package' inputs: command: 'custom' arguments: 'restore ${{ parameters.WindowsAppRuntimeInsightsSourceDirectory }}\packages.config -ConfigFile ${{ parameters.WindowsAppRuntimeInsightsSourceDirectory }}\nuget.config -PackagesDirectory ${{ parameters.WindowsAppRuntimeInsightsSourceDirectory }}\packages' From 69884405bd94701360e2a6c4c9f8403904f71cb7 Mon Sep 17 00:00:00 2001 From: Will Thant Date: Fri, 1 Apr 2022 17:40:10 -0700 Subject: [PATCH 03/11] Revert "test push" This reverts commit 7e58e6549dcee9a4214b73340efc510ca9fe362e. --- build/ProjectReunion-BuildFoundation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/ProjectReunion-BuildFoundation.yml b/build/ProjectReunion-BuildFoundation.yml index 8be79eb677..7d123bf2e5 100644 --- a/build/ProjectReunion-BuildFoundation.yml +++ b/build/ProjectReunion-BuildFoundation.yml @@ -81,7 +81,7 @@ jobs: nuGetServiceConnections: 'TelemetryInternal' - task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2 - displayName: 'NuGet restore of package' + displayName: 'NuGet restore of packages' inputs: command: 'custom' arguments: 'restore ${{ parameters.WindowsAppRuntimeInsightsSourceDirectory }}\packages.config -ConfigFile ${{ parameters.WindowsAppRuntimeInsightsSourceDirectory }}\nuget.config -PackagesDirectory ${{ parameters.WindowsAppRuntimeInsightsSourceDirectory }}\packages' From d2bd64a3d300d7a104aba5a3e53a8ba26e483ec9 Mon Sep 17 00:00:00 2001 From: Scott Jones Date: Mon, 4 Apr 2022 12:48:34 -0700 Subject: [PATCH 04/11] App considerations for Hybrid CRT - xcopyability (#2354) * App considerations for Hybrid CRT - xcopyability * PR feedback --- docs/Coding-Guidelines/HybridCRT.md | 38 ++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/docs/Coding-Guidelines/HybridCRT.md b/docs/Coding-Guidelines/HybridCRT.md index 2cb05c99b2..b4215af790 100644 --- a/docs/Coding-Guidelines/HybridCRT.md +++ b/docs/Coding-Guidelines/HybridCRT.md @@ -1,20 +1,25 @@ # Hybrid CRT -Windows App SDK runs in diverse environments and contexts (i.e. all of them ;-) Much of the runtime -is implemented in C++ and thus dependent on the Standard C/C++ Runtime aka the CRT. To ensure a -highly reliable and friction-less experience (for developers as well as users) all DLLs and EXEs -containing C/C++ code are built using the 'hybrid CRT' technique. +The Windows App SDK runs in diverse environments and contexts. Much of the Windows App Runtime +is implemented in C++ and is thus dependent on the Standard C/C++ Runtime (the CRT). +As of versions 1.0.2+ and 1.1+, all Windows App SDK DLLs and EXEs containing C/C++ code are built +using the 'Hybrid CRT' technique. This frees developers from the burden of installing the CRT +redistributables on end user devices - whether +[Microsoft.VCLibs framework packages](https://docs.microsoft.com/troubleshoot/developer/visualstudio/cpp/libraries/c-runtime-packages-desktop-bridge) +for packaged apps, or the +[VCRedist](https://docs.microsoft.com/cpp/windows/latest-supported-vc-redist?view=msvc-170) +for unpackaged apps. ## What is the 'Hybrid CRT'? The 'Hybrid CRT' is a technique using the -[Universal CRT](https://docs.microsoft.com/en-us/cpp/windows/universal-crt-deployment?view=msvc-160) +[Universal CRT](https://docs.microsoft.com/cpp/windows/universal-crt-deployment?view=msvc-160) AND the static CRT to get functional coverage without the overhead of the static CRT or the external dependency of the dynamic CRT. Visual Studio offers the CRT in 2 forms: DLLs needed at runtime (dynamic) and static libraries linked into PE files (static). These are controlled via -[compiler options](https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-160) +[compiler options](https://docs.microsoft.com/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-160) * /MD - Dynamic, non-debug * /MDd - Dynamic, debug @@ -31,7 +36,7 @@ runtime at the cost of increased size of every PE file in Windows App SDK. The c on the symbols needed but 1M+ is common. Windows includes the -[Universal CRT](https://docs.microsoft.com/en-us/cpp/windows/universal-crt-deployment?view=msvc-160) +[Universal CRT](https://docs.microsoft.com/cpp/windows/universal-crt-deployment?view=msvc-160) (aka UCRT) as system binaries. The UCRT is available on all platforms supported by Windows App SDK (and older too). However the UCRT only provides a subset of the CRT (`malloc`, `fopen`, etc what's generally thought of as the Standard C Library, provided via a stable ABI). Visual Studio's @@ -54,10 +59,9 @@ Windows App SDK uses the hybrid CRT for all PE files. TL;DR Do nothing and all projects use it. If you create a new *.vcxproj delete any `` tags. -Windows App SDK defines the rules for Visual Studio in -[https://github.com/microsoft/WindowsAppSDK/HybridCRT.props](https://github.com/microsoft/WindowsAppSDK/blob/main/HybridCRT.props). +Windows App SDK defines the rules for Visual Studio in [HybridCRT.props](https://github.com/microsoft/WindowsAppSDK/blob/main/HybridCRT.props). This is imported by -[Directory.Build.props](https://github.com/microsoft/WindowsAppSDK/Directory.Build.props) so all +[Directory.Build.props](https://github.com/microsoft/WindowsAppSDK/blob/main/Directory.Build.props) so all projects in the directory tree get this support. If new projects are created DO NOT specify `` in *.vcxproj as that's unnecessary and @@ -115,7 +119,7 @@ The steps involved: ### Directory.Build.props -[Directory.Build.props](https://github.com/microsoft/WindowsAppSDK/Directory.Build.props) in the +[Directory.Build.props](https://github.com/microsoft/WindowsAppSDK/blob/main/Directory.Build.props) in the repository root imports [HybridCRT.props](https://github.com/microsoft/WindowsAppSDK/blob/main/HybridCRT.props) to apply to all projects in the repository via this statement: @@ -127,6 +131,16 @@ all projects in the repository via this statement: This applies to all projects in the repository (product, test, ...). +### Hybrid CRT C/C++ Apps + +For their own CRT usage, most C/C++ app developers will continue to link either statically, +with no redistribution requirements, or dynamically, requiring either a Microsoft.VCLibs +dependency (for packaged apps) or a VCRedist dependency (for unpackaged apps). +For unpackaged self-contained C/C++ Windows App SDK apps, some developers may also find +Hybrid CRT linkage useful for enabling xcopy deployment. For these apps, the Directory.Build.* +files described above can be included in the project. For apps that also include C++/CX code, +additional considerations are described below. + ## C++/CX Special Considerations Projects that include CX code, and wish to use Hybrid CRT, require the following compile @@ -196,4 +210,4 @@ RuntimeLibrary PDM by defining the following symbol: ``` For linkage, msvcrt(d).lib must never be used. In other words, even test code -which pulls in production code must use Hybrid (static) CRT linkage. \ No newline at end of file +which pulls in production code must use Hybrid (static) CRT linkage. From 3b6fdc6170763322eb73cef7c496cea4fde60977 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Mon, 4 Apr 2022 12:53:27 -0700 Subject: [PATCH 05/11] Fix doccomment (#2357) --- dev/WindowsAppRuntime_BootstrapDLL/MddBootstrap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrap.h b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrap.h index 9581bc4a88..5f135fb83b 100644 --- a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrap.h +++ b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrap.h @@ -197,7 +197,7 @@ namespace DynamicDependency::Bootstrap /// /// #include /// - /// using MddBootstrap = Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap; + /// namespace MddBootstrap { using namespace ::Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap; } /// /// int main() /// { @@ -248,7 +248,7 @@ namespace DynamicDependency::Bootstrap /// /// #include /// - /// using MddBootstrap = MddBootstrap; + /// namespace MddBootstrap { using namespace ::Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap; } /// /// int main() /// { @@ -300,7 +300,7 @@ namespace DynamicDependency::Bootstrap /// /// #include /// - /// using MddBootstrap = Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap; + /// namespace MddBootstrap { using namespace ::Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap; } /// /// int main() /// { From 0f5e22fd4f8492406569b923120aa6114c4bb33e Mon Sep 17 00:00:00 2001 From: Kyaw Thant <48363984+kythant@users.noreply.github.com> Date: Mon, 4 Apr 2022 14:33:41 -0700 Subject: [PATCH 06/11] Add missing '>' to Microsoft.WindowsAppSDK.Bootstrap.CS.targets (#2358) * Add missing '>' * Add smoke test check to props and targets, removed line 4 --- .../Microsoft.WindowsAppSDK.Bootstrap.CS.targets | 1 - build/ProjectReunion-CI.yml | 13 ++++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.Bootstrap.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.Bootstrap.CS.targets index 40245ac05a..07f0ccdd5c 100644 --- a/build/NuSpecs/Microsoft.WindowsAppSDK.Bootstrap.CS.targets +++ b/build/NuSpecs/Microsoft.WindowsAppSDK.Bootstrap.CS.targets @@ -1,7 +1,6 @@ - $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_DEFAULT $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_NONE $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK diff --git a/build/ProjectReunion-CI.yml b/build/ProjectReunion-CI.yml index 61a9622e17..f6ead92f5e 100644 --- a/build/ProjectReunion-CI.yml +++ b/build/ProjectReunion-CI.yml @@ -7,10 +7,21 @@ variables: value: $(Build.SourcesDirectory)\BuildOutput jobs: -- job: CredScan +- job: PreChecks pool: vmImage: 'windows-2019' steps: + - task: PowerShell@2 + displayName: 'Smoke test props and targets in \build\NuSpecs' + inputs: + targetType: 'inline' + script: | + $targetPaths = "$(Build.SourcesDirectory)\build\NuSpecs\*.targets" + $propPaths = "$(Build.SourcesDirectory)\build\NuSpecs\*.props" + Get-ChildItem $targetPaths | ForEach-Object { $_.Name; [xml](Get-Content $_) | Out-Null } + Get-ChildItem $propPaths | ForEach-Object { $_.Name; [xml](Get-Content $_) | Out-Null } + failOnStderr: true + # Scans the root source folder for security vulnerability - task: CredScan@2 inputs: From 085aac80895399f9c73e2a317084a78c02655cff Mon Sep 17 00:00:00 2001 From: Evelyn Wu <50890554+evelynwu-msft@users.noreply.github.com> Date: Mon, 4 Apr 2022 15:16:18 -0700 Subject: [PATCH 07/11] Fix Package.appxmanifest not appearing in Solution Explorer when creating a new C++ project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes [Bug 38465376: Package.appxmanifest is missing from Blank App, Packaged (C++) single project template solution](http://task.ms/38465376). When creating a new C++ app using the `Blank App, Packaged (WinUI 3 in Desktop)` project template, the included `Package.appxmanifest` file doesn't appear in Solution Explorer until after the project has been reloaded, even though it is automatically included in the project by the WinAppSdk `.targets`. Apparently `Package.appxmanifest` needs to be explicitly included via the .vcxproj rather than an imported .targets file (even if both inclusions are using the same MSBuild condition!) in order for it to appear in Solution Explorer immediately after creating a new project. Just VS C++ doing VS C++ things. ¯\\\_(ツ)_/¯ --- .../SingleProjectPackagedApp/ProjectTemplate.vcxproj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj index 47c600fd64..362bed0e58 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj +++ b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj @@ -96,6 +96,11 @@ true + + + Designer + + From 3e11dd58c849b29f1f62ed03e57efeb5bc6227e0 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Wed, 6 Apr 2022 15:54:41 -0700 Subject: [PATCH 08/11] Bootstrap AutoInitialize - Fix typos due to bad merge (#2368) * Fix typos * More typo * Fix typo * BootstrapAutoInitialize - initial tests * It builds! * Yay! Full C++ compilation verification! And now C#... * Added C# tests * Fix include path --- WindowsAppRuntime.sln | 153 ++++++++++++++++++ .../MddBootstrapAutoInitializer.cpp | 20 ++- .../MddBootstrapAutoInitializer.cs | 29 ++-- .../README.txt | 1 + ...ootstrapAutoInitialize_CPP_Default.filters | 25 +++ ...ootstrapAutoInitialize_CPP_Default.vcxproj | 136 ++++++++++++++++ .../packages.config | 4 + .../README.txt | 1 + ...AutoInitialize_CPP_Options_Default.filters | 25 +++ ...AutoInitialize_CPP_Options_Default.vcxproj | 137 ++++++++++++++++ .../packages.config | 4 + .../README.txt | 1 + ...AutoInitialize_CPP_Options_Defined.filters | 25 +++ ...AutoInitialize_CPP_Options_Defined.vcxproj | 141 ++++++++++++++++ .../packages.config | 4 + .../README.txt | 1 + ...rapAutoInitialize_CPP_Options_None.filters | 25 +++ ...rapAutoInitialize_CPP_Options_None.vcxproj | 137 ++++++++++++++++ .../packages.config | 4 + .../CPP/WindowsAppSDK-VersionInfo.h | 99 ++++++++++++ ..._BootstrapAutoInitialize_CS_Default.csproj | 48 ++++++ ...apAutoInitialize_CS_Options_Default.csproj | 52 ++++++ ...apAutoInitialize_CS_Options_Defined.csproj | 56 +++++++ ...strapAutoInitialize_CS_Options_None.csproj | 52 ++++++ .../CS/WindowsAppSDK-VersionInfo.cs | 56 +++++++ 25 files changed, 1215 insertions(+), 21 deletions(-) create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/README.txt create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.filters create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/packages.config create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/README.txt create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.filters create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/packages.config create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/README.txt create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.filters create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/packages.config create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/README.txt create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.filters create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/packages.config create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/WindowsAppSDK-VersionInfo.h create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj create mode 100644 test/DynamicDependency/Test_BootstrapAutoInitialize/CS/WindowsAppSDK-VersionInfo.cs diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln index 095ea6a6a1..56e23771ad 100644 --- a/WindowsAppRuntime.sln +++ b/WindowsAppRuntime.sln @@ -317,6 +317,28 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{0419CA EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "dev\Common\Common.vcxitems", "{8828053C-D6EC-4744-8624-F8C676C2D4DF}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test_BootstrapAutoInitialize", "Test_BootstrapAutoInitialize", "{33609C47-60F4-48ED-AB2C-83A89C17255F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test_BootstrapAutoInitialize_CPP_Default", "test\DynamicDependency\Test_BootstrapAutoInitialize\CPP\Test_BootstrapAutoInitialize_CPP_Default\Test_BootstrapAutoInitialize_CPP_Default.vcxproj", "{53E3E9A7-11BE-4BBC-981F-AF98A1B00617}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CPP", "CPP", "{A05C260F-877D-49C2-968A-164E5A904422}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test_BootstrapAutoInitialize_CPP_Options_Default", "test\DynamicDependency\Test_BootstrapAutoInitialize\CPP\Test_BootstrapAutoInitialize_CPP_Options_Default\Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj", "{F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test_BootstrapAutoInitialize_CPP_Options_Defined", "test\DynamicDependency\Test_BootstrapAutoInitialize\CPP\Test_BootstrapAutoInitialize_CPP_Options_Defined\Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj", "{EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test_BootstrapAutoInitialize_CPP_Options_None", "test\DynamicDependency\Test_BootstrapAutoInitialize\CPP\Test_BootstrapAutoInitialize_CPP_Options_None\Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj", "{822E1679-8F71-4477-BE44-9EC77983360E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CS", "CS", "{99C514E4-A6B3-4B09-B870-5511EF9D93AC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test_BootstrapAutoInitialize_CS_Default", "test\DynamicDependency\Test_BootstrapAutoInitialize\CS\Test_BootstrapAutoInitialize_CS_Default\Test_BootstrapAutoInitialize_CS_Default.csproj", "{11C74DA1-A6FA-4027-8FA4-F25450CADF09}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test_BootstrapAutoInitialize_CS_Options_Default", "test\DynamicDependency\Test_BootstrapAutoInitialize\CS\Test_BootstrapAutoInitialize_CS_Options_Default\Test_BootstrapAutoInitialize_CS_Options_Default.csproj", "{0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test_BootstrapAutoInitialize_CS_Options_Defined", "test\DynamicDependency\Test_BootstrapAutoInitialize\CS\Test_BootstrapAutoInitialize_CS_Options_Defined\Test_BootstrapAutoInitialize_CS_Options_Defined.csproj", "{D9139E3C-8D21-4BD9-84E3-30A03A54D610}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test_BootstrapAutoInitialize_CS_Options_None", "test\DynamicDependency\Test_BootstrapAutoInitialize\CS\Test_BootstrapAutoInitialize_CS_Options_None\Test_BootstrapAutoInitialize_CS_Options_None.csproj", "{4A74BBED-3B20-44A7-B6FF-3373160DE741}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution test\inc\inc.vcxitems*{08bc78e0-63c6-49a7-81b3-6afc3deac4de}*SharedItemsImports = 4 @@ -1190,6 +1212,126 @@ Global {50451390-66E7-4465-8804-427560625794}.Release|x64.Build.0 = Release|x64 {50451390-66E7-4465-8804-427560625794}.Release|x86.ActiveCfg = Release|Win32 {50451390-66E7-4465-8804-427560625794}.Release|x86.Build.0 = Release|Win32 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Debug|ARM64.Build.0 = Debug|ARM64 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Debug|x64.ActiveCfg = Debug|x64 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Debug|x64.Build.0 = Debug|x64 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Debug|x86.ActiveCfg = Debug|Win32 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Debug|x86.Build.0 = Debug|Win32 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Release|Any CPU.ActiveCfg = Release|Win32 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Release|ARM64.ActiveCfg = Release|ARM64 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Release|ARM64.Build.0 = Release|ARM64 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Release|x64.ActiveCfg = Release|x64 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Release|x64.Build.0 = Release|x64 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Release|x86.ActiveCfg = Release|Win32 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617}.Release|x86.Build.0 = Release|Win32 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Debug|ARM64.Build.0 = Debug|ARM64 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Debug|x64.ActiveCfg = Debug|x64 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Debug|x64.Build.0 = Debug|x64 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Debug|x86.ActiveCfg = Debug|Win32 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Debug|x86.Build.0 = Debug|Win32 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Release|Any CPU.ActiveCfg = Release|Win32 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Release|ARM64.ActiveCfg = Release|ARM64 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Release|ARM64.Build.0 = Release|ARM64 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Release|x64.ActiveCfg = Release|x64 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Release|x64.Build.0 = Release|x64 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Release|x86.ActiveCfg = Release|Win32 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A}.Release|x86.Build.0 = Release|Win32 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Debug|ARM64.Build.0 = Debug|ARM64 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Debug|x64.ActiveCfg = Debug|x64 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Debug|x64.Build.0 = Debug|x64 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Debug|x86.ActiveCfg = Debug|Win32 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Debug|x86.Build.0 = Debug|Win32 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Release|Any CPU.ActiveCfg = Release|Win32 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Release|ARM64.ActiveCfg = Release|ARM64 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Release|ARM64.Build.0 = Release|ARM64 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Release|x64.ActiveCfg = Release|x64 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Release|x64.Build.0 = Release|x64 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Release|x86.ActiveCfg = Release|Win32 + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB}.Release|x86.Build.0 = Release|Win32 + {822E1679-8F71-4477-BE44-9EC77983360E}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {822E1679-8F71-4477-BE44-9EC77983360E}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {822E1679-8F71-4477-BE44-9EC77983360E}.Debug|ARM64.Build.0 = Debug|ARM64 + {822E1679-8F71-4477-BE44-9EC77983360E}.Debug|x64.ActiveCfg = Debug|x64 + {822E1679-8F71-4477-BE44-9EC77983360E}.Debug|x64.Build.0 = Debug|x64 + {822E1679-8F71-4477-BE44-9EC77983360E}.Debug|x86.ActiveCfg = Debug|Win32 + {822E1679-8F71-4477-BE44-9EC77983360E}.Debug|x86.Build.0 = Debug|Win32 + {822E1679-8F71-4477-BE44-9EC77983360E}.Release|Any CPU.ActiveCfg = Release|Win32 + {822E1679-8F71-4477-BE44-9EC77983360E}.Release|ARM64.ActiveCfg = Release|ARM64 + {822E1679-8F71-4477-BE44-9EC77983360E}.Release|ARM64.Build.0 = Release|ARM64 + {822E1679-8F71-4477-BE44-9EC77983360E}.Release|x64.ActiveCfg = Release|x64 + {822E1679-8F71-4477-BE44-9EC77983360E}.Release|x64.Build.0 = Release|x64 + {822E1679-8F71-4477-BE44-9EC77983360E}.Release|x86.ActiveCfg = Release|Win32 + {822E1679-8F71-4477-BE44-9EC77983360E}.Release|x86.Build.0 = Release|Win32 + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Debug|Any CPU.Build.0 = Debug|Any CPU + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Debug|ARM64.ActiveCfg = Debug|arm64 + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Debug|ARM64.Build.0 = Debug|arm64 + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Debug|x64.ActiveCfg = Debug|x64 + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Debug|x64.Build.0 = Debug|x64 + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Debug|x86.ActiveCfg = Debug|x86 + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Debug|x86.Build.0 = Debug|x86 + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Release|Any CPU.ActiveCfg = Release|Any CPU + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Release|Any CPU.Build.0 = Release|Any CPU + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Release|ARM64.ActiveCfg = Release|arm64 + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Release|ARM64.Build.0 = Release|arm64 + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Release|x64.ActiveCfg = Release|x64 + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Release|x64.Build.0 = Release|x64 + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Release|x86.ActiveCfg = Release|x86 + {11C74DA1-A6FA-4027-8FA4-F25450CADF09}.Release|x86.Build.0 = Release|x86 + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Debug|ARM64.ActiveCfg = Debug|arm64 + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Debug|ARM64.Build.0 = Debug|arm64 + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Debug|x64.ActiveCfg = Debug|x64 + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Debug|x64.Build.0 = Debug|x64 + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Debug|x86.ActiveCfg = Debug|x86 + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Debug|x86.Build.0 = Debug|x86 + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Release|Any CPU.Build.0 = Release|Any CPU + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Release|ARM64.ActiveCfg = Release|arm64 + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Release|ARM64.Build.0 = Release|arm64 + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Release|x64.ActiveCfg = Release|x64 + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Release|x64.Build.0 = Release|x64 + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Release|x86.ActiveCfg = Release|x86 + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF}.Release|x86.Build.0 = Release|x86 + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Debug|ARM64.ActiveCfg = Debug|arm64 + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Debug|ARM64.Build.0 = Debug|arm64 + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Debug|x64.ActiveCfg = Debug|x64 + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Debug|x64.Build.0 = Debug|x64 + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Debug|x86.ActiveCfg = Debug|x86 + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Debug|x86.Build.0 = Debug|x86 + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Release|Any CPU.Build.0 = Release|Any CPU + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Release|ARM64.ActiveCfg = Release|arm64 + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Release|ARM64.Build.0 = Release|arm64 + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Release|x64.ActiveCfg = Release|x64 + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Release|x64.Build.0 = Release|x64 + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Release|x86.ActiveCfg = Release|x86 + {D9139E3C-8D21-4BD9-84E3-30A03A54D610}.Release|x86.Build.0 = Release|x86 + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Debug|ARM64.ActiveCfg = Debug|arm64 + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Debug|ARM64.Build.0 = Debug|arm64 + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Debug|x64.ActiveCfg = Debug|x64 + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Debug|x64.Build.0 = Debug|x64 + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Debug|x86.ActiveCfg = Debug|x86 + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Debug|x86.Build.0 = Debug|x86 + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Release|Any CPU.Build.0 = Release|Any CPU + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Release|ARM64.ActiveCfg = Release|arm64 + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Release|ARM64.Build.0 = Release|arm64 + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Release|x64.ActiveCfg = Release|x64 + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Release|x64.Build.0 = Release|x64 + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Release|x86.ActiveCfg = Release|x86 + {4A74BBED-3B20-44A7-B6FF-3373160DE741}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1292,6 +1434,17 @@ Global {50451390-66E7-4465-8804-427560625794} = {82A73181-EA4A-431A-B82B-BE6734604CC9} {0419CA2B-5ED1-49F0-B70B-5F470A15D3D0} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A} {8828053C-D6EC-4744-8624-F8C676C2D4DF} = {0419CA2B-5ED1-49F0-B70B-5F470A15D3D0} + {33609C47-60F4-48ED-AB2C-83A89C17255F} = {17B1F036-8FC3-49E6-9464-0C1F96CEAEB9} + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617} = {A05C260F-877D-49C2-968A-164E5A904422} + {A05C260F-877D-49C2-968A-164E5A904422} = {33609C47-60F4-48ED-AB2C-83A89C17255F} + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A} = {A05C260F-877D-49C2-968A-164E5A904422} + {EDAC8AF1-CBD2-41D4-8AB1-02BECD9E01CB} = {A05C260F-877D-49C2-968A-164E5A904422} + {822E1679-8F71-4477-BE44-9EC77983360E} = {A05C260F-877D-49C2-968A-164E5A904422} + {99C514E4-A6B3-4B09-B870-5511EF9D93AC} = {33609C47-60F4-48ED-AB2C-83A89C17255F} + {11C74DA1-A6FA-4027-8FA4-F25450CADF09} = {99C514E4-A6B3-4B09-B870-5511EF9D93AC} + {0EF1080B-15C6-42E7-A0E2-D624D85C3EBF} = {99C514E4-A6B3-4B09-B870-5511EF9D93AC} + {D9139E3C-8D21-4BD9-84E3-30A03A54D610} = {99C514E4-A6B3-4B09-B870-5511EF9D93AC} + {4A74BBED-3B20-44A7-B6FF-3373160DE741} = {99C514E4-A6B3-4B09-B870-5511EF9D93AC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4B3D7591-CFEC-4762-9A07-ABE99938FB77} diff --git a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp index 3f70659786..ef8f37d8e9 100644 --- a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp +++ b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp @@ -8,16 +8,19 @@ #include // If any options are defined use them, else use the default -#if !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_DEFAULT) && \ - !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_NONE) && \ - !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK) && \ - !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK_IFDEBUGGERATTACHED) && \ - !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_FAILFAST) && \ - !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONNOMATCH_SHOWUI) && \ - !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONPACKAGEIDENTITY_NOOP) +#if !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_DEFAULT) +// Default isn't defined. Define it if no options are defined +#if defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_NONE) +#elif defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK) +#elif defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK_IFDEBUGGERATTACHED) +#elif defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_FAILFAST) +#elif defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONNOMATCH_SHOWUI) +#elif defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONPACKAGEIDENTITY_NOOP) +#else // No options specified! Use the default #define MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_DEFAULT #endif +#endif namespace Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap { @@ -60,6 +63,7 @@ namespace Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap | MddBootstrapInitializeOptions_OnPackageIdentity_NOOP #endif ; +#endif } static void Initialize() @@ -68,7 +72,7 @@ namespace Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap PCWSTR c_versionTag{ WINDOWSAPPSDK_RELEASE_VERSION_TAG_W }; const PACKAGE_VERSION c_minVersion{ WINDOWSAPPSDK_RUNTIME_VERSION_UINT64 }; const auto c_options{ Options() }; - const HRESULT hr{ ::MddBootstrapInitialize2(c_majorMinorVersion, c_versionTag, c_minVersion, c_options }; + const HRESULT hr{ ::MddBootstrapInitialize2(c_majorMinorVersion, c_versionTag, c_minVersion, c_options) }; if (FAILED(hr)) { exit(hr); diff --git a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cs b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cs index 66a27d4ada..f6d6d57d8d 100644 --- a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cs +++ b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cs @@ -2,16 +2,19 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. // If any options are defined use them, else use the default -#if !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_DEFAULT) && \ - !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_NONE) && \ - !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK) && \ - !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK_IFDEBUGGERATTACHED) && \ - !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_FAILFAST) && \ - !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONNOMATCH_SHOWUI) && \ - !defined(MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONPACKAGEIDENTITY_NOOP) +#if !MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_DEFAULT +// Default isn't defined. Define it if no options are defined +#if MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_NONE +#elif MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK +#elif MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK_IFDEBUGGERATTACHED +#elif MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_FAILFAST +#elif MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONNOMATCH_SHOWUI +#elif MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONPACKAGEIDENTITY_NOOP +#else // No options specified! Use the default #define MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_DEFAULT #endif +#endif namespace Microsoft.Windows.ApplicationModel.DynamicDependency.BootstrapCS { @@ -24,8 +27,8 @@ internal static void AccessWindowsAppSDK() string versionTag = global::Microsoft.WindowsAppSDK.Release.VersionTag; var minVersion = new PackageVersion(global::Microsoft.WindowsAppSDK.Runtime.Version.UInt64); var options = Options; - int hresult = 0; - if (!global::Microsoft.Windows.ApplicationModel.DynamicDependency.Bootstrap.TryInitialize(majorMinorVersion, versionTag, minVersion, options, out hresult)) + int hr = 0; + if (!global::Microsoft.Windows.ApplicationModel.DynamicDependency.Bootstrap.TryInitialize(majorMinorVersion, versionTag, minVersion, options, out hr)) { global::System.Environment.Exit(hr); } @@ -48,16 +51,16 @@ internal static void AccessWindowsAppSDK() options |= global::Microsoft.Windows.ApplicationModel.DynamicDependency.Bootstrap.InitializeOptions.OnError_DebugBreak; #endif #if MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK_IFDEBUGGERATTACHED - options | global::Microsoft.Windows.ApplicationModel.DynamicDependency.Bootstrap.InitializeOptions.OnError_DebugBreak_IfDebuggerAttached; + options |= global::Microsoft.Windows.ApplicationModel.DynamicDependency.Bootstrap.InitializeOptions.OnError_DebugBreak_IfDebuggerAttached; #endif #if MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_FAILFAST - options | global::Microsoft.Windows.ApplicationModel.DynamicDependency.Bootstrap.InitializeOptions.OnError_FailFast; + options |= global::Microsoft.Windows.ApplicationModel.DynamicDependency.Bootstrap.InitializeOptions.OnError_FailFast; #endif #if MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONNOMATCH_SHOWUI - options | global::Microsoft.Windows.ApplicationModel.DynamicDependency.Bootstrap.InitializeOptions.OnNoMatch_ShowUI; + options |= global::Microsoft.Windows.ApplicationModel.DynamicDependency.Bootstrap.InitializeOptions.OnNoMatch_ShowUI; #endif #if MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONPACKAGEIDENTITY_NOOP - options | global::Microsoft.Windows.ApplicationModel.DynamicDependency.Bootstrap.InitializeOptions.OnPackageIdentity_NOOP; + options |= global::Microsoft.Windows.ApplicationModel.DynamicDependency.Bootstrap.InitializeOptions.OnPackageIdentity_NOOP; #endif return options; #endif diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/README.txt b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/README.txt new file mode 100644 index 0000000000..4b29980529 --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/README.txt @@ -0,0 +1 @@ +This is a build-only test. Do no run. diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.filters b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.filters new file mode 100644 index 0000000000..a87816023e --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.filters @@ -0,0 +1,25 @@ + + + + + {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 + + + + + + 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 new file mode 100644 index 0000000000..91dd1db298 --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj @@ -0,0 +1,136 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + 16.0 + {53E3E9A7-11BE-4BBC-981F-AF98A1B00617} + Win32Proj + Test_BootstrapAutoInitialize_CPP_Default + 10.0 + + + + DynamicLibrary + false + v142 + Unicode + + + false + false + true + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + NotUsing + Level4 + true + stdcpp17 + true + true + %(AdditionalIncludeDirectories);$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)\..\WindowsAppRuntime_BootstrapDLL + $(RepoRoot)\test\DynamicDependency\Test_BootstrapAutoInitialize\CPP;%(AdditionalIncludeDirectories) + + + Windows + onecore.lib;onecoreuap.lib;Microsoft.WindowsAppRuntime.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories);$(OutDir)\..\WindowsAppRuntime_DLL + + + + + true + true + NDEBUG;%(PreprocessorDefinitions) + + + true + true + + + + + _DEBUG;%(PreprocessorDefinitions) + + + + + + + WIN32;%(PreprocessorDefinitions) + + + + + + + + + + + {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/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/packages.config b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/packages.config new file mode 100644 index 0000000000..643c1c537e --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/README.txt b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/README.txt new file mode 100644 index 0000000000..4b29980529 --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/README.txt @@ -0,0 +1 @@ +This is a build-only test. Do no run. diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.filters b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.filters new file mode 100644 index 0000000000..a87816023e --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.filters @@ -0,0 +1,25 @@ + + + + + {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 + + + + + + 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 new file mode 100644 index 0000000000..60f466d56a --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj @@ -0,0 +1,137 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + 16.0 + {F9BA7D03-5B5F-4FF1-A3A6-81B64FBDFE2A} + Win32Proj + Test_BootstrapAutoInitialize_CPP_Options_Default + 10.0 + + + + DynamicLibrary + false + v142 + Unicode + + + false + false + true + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + NotUsing + Level4 + true + stdcpp17 + true + true + MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_DEFAULT;%(PreprocessorDefinitions) + %(AdditionalIncludeDirectories);$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)\..\WindowsAppRuntime_BootstrapDLL + $(RepoRoot)\test\DynamicDependency\Test_BootstrapAutoInitialize\CPP;%(AdditionalIncludeDirectories) + + + Windows + onecore.lib;onecoreuap.lib;Microsoft.WindowsAppRuntime.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories);$(OutDir)\..\WindowsAppRuntime_DLL + + + + + true + true + NDEBUG;%(PreprocessorDefinitions) + + + true + true + + + + + _DEBUG;%(PreprocessorDefinitions) + + + + + + + WIN32;%(PreprocessorDefinitions) + + + + + + + + + + + {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/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/packages.config b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/packages.config new file mode 100644 index 0000000000..643c1c537e --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/README.txt b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/README.txt new file mode 100644 index 0000000000..4b29980529 --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/README.txt @@ -0,0 +1 @@ +This is a build-only test. Do no run. diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.filters b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.filters new file mode 100644 index 0000000000..a87816023e --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.filters @@ -0,0 +1,25 @@ + + + + + {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 + + + + + + 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 new file mode 100644 index 0000000000..bfa760f2f8 --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj @@ -0,0 +1,141 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + 16.0 + {EDAC8AF1-CBD2-41d4-8AB1-02BECD9E01CB} + Win32Proj + Test_BootstrapAutoInitialize_CPP_Options_Defined + 10.0 + + + + DynamicLibrary + false + v142 + Unicode + + + false + false + true + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + NotUsing + Level4 + true + stdcpp17 + true + true + MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK_IFDEBUGGERATTACHED;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_FAILFAST;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONNOMATCH_SHOWUI;%(PreprocessorDefinitions) + MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONPACKAGEIDENTITY_NOOP;%(PreprocessorDefinitions) + %(AdditionalIncludeDirectories);$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)\..\WindowsAppRuntime_BootstrapDLL + $(RepoRoot)\test\DynamicDependency\Test_BootstrapAutoInitialize\CPP;%(AdditionalIncludeDirectories) + + + Windows + onecore.lib;onecoreuap.lib;Microsoft.WindowsAppRuntime.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories);$(OutDir)\..\WindowsAppRuntime_DLL + + + + + true + true + NDEBUG;%(PreprocessorDefinitions) + + + true + true + + + + + _DEBUG;%(PreprocessorDefinitions) + + + + + + + WIN32;%(PreprocessorDefinitions) + + + + + + + + + + + {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/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/packages.config b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/packages.config new file mode 100644 index 0000000000..643c1c537e --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/README.txt b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/README.txt new file mode 100644 index 0000000000..4b29980529 --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/README.txt @@ -0,0 +1 @@ +This is a build-only test. Do no run. diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.filters b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.filters new file mode 100644 index 0000000000..a87816023e --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.filters @@ -0,0 +1,25 @@ + + + + + {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 + + + + + + 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 new file mode 100644 index 0000000000..042580df3f --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj @@ -0,0 +1,137 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + 16.0 + {822E1679-8F71-4477-BE44-9EC77983360E} + Win32Proj + Test_BootstrapAutoInitialize_CPP_Options_None + 10.0 + + + + DynamicLibrary + false + v142 + Unicode + + + false + false + true + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + NotUsing + Level4 + true + stdcpp17 + true + true + MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_NONE;%(PreprocessorDefinitions) + %(AdditionalIncludeDirectories);$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)\..\WindowsAppRuntime_BootstrapDLL + $(RepoRoot)\test\DynamicDependency\Test_BootstrapAutoInitialize\CPP;%(AdditionalIncludeDirectories) + + + Windows + onecore.lib;onecoreuap.lib;Microsoft.WindowsAppRuntime.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories);$(OutDir)\..\WindowsAppRuntime_DLL + + + + + true + true + NDEBUG;%(PreprocessorDefinitions) + + + true + true + + + + + _DEBUG;%(PreprocessorDefinitions) + + + + + + + WIN32;%(PreprocessorDefinitions) + + + + + + + + + + + {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/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/packages.config b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/packages.config new file mode 100644 index 0000000000..643c1c537e --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/WindowsAppSDK-VersionInfo.h b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/WindowsAppSDK-VersionInfo.h new file mode 100644 index 0000000000..11ae07b825 --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/WindowsAppSDK-VersionInfo.h @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +// NOTE: This is a representative copy as shipped by the final product. Actual values are gibberish not relevant + +#ifndef __WINDOWSAPPSDK_VERSIONINFO_H__ +#define __WINDOWSAPPSDK_VERSIONINFO_H__ + +// Release information +#define WINDOWSAPPSDK_RELEASE_MAJOR 1 +#define WINDOWSAPPSDK_RELEASE_MINOR 1 +#define WINDOWSAPPSDK_RELEASE_PATCH 0 +#define WINDOWSAPPSDK_RELEASE_MAJORMINOR 0x00010001 + +#define WINDOWSAPPSDK_RELEASE_CHANNEL "preview" +#define WINDOWSAPPSDK_RELEASE_CHANNEL_W L"preview" + +#define WINDOWSAPPSDK_RELEASE_VERSION_TAG "preview1" +#define WINDOWSAPPSDK_RELEASE_VERSION_TAG_W L"preview1" + +#define WINDOWSAPPSDK_RELEASE_VERSION_SHORTTAG "p1" +#define WINDOWSAPPSDK_RELEASE_VERSION_SHORTTAG_W L"p1" + +// Runtime information +#define WINDOWSAPPSDK_RUNTIME_IDENTITY_PUBLISHER "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" +#define WINDOWSAPPSDK_RUNTIME_IDENTITY_PUBLISHER_W L"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" +#define WINDOWSAPPSDK_RUNTIME_IDENTITY_PUBLISHERID "8wekyb3d8bbwe" +#define WINDOWSAPPSDK_RUNTIME_IDENTITY_PUBLISHERID_W L"8wekyb3d8bbwe" + +#define WINDOWSAPPSDK_RUNTIME_VERSION_MAJOR 1000 +#define WINDOWSAPPSDK_RUNTIME_VERSION_MINOR 446 +#define WINDOWSAPPSDK_RUNTIME_VERSION_BUILD 804 +#define WINDOWSAPPSDK_RUNTIME_VERSION_REVISION 0 +#define WINDOWSAPPSDK_RUNTIME_VERSION_UINT64 0x03E801BE03240000 +#define WINDOWSAPPSDK_RUNTIME_VERSION_DOTQUADSTRING "1000.446.804.0" +#define WINDOWSAPPSDK_RUNTIME_VERSION_DOTQUADSTRING_W L"1000.446.804.0" + +#define WINDOWSAPPSDK_RUNTIME_PACKAGE_FRAMEWORK_PACKAGEFAMILYNAME "Microsoft.WindowsAppRuntime.1.1-preview1_8wekyb3d8bbwe" +#define WINDOWSAPPSDK_RUNTIME_PACKAGE_FRAMEWORK_PACKAGEFAMILYNAME_W "Microsoft.WindowsAppRuntime.1.1-preview1_8wekyb3d8bbwe" +#define WINDOWSAPPSDK_RUNTIME_PACKAGE_MAIN_PACKAGEFAMILYNAME "MicrosoftCorporationII.WinAppRuntime.Main.1.1-p1_8wekyb3d8bbwe" +#define WINDOWSAPPSDK_RUNTIME_PACKAGE_MAIN_PACKAGEFAMILYNAME_W L"MicrosoftCorporationII.WinAppRuntime.Main.1.1-p1_8wekyb3d8bbwe" +#define WINDOWSAPPSDK_RUNTIME_PACKAGE_SINGLETON_PACKAGEFAMILYNAME "Microsoft.WindowsAppRuntime.Singleton-preview1_8wekyb3d8bbwe" +#define WINDOWSAPPSDK_RUNTIME_PACKAGE_SINGLETON_PACKAGEFAMILYNAME_W L"Microsoft.WindowsAppRuntime.Singleton-preview1_8wekyb3d8bbwe" + +#if defined(__cplusplus) +namespace Microsoft::WindowsAppSDK +{ + namespace Release + { + constexpr uint16_t Major = 1; + constexpr uint16_t Minor = 1; + constexpr uint16_t Patch = 0; + constexpr uint32_t MajorMinor = 0x00010001; + + constexpr PCWSTR Channel = L"preview"; + + constexpr PCWSTR VersionTag = L"preview1"; + + constexpr PCWSTR VersionShortTag = L"p1"; + } + + namespace Runtime + { + namespace Identity + { + constexpr PCWSTR Publisher = L"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"; + constexpr PCWSTR PublisherId = L"8wekyb3d8bbwe"; + } + + namespace Version + { + constexpr uint16_t Major = 1000; + constexpr uint16_t Minor = 446; + constexpr uint16_t Build = 804; + constexpr uint16_t Revision = 0; + constexpr uint64_t UInt64 = 0x03E801BE03240000; + constexpr PCWSTR DotQuadString = L"1000.446.804.0"; + } + + namespace Packages + { + namespace Framework + { + constexpr PCWSTR PackageFamilyName = L"Microsoft.WindowsAppRuntime.1.1-preview1_8wekyb3d8bbwe"; + } + namespace Main + { + constexpr PCWSTR PackageFamilyName = L"MicrosoftCorporationII.WinAppRuntime.Main.1.1-p1_8wekyb3d8bbwe"; + } + namespace Singleton + { + constexpr PCWSTR PackageFamilyName = L"Microsoft.WindowsAppRuntime.Singleton-preview1_8wekyb3d8bbwe"; + } + } + } +} +#endif // defined(__cplusplus) + +#endif // __WINDOWSAPPSDK_VERSIONINFO_H__ 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 new file mode 100644 index 0000000000..9e73764869 --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj @@ -0,0 +1,48 @@ + + + + net5.0 + net5.0-windows10.0.19041.0 + 10.0.17763.0 + x86;x64;arm64;AnyCPU + + + + false + + + + false + + + + false + + + + false + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..17250de9cd --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj @@ -0,0 +1,52 @@ + + + + net5.0 + net5.0-windows10.0.19041.0 + 10.0.17763.0 + x86;x64;arm64;AnyCPU + + + + false + + + + false + + + + false + + + + false + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_DEFAULT + + + 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 new file mode 100644 index 0000000000..44e5a5de02 --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj @@ -0,0 +1,56 @@ + + + + net5.0 + net5.0-windows10.0.19041.0 + 10.0.17763.0 + x86;x64;arm64;AnyCPU + + + + false + + + + false + + + + false + + + + false + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_DEBUGBREAK_IFDEBUGGERATTACHED + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONERROR_FAILFAST + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONNOMATCH_SHOWUI + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONPACKAGEIDENTITY_NOOP + + + 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 new file mode 100644 index 0000000000..34e46f8f99 --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj @@ -0,0 +1,52 @@ + + + + net5.0 + net5.0-windows10.0.19041.0 + 10.0.17763.0 + x86;x64;arm64;AnyCPU + + + + false + + + + false + + + + false + + + + false + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_NONE + + + diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/WindowsAppSDK-VersionInfo.cs b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/WindowsAppSDK-VersionInfo.cs new file mode 100644 index 0000000000..3deae4ff3c --- /dev/null +++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/WindowsAppSDK-VersionInfo.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +namespace Microsoft.WindowsAppSDK +{ + // Release information + public class Release + { + public const ushort Major = 1; + public const ushort Minor = 1; + public const ushort Patch = 0; + public const uint MajorMinor = 0x00010001; + + public const string Channel = "preview"; + + public const string VersionTag = "preview1"; + + public const string VersionShortTag = "p1"; + } + + // Runtime information + namespace Runtime + { + public class Identity + { + public const string Publisher = "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"; + public const string PublisherId = "8wekyb3d8bbwe"; + } + + public class Version + { + public const ushort Major = 1000; + public const ushort Minor = 446; + public const ushort Build = 804; + public const ushort Revision = 0; + public const ulong UInt64 = 0x03E801BE03240000; + public const string DotQuadString = "1000.446.804.0"; + } + + namespace Packages + { + public class Framework + { + public const string PackageFamilyName = "Microsoft.WindowsAppRuntime.1.1-preview1_8wekyb3d8bbwe"; + } + public class Main + { + public const string PackageFamilyName = "MicrosoftCorporationII.WinAppRuntime.Main.1.1-p1_8wekyb3d8bbwe"; + } + public class Singleton + { + public const string PackageFamilyName = "Microsoft.WindowsAppRuntime.Singleton-preview1_8wekyb3d8bbwe"; + } + } + } +} From fe64ab9095388fa4a8751a52c18ff7028eb70c7b Mon Sep 17 00:00:00 2001 From: Paul Purifoy <33183370+pmpurifoy@users.noreply.github.com> Date: Wed, 6 Apr 2022 16:35:25 -0700 Subject: [PATCH 09/11] Remove the duplicate ToastNotifications-spec.md in spec\PushNotifications (#2366) * Delete ToastNotifications-spec.md * Update PushNotifications-spec.md --- .../PushNotifications-spec.md | 2 +- .../ToastNotifications-spec.md | 504 ------------------ 2 files changed, 1 insertion(+), 505 deletions(-) delete mode 100644 specs/PushNotifications/ToastNotifications-spec.md diff --git a/specs/PushNotifications/PushNotifications-spec.md b/specs/PushNotifications/PushNotifications-spec.md index 3df0b65ab8..0aa65fb7b1 100644 --- a/specs/PushNotifications/PushNotifications-spec.md +++ b/specs/PushNotifications/PushNotifications-spec.md @@ -17,7 +17,7 @@ For more details see: corresponding client. The below diagram is an illustration of the overall Push Flow that we have today: -![Legacy Flow For Windows App SDK](Legacy.png) +![Legacy Flow For Windows App SDK](Legacy.PNG) ## The problems today diff --git a/specs/PushNotifications/ToastNotifications-spec.md b/specs/PushNotifications/ToastNotifications-spec.md deleted file mode 100644 index 23fb67a447..0000000000 --- a/specs/PushNotifications/ToastNotifications-spec.md +++ /dev/null @@ -1,504 +0,0 @@ -# App Notifications in Windows App SDK - -# Background - -App Notifications are UI popups that contain rich text, controls and images to display a message to -the user. It is not sufficient for a Notification popup on the screen to simply be displayed to the -user, it should be actionable. The user should be able to click on a Notification popup to launch an -app in the correct context. For example, a news article related Notification is expected to launch -the News app along with the article in question in the foreground. Another actionable scenario is -for the user to actually interact with the contents of the Notification popup like a UI control -button. For example, a messaging app like Teams that displays a message from another user could have -a "Respond To" textbox and button so that the user can directly respond to the message in the popup -without having to launch the application. This scenario triggers a background process on behalf of -the application (with no UI) which inturn processes the "Reply To" message and forwards the response -to the other device. - -Notifications could have a local or cloud based origin. In the case of Local Notifications, the -message always originates from the app installed on the device. For Cloud Notifications, the message -always originates from a remote application service that targets the locally installed app in -question. - -Here is a visual representation of a simple Notification with no interactive controls: - -![Notification Simple](https://docs.microsoft.com/windows/apps/design/shell/tiles-and-notifications/images/send-toast-02.png) - -Here is a visual representation of a Notification with simple button controls: - -![Notification Interactive 1](https://docs.microsoft.com/windows/apps/design/shell/tiles-and-notifications/images/adaptivetoasts-structure.jpg) - -Here is a visual representation of a Notification with a Message "Reply To" option: - -![Toast Interactive 2](https://docs.microsoft.com/windows/apps/design/shell/tiles-and-notifications/images/toast-notification.png) - -For more details see: - -- [Toast Notification WinRT APIs](https://docs.microsoft.com//uwp/api/Windows.UI.Notifications.ToastNotification?view=winrt-20348) - Defines all the API constructs that we have for Notifications in WinRT today. -- [Toast Notification UX Guidance using Toolkit](https://docs.microsoft.com/windows/apps/design/shell/tiles-and-notifications/toast-ux-guidance) - Defines the UX Guidance for developers who want to display Notifications. -- [Sending Local Toasts using C# using Toolkit](https://docs.microsoft.com/windows/apps/design/shell/tiles-and-notifications/send-local-toast?tabs=uwp) - Defines how an app developer can send interactive Notifications to the user and configure these - Notifications to respond to user actions. - -## The problems today - -**Cloud Notification integration with Windows App SDK**: While we support Push scenarios for Raw -Notifications in WinAppSDK, we do not support Cloud Sourced App Notifications. We need to fill this -gap. - -**API fragmentation**: There are too many API technologies that display Notifications and setup -their activation handlers today: Windows SDK, Desktop App Activations via the COM Model and the -Windows Toolkit which is a Nuget library. It gets overwhelming for a developer who does not -understand all these technologies to ramp up and get Notifications working for their app. - -**Support and Troubleshooting Notifcation Issues**: Because of the API fragmentation mentioned -above, it is also very difficult to diagnose issues when developers hit them and a large portion of -developer cycles are spent diagnosing and troubleshooting problems in various API stacks instead of -a single stack. - -**Registration**: The Windows SDK today provides AppId overloads to developers who can specify their -own Identifier for Unpackaged apps. This overloaded AppId causes all sorts of problems including -string size limits being hit, Personally Identifiable Information stored as part of AppIds, invalid -Desktop Registrations etc. The WinApp SDK gets rid of the AppId overloads in the Public APIs and -ensures that we don't hit any of the above issues. - -**Activation**: Setting up activation handlers using Background Triggers is challenging for -developers because we don't have downlevel support for versions prior to 1903. Moreover, the steps -for setting up activation handlers vary greatly for different app types: MSIX Vs Unpackaged Vs UWP. -We will abstract away the activation technology and simplify this process for OS SKUs from RS5 -onwards. - -# Description - -The WinAppSDK AppNotification APIs enable all Desktop applications to display the same rich UI -pop-ups that they are used to doing today minus all the complexities and overhead described above. -Desktop applications include Unpackaged apps and Packaged win32 (MSIX Desktop Bridge, Sparse Signed -Packages). The SDK implementation will ensure that all Notification scenarios will adhere to OS -resource management policies like Power Saver, Network Attribution (reporting the amount of data an -app uses), Group Policies, etc. The SDK will also abstract away the complexities of dealing with -Notification delivery and related activations as much as possible freeing the developer to focus on -other app related challenges. - -The App Notification API allows Packaged and Unpackaged apps to: - -- Use common APIs to Register and Unregister Notifications. -- Use common APIs to display Cloud Sourced Notifications. -- Use common APIs to display Local Notifications. -- Use common APIs to Update/Delete Notifications. -- Use AppLifecycle constructs and event handlers to process invoke operations on behalf of the - user. - -# Examples - -## Registering and handling a notification - -Packaged and Unpackaged Desktop apps will need to register themselves to handle App Notifications. -For Packaged apps, WinAppSDK will use the CLSID defined in the appx manifest to register the current -process as the COM Server for Notification invokes. The process.exe declared in the manifest will -have to be the same process calling into Register() for the API call to succeed. For Unpackaged -apps, WinAppSDK will determine appropriate DisplayName and and Icon. The current process module(.exe -file) will be the COM Server for Notification invokes. - -```cpp - -int main() -{ - // To ensure all Notification handling happens in this process instance, register for - // NotificationInvoked before calling Register(). Without this a new process will - // be launched to handle the notification. - const auto token = winrt::AppNotificationManager::Default().NotificationInvoked([](const auto&, const winrt::AppNotificationActivatedEventArgs& notificationActivatedEventArgs) - { - ProcessNotificationArgs(notificationActivatedEventArgs); - }); - - auto manager = winrt::AppNotificationManager::Default(); - manager.Register(); - - auto args = winrt::AppInstance::GetCurrent().GetActivatedEventArgs(); - auto kind = args.Kind(); - - if (kind == winrt::ExtendedActivationKind::Launch) - { - // App does Launch Stuff Here - } - else if (kind == winrt::ExtendedActivationKind::AppNotification) - { - auto notificationActivatedEventArgs = args.Data().as(); - ProcessNotificationArgs(notificationActivatedEventArgs); - } - - // other app init and then message loop here - - // Cleanup event handler - manager.NotificationInvoked(token); - - // Call Unregister() before exiting main so that subsequent invocations will launch a new process - manager.Unregister(); - return 0; -} -``` - -## Displaying an App Notification - -To display a Notification, an app needs to define a payload in xml. In the example below, the -developer wants to do a bunch of things: Replace a prior chat notification from a friend for a -specific chat group. The developer also wants to make sure that the notification is deleted in case -the user reboots the machine. - -```cpp -void DisplayNotificationForFriend(winrt::hstring const& payload, winrt::hstring const& friendId, winrt::hstring const& chatGroupId) -{ - winrt::AppNotification notification(payload); - - // Setting GroupId here ensures that the Notification is only replaced for a specific chat group - notification.Group(chatGroupId); - - // Setting friend id here ensures that the Notification only replaces the one from this specific friend - notification.Tag(friendId); - - // Developer sets the Expiry property on reboot to true to delete the notification on reboot - notification.ExpiresOnReboot(true); - winrt::AppNotificationManager::Default().Show(notification); -} -``` - -## Processing a user generated Action on the Notification - -The app will need to process the invocation in response to a User interacting with the Notification -in Action Centre. There are 2 common scenarios here after the invoke takes place: - -1. The developer can choose to have the app launch in a specific UI context OR -2. The developer can choose to have the app evaluate an action specific behavior (like a button - press in the payload body) without rendering any UI. - -The example below goes through a scenario where the developer evaluates the Activation Arguments to -determine whether a foreground window needs to be rendered or whether some background business logic -needs to be run without any special UI rendering. - -Note: activationType="background" in the Notification payload body is ignored for Desktop apps. It -is upto the developer to process the Activation Arguments and decide whether to display UI or not. - -```cpp -// -// -// -// Jill Bender -// Check out where we camped last weekend! Incredible!! -// -// -// -// -// -// -// -// - -void ProcessNotificationArgs(const winrt::AppNotificationActivatedEventArgs& notificationActivatedEventArgs) -{ - // If the user clicks on a toast, the code will need to launch the chat thread window - if (std::wstring(notificationActivatedEventArgs.Argument().c_str()).find(L"openThread") != std::wstring::npos) - { - GenerateChatThreadWindow(); - } - else // If the user responds to a message by clicking a button in the notification, we will need to reply back to the other user - if (std::wstring(notificationActivatedEventArgs.Argument().c_str()).find(L"reply") != std::wstring::npos) - { - auto input = notificationActivatedEventArgs.UserInput(); - auto replyBoxText = input.Lookup(L"ReplyBox"); - - // Process the reply text - SendReplyToUser(replyBoxText); - } -} -``` - -## Processing Active Notifications - -We define Active Notifications as payloads that have already been displayed by the app and show up -in the Action Centre. In this example, the developer want to delete all Active Notifications from a -former friend except if the Notification falls under the Archived group. - -```cpp -winrt::Windows::Foundation::IAsyncAction RemoveAllNotificationsFromFormerFriendAsync(const std::wstring friendId) -{ - winrt::AppNotificationManager manager = winrt::AppNotificationManager::Default(); - auto notifications = co_await manager.GetAllAsync(); - - for (auto notification : notifications) - { - // We remove all notifications with the friend who sent them.The tag is the friendId. - // We target all possible chat groups where this friend is present except the Archived group - if (notification.Tag() == friendId && notification.Group() != L"Archived") - { - co_await manager.RemoveByTagAndGroupAsync(notification.Tag(), notification.Group()); - } - } -} -``` - -## Notification Progress Updates - -Sometimes a developer would like to show progress bar related updates in a Notification: - -![Notification Progress](https://docs.microsoft.com/windows/apps/design/shell/tiles-and-notifications/images/toast-progressbar-annotated.png) - -To accomplish that, the developer will need to use the AppNotificationProgressData construct to -update the progress bar on the screen. - -```cpp - -const winrt::hstring c_tag = L"weekly-playlist"; -const winrt::hstring c_group = L"downloads"; - -// Send first Notification Progress Update -void SendUpdatableNotificationWithProgress() -{ - winrt::hstring payload = - LR"( - - - Downloading this week's new music... - - - - )"; - - winrt::AppNotification notification(payload); - notification.Tag(c_tag); - notification.Group(c_group); - - // Assign initial values for first notification progress UI - winrt::AppNotificationProgressData data(1); - data.Title(L"Weekly playlist"); // Binds to {progressTitle} in xml payload - data.Value(0.6); // Binds to {progressValue} in xml payload - data.ValueStringOverride(L"15/26 songs"); // Binds to {progressValueString} in xml payload - data.Status(L"Downloading..."); // Binds to {progressStatus} in xml payload - - notification.Progress(data); - winrt::AppNotificationManager::Default().Show(notification); -} - -// Send subsequent progress updates -winrt::Windows::Foundation::IAsyncAction UpdateProgressAsync() -{ - // Assign new values - winrt::AppNotificationProgressData data(2 /* Sequence number */ ); - data.Title(L"Weekly playlist"); // Binds to {progressTitle} in xml payload - data.Value(0.7); // Binds to {progressValue} in xml payload - data.ValueStringOverride(L"18/26 songs"); // Binds to {progressValueString} in xml payload - data.Status(L"Downloading..."); // Binds to {progressStatus} in xml payload - - auto result = co_await winrt::AppNotificationManager::Default().UpdateAsync(data, c_tag, c_group); - if (result == winrt::AppNotificationProgressResult::AppNotificationNotFound) - { - // Toast Progress Update Failed since the previous notification update is dismissed by the user! So account for this in your logic by stopping updates or starting a new Progress Update flow. - } -} -``` - -# Remarks - -## Registration - -Call AppNotificationManager::Register() first to register the current process as the target for -Notification invokes. When the app is terminating, the developer should call -AppNotificationManager::Unregister() to free up COM and allow for subsequent invokes to launch a new -process. - -## Event Handlers - -Subscribe to Notification event handlers to handle invocations if the process happens to be already -running. If this isn't done, the OS will launch a new process for every subsequent invocation. - -## Manifest Registration - -For Packaged applications, the COM activator CLSID and the process module(.exe file) need to be -specified in the manifest as part of the desktop and com extensions. In the example below, we use an -activatorId = "1920DBA9-0F64-4F0D-8A4B-5E207B812E61". The launch args would need to be pre-set to -"----AppNotificationActivated:" to ensure that WinAppSDK can process the payload as an -AppNotification Kind. - -```xml - - - - - - - - - - - - -``` - -# API Details - -```c# -namespace Microsoft.Windows.AppNotifications -{ - // Event args for the Notification Activation - runtimeclass AppNotificationActivatedEventArgs - { - // Arguments from the invoked button. Empty for Default Activation with no launch args specified in payload. - String Argument{ get; }; - - // The data from the input elements of a Notification like a TextBox - Windows.Foundation.Collections.IMap UserInput{ get; }; - } - - // Notification Progress Data - runtimeclass AppNotificationProgressData - { - // Initializes a new Instance of NotificationProgressData - // The sequence number is non-zero or this will throw. - AppNotificationProgressData(UInt32 sequenceNumber); - - // Gets or sets a non-zero sequence number of this notification data. - // When multiple NotificationProgressData objects are received, the system displays the data with the greatest non-zero number. - UInt32 SequenceNumber; - - // Gets/Sets the value for the title. Binds to {progressTitle} in progress xml tag. - String Title; - - // Gets/Sets the Value for the numerical Progress percentile: a number between 0 and 1. Binds to {progressValue} in progress xml tag. - Double Value; - - // Gets/Sets the Value for the Progress String. Binds to {progressValueString} in progress xml tag - String ValueStringOverride; - - // Gets/Sets the Value for the Status. Binds to {progressStatus} in progress xml tag - String Status; - } - - // The Notification User Setting or Notification Group Policy Setting - enum AppNotificationSetting - { - Enabled, // Notification is not blocked by settings or group policy - DisabledForApplication, // Notification is blocked by a user defined App Setting - DisabledForUser, // Notification is blocked by a user defined Global Setting - DisabledByGroupPolicy, // Notification is blocked by Group Policy - DisabledByManifest, // Notification is blocked by a setting in the manifest. Only for packaged applications. - }; - - // The Result for a Notification Progress related operation - enum AppNotificationProgressResult - { - Succeeded, // The progress operation succeeded - AppNotificationNotFound, // The progress operation failed to find a Notification to process updates - }; - - // The Priority of the Notification UI associated with it's popup in the Action Centre - enum AppNotificationPriority - { - Default, // The notification should have default behavior in terms of delivery and display priority during connected standby mode. - High, // The notification should be treated as high priority. For desktop PCs, this means during connected standby mode the incoming notification can turn on the screen for Surface-like devices if it doesn't have a closed lid detected. - }; - - runtimeclass AppNotification - { - // The notification payload representation in xml - AppNotification(String payload); - - // Unique identifier used to replace a notification within a group. - String Tag; - - // Unique identifier for a Notification group in the app - String Group; - - // A unique identifier for the Notification generated by the platform. - UInt32 Id { get; }; - - // The notification payload representation in XML - String Payload{ get; }; - - // Gets or sets additional information about the Notification progress. - AppNotificationProgressData Progress; - - // Gets or sets the time after which a Notification should not be displayed. - Windows.Foundation.DateTime Expiration; - - // Indicates whether the Notification will remain in the Action Center after a reboot. - Boolean ExpiresOnReboot; - - // Gets or sets the priority for a Notification. - // Hints on how and at what urgency level a notification should be presented to the user (whether to wake up the screen, etc). - AppNotificationPriority Priority; - - // Gets or sets whether a Notification's pop-up UI is displayed on the user's screen. - Boolean SuppressDisplay; - } - - // The manager class which encompasses all App Notification API Functionality - runtimeclass AppNotificationManager - { - // Gets a Default instance of a AppNotificationManager - static AppNotificationManager Default{ get; }; - - // Registers an application for Notifications - // For Packaged apps, the COM server is defined in the manifest. The Process calling Register() and the process defined as the COM server are required to be the same. - // For Unpackaged apps, the caller process will be registered as the COM server. And assets like displayname and icon will be gleaned from Shell and registered as well. - void Register(); - - // Unregisters the COM Service so that a subsequent activation will launch a new process - void Unregister(); - - // Cleans up all Registration related data for toasts. After this, toasts will not work until Register() is called again - void UnregisterAll(); - - // Event handler for Notification Activations - event Windows.Foundation.TypedEventHandler NotificationInvoked; - - // Displays the Notification in Action Center - void Show(AppNotification notification); - - // Updates the Notification for a Progress related operation using Tag and Group - Windows.Foundation.IAsyncOperation UpdateAsync(AppNotificationProgressData data, String tag, String group); - - // Updates the Notification for a Progress related operation using Tag - Windows.Foundation.IAsyncOperation UpdateAsync(AppNotificationProgressData data, String tag); - - // Get the Notification Setting status for the app - AppNotificationSetting Setting { get; }; - - // Removes a specific Notification with a specific NotificationIdentifier from Action Centre - Windows.Foundation.IAsyncAction RemoveByIdAsync(UInt32 notificationId); - - // Removes a Notification having a specific tag - Windows.Foundation.IAsyncAction RemoveByTagAsync(String tag); - - // Removes a Notification having a specific tag and group - Windows.Foundation.IAsyncAction RemoveByTagAndGroupAsync(String tag, String group); - - // Remove all Notifications for a specific group - Windows.Foundation.IAsyncAction RemoveByGroupAsync(String group); - - // Removes all the Notifications for the App from Action Centre - Windows.Foundation.IAsyncAction RemoveAllAsync(); - - // Gets all the Notifications for the App from Action Centre - Windows.Foundation.IAsyncOperation > GetAllAsync(); - } -} -``` - -# Appendix - -- To support Cloud Sourced Notifications, the Windows App SDK will have to implement some - specialized mapping for Local and Push Registrations in the WinAppSDK Singleton Package. -- Since building XML payloads at runtime is non-trivial, we encourage developers to utilize the - [Windows Community Toolkit](https://docs.microsoft.com/windows/communitytoolkit/), specifically - the - [ToastContentBuilder](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.uwp.notifications.toastcontentbuilder) - APIs to construct the XML payload in the short term. From fb187a0848b9666b63ab21e474cf317c0e83a503 Mon Sep 17 00:00:00 2001 From: sachintaMSFT <80828309+sachintaMSFT@users.noreply.github.com> Date: Thu, 7 Apr 2022 18:44:39 -0700 Subject: [PATCH 10/11] Add API contract version to Deployment interface (#2249) * Add API contract version to Deployment interface * Update contract name to DeploymentContract Co-authored-by: Santosh Chintalapati --- specs/Deployment/DeploymentAPI.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/specs/Deployment/DeploymentAPI.md b/specs/Deployment/DeploymentAPI.md index 7b6ec71473..ae6c202758 100644 --- a/specs/Deployment/DeploymentAPI.md +++ b/specs/Deployment/DeploymentAPI.md @@ -184,7 +184,11 @@ they shut down, to refer to the updated framework package. ```C# (but really MIDL3) namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime { + [contractversion(2)] + apicontract DeploymentContract{}; + /// Represents the current Deployment status of the WindowsAppRuntime + [contract(DeploymentContract, 1)] enum DeploymentStatus { Unknown = 0, @@ -194,6 +198,7 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime }; /// Represents the result of a Deployment Manager method. + [contract(DeploymentContract, 1)] runtimeclass DeploymentResult { DeploymentResult(DeploymentStatus status, HRESULT extendedError); @@ -205,11 +210,13 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime HRESULT ExtendedError{ get; }; }; -- // TODO: https://task.ms/38272182 - add APIcontract once WinAppSDK's rules for them are defined [contract(name,version)] /// This object is used to specify deployment options to apply when using DeploymentManager's /// Initialize method - runtimeClass DeploymentInitializeOptions + [contract(DeploymentContract, 2)] + runtimeclass DeploymentInitializeOptions { + DeploymentInitializeOptions(); + /// Gets or sets a value that indicates whether the processes associated with the /// WindowsAppSDK main and singleton packages will be shut down forcibly if they are /// currently in use, when registering the WinAppSDK packages. @@ -217,6 +224,7 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime }; /// Used to query deployment information for WindowsAppRuntime + [contract(DeploymentContract, 1)] static runtimeclass DeploymentManager { /// Returns the current deployment status of the current package's Windows App Runtime. @@ -224,12 +232,15 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime /// Checks the status of the WindowsAppRuntime of the current package and attempts to /// register any missing WinAppSDK packages. + [overload("Initialize")] static DeploymentResult Initialize(); /// Checks the status of the WindowsAppRuntime of the current package and attempts to /// register any missing WinAppSDK packages, while applying the DeploymentInitializeOptions /// passed in. - static DeploymentResult Initialize(Microsoft.Windows.ApplicationModel.WindowsAppRuntime::DeploymentInitializeOptions deploymentInitializeOptions); + [contract(DeploymentContract, 2)] + [overload("Initialize")] + static DeploymentResult Initialize(Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentInitializeOptions deploymentInitializeOptions); }; } ``` From c9d70a411d80e93894642b6b941689367a362449 Mon Sep 17 00:00:00 2001 From: Johan Laanstra Date: Thu, 7 Apr 2022 22:11:33 -0700 Subject: [PATCH 11/11] Resolve issues where AppInstance.FindOrRegisterForKey("key") can return null. (#2362) * Resolve issues where calling TrySetKey will duplicate the keyCreationMutex, preventing new instances from being created once the actual named instance has closed. * Use lock to decide what AppInstance corresponds to a key. --- dev/AppLifecycle/AppInstance.cpp | 27 ++++++++++++++++++++------- dev/AppLifecycle/AppInstance.h | 4 ++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/dev/AppLifecycle/AppInstance.cpp b/dev/AppLifecycle/AppInstance.cpp index 2873a0adb2..1a669f938a 100644 --- a/dev/AppLifecycle/AppInstance.cpp +++ b/dev/AppLifecycle/AppInstance.cpp @@ -453,6 +453,7 @@ namespace winrt::Microsoft::Windows::AppLifecycle::implementation if (m_isCurrent) { m_key.Reset(); + m_keyCreationMutexLock.reset(); m_keyCreationMutex.reset(); } } @@ -578,19 +579,31 @@ namespace winrt::Microsoft::Windows::AppLifecycle::implementation // processes from seeing the mutex but not seeing the Key on the instance yet. auto releaseOnExit = m_dataMutex.acquire(); - // We keep the mutex as a live member to ensure all other instances continue + // First caller creates the named mutex. All other instances continue // to get an 'open' instead of a 'create' due to it already existing. - // try_create returns true for a named mutex that already exists - // and so we can't rely on try_create and have to explicitly check GetLastError(). - m_keyCreationMutex.create(mutexName.c_str(), 0, MUTEX_ALL_ACCESS); + wil::unique_mutex keyCreationMutex; + keyCreationMutex.create(mutexName.c_str(), 0, MUTEX_ALL_ACCESS); - bool currentIsKeyOwner = (GetLastError() != ERROR_ALREADY_EXISTS); - if (currentIsKeyOwner) + DWORD waitResult = 0; + // Wait for 0 seconds. If the mutex is taken we don't own the mutex + auto lock = keyCreationMutex.acquire(&waitResult, 0); + + if (waitResult != WAIT_TIMEOUT) { + // We acquired the named mutex, store the mutex itself and the lock as a member. + // We keep the mutex and lock as a live member to ensure it stays alive for + // as long as we own the mutex + // NOTE: Assigning the new mutex will release the old one if it exists. + // Therefore make sure to release the lock first. + m_keyCreationMutexLock = std::move(lock); + m_keyCreationMutex = std::move(keyCreationMutex); + m_key.Resize((key.length() + 1) * sizeof(key.data()[0])); THROW_IF_FAILED(StringCchCopy(m_key.Get(), (m_key.Size() / sizeof(wchar_t)), key.c_str())); + + return true; } - return currentIsKeyOwner; + return false; } Microsoft::Windows::AppLifecycle::AppInstance AppInstance::FindForKey(std::wstring const& key) diff --git a/dev/AppLifecycle/AppInstance.h b/dev/AppLifecycle/AppInstance.h index 75ddfe8297..70afa371e8 100644 --- a/dev/AppLifecycle/AppInstance.h +++ b/dev/AppLifecycle/AppInstance.h @@ -68,6 +68,10 @@ namespace winrt::Microsoft::Windows::AppLifecycle::implementation wil::unique_mutex m_dataMutex; wil::unique_mutex m_keyCreationMutex; + // Listing this after the mutex it locks, guarantees that + // the lock gets released first before releasing the mutex itself. + // Destruction order is reverse of declaration order, see C++ std: 12.6.2 + wil::mutex_release_scope_exit m_keyCreationMutexLock; SharedMemory m_key; wil::unique_event m_innerActivated;