diff --git a/README.md b/README.md
index f833841027..8e44997189 100644
--- a/README.md
+++ b/README.md
@@ -450,16 +450,17 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github.
diff --git a/Samples/Geolocation/README.md b/Samples/Geolocation/README.md
index 47e116844b..10a58dcb8e 100644
--- a/Samples/Geolocation/README.md
+++ b/Samples/Geolocation/README.md
@@ -27,68 +27,66 @@ and track when the location changes in various ways.
After obtaining access to the user's location, an app can
-* Retrieve the current location.
-* Receiving events when the location changes.
-* Receiving events when the device has entered or exited locations of interest.
-* Receiving events when the device has spent significant time in a location (a "visit").
+- Retrieve the current location.
+- Receiving events when the location changes.
+- Receiving events when the device has entered or exited locations of interest.
+- Receiving events when the device has spent significant time in a location (a "visit").
-> **Note:** This sample is part of a large collection of UWP feature samples.
+> **Note:** This sample is part of a large collection of UWP feature samples.
> You can download this sample as a standalone ZIP file
> [from docs.microsoft.com](https://docs.microsoft.com/samples/microsoft/windows-universal-samples/geolocation/),
> or you can download the entire collection as a single
-> [ZIP file](https://github.com/Microsoft/Windows-universal-samples/archive/master.zip), but be
-> sure to unzip everything to access shared dependencies. For more info on working with the ZIP file,
-> the samples collection, and GitHub, see [Get the UWP samples from GitHub](https://aka.ms/ovu2uq).
-> For more samples, see the [Samples portal](https://aka.ms/winsamples) on the Windows Dev Center.
+> [ZIP file](https://github.com/Microsoft/Windows-universal-samples/archive/master.zip), but be
+> sure to unzip everything to access shared dependencies. For more info on working with the ZIP file,
+> the samples collection, and GitHub, see [Get the UWP samples from GitHub](https://aka.ms/ovu2uq).
+> For more samples, see the [Samples portal](https://aka.ms/winsamples) on the Windows Dev Center.
This sample also shows how to:
-- **Use a [geofence](http://msdn.microsoft.com/library/windows/apps/dn263744):** Receive notifications when the user's device has entered or left an area of interest.
-- **Handle changes in location permissions**: Register for the Geolocator's StatusChanged event and use the [StatusChangedEventArgs](http://msdn.microsoft.com/library/windows/apps/br225600) to determine the current position status.
-- **Get location from a background task**
-- **Handle geofencing events from a background task**
-- **Handle geovisit events from a background task**
-- **Obtain satellite data:** When available, use the [GeocoordinateSatelliteData](http://msdn.microsoft.com/library/windows/apps/jj635260) class to obtain additional information on the quality of the satellite based location data.
-- **Display a toast:** Notify the user when a geofencing event has occurred in the background.
-- **Refresh geofence binding:** Refresh the binding on resume and after removal of a geofence. Note that removal requires subscribing to removal events if a geofence is set as single use or a duration is set.
+- **Use a [geofence](http://msdn.microsoft.com/library/windows/apps/dn263744):** Receive notifications when the user's device has entered or left an area of interest.
+- **Handle changes in location permissions**: Register for the Geolocator's StatusChanged event and use the [StatusChangedEventArgs](http://msdn.microsoft.com/library/windows/apps/br225600) to determine the current position status.
+- **Get location from a background task**
+- **Handle geofencing events from a background task**
+- **Handle geovisit events from a background task**
+- **Obtain satellite data:** When available, use the [GeocoordinateSatelliteData](http://msdn.microsoft.com/library/windows/apps/jj635260) class to obtain additional information on the quality of the satellite based location data.
+- **Display a toast:** Notify the user when a geofencing event has occurred in the background.
+- **Refresh geofence binding:** Refresh the binding on resume and after removal of a geofence. Note that removal requires subscribing to removal events if a geofence is set as single use or a duration is set.
- **Request access to the user's location:** Request access to the user's location using the RequestAccessAsync method. Important: call the RequestAccessAsync before accessing the user's location. At that time, your app must be in the foreground and RequestAccessAsync must be called from the UI thread. Until the user grants your app permission to their location, your app can't access location data.
-- **Track when the user visits a location:** Poll for or receive notifications when the user spends significant time in a location.
+- **Track when the user visits a location:** Poll for or receive notifications when the user spends significant time in a location.
- **Help the user change location settings:** Link to location privacy settings from your app if the user revokes access to location while your app is in the foreground. Call the LaunchUriAsync method with the URI "ms-settings://privacy/location".
-Geofences need to be created in the Foreground Geofencing scenario (Scenario 4) and then you can go to Background Geofencing scenario (Scenario 5) to register for background geofencing events.
+Geofences need to be created in the foreground geofencing scenario (Scenario 4) and then you can go to background geofencing scenario (Scenario 5) to register for background geofencing events.
-The Geolocation sample formats and parses time and dates in the en-US locale using the Gregorian calendar and 24-hour clock. To help other locales in entering data the edit fields have a format example shown below the control. For example, Start Time would be entered mm/dd/yyyy hh:mm:ss format. February 2, 2014 at 10:34 pm would be written 2/2/2014 22:34:00. For the Dwell Time and Duration the format is dd:hh:mm:ss so a time span of 7 days, 23 hours, 45 minutes and 55 seconds would be written as 7:23:45:55.
+The Geolocation sample formats and parses time and dates in the en-US locale using the Gregorian calendar and 24-hour clock. To help other locales in entering data the edit fields have a format example shown below the control. For example, Start Time would be entered mm/dd/yyyy hh:mm:ss format. February 2, 2014 at 10:34 pm would be written 2/2/2014 22:34:00. For the Dwell Time and Duration the format is dd:hh:mm:ss so a time span of 7 days, 23 hours, 45 minutes and 55 seconds would be written as 7:23:45:55.
-### Declaring the Location capability
+## Declaring the Location capability
This sample requires that location capability be set in the *Package.appxmanifest* file to allow the app to access location at runtime. The capability can be set in the app manifest using Microsoft Visual Studio.
-
## Related topics
### Conceptual
-* [Get current location](https://msdn.microsoft.com/library/windows/apps/mt219698)
-* [Guidelines for location-aware apps](https://msdn.microsoft.com/library/windows/apps/hh465148)
+- [Get current location](https://msdn.microsoft.com/library/windows/apps/mt219698)
+- [Guidelines for location-aware apps](https://msdn.microsoft.com/library/windows/apps/hh465148)
### Reference
-* [Windows.Devices.Geolocation](http://msdn.microsoft.com/library/windows/apps/br225603)
-* [Windows.Devices.Geolocation.Geofencing](https://msdn.microsoft.com/library/windows/apps/dn263744)
+- [Windows.Devices.Geolocation](http://msdn.microsoft.com/library/windows/apps/br225603)
+- [Windows.Devices.Geolocation.Geofencing](https://msdn.microsoft.com/library/windows/apps/dn263744)
### Related samples
-* [Traffic App sample](https://github.com/microsoft/windows-appsample-trafficapp/)
-* [Lunch Scheduler app sample](https://github.com/Microsoft/Windows-appsample-lunch-scheduler)
-* [Geolocation sample](/archived/Geolocation/) for C++/CX and JavaScript (archived)
+- [Traffic App sample](https://github.com/microsoft/windows-appsample-trafficapp/)
+- [Lunch Scheduler app sample](https://github.com/Microsoft/Windows-appsample-lunch-scheduler)
## System requirements
-* Windows 10
+- Requires Windows SDK 10.0.22621.0 to build and Windows 10 to run.
## Build the sample
-1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build.
+1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build.
2. Start Microsoft Visual Studio and select **File** \> **Open** \> **Project/Solution**.
3. Starting in the folder where you unzipped the samples, go to the Samples subfolder, then the subfolder for this specific sample, then the subfolder for your preferred language (C++, C#, or JavaScript). Double-click the Visual Studio Solution (.sln) file.
4. Press Ctrl+Shift+B, or select **Build** \> **Build Solution**.
@@ -99,8 +97,8 @@ The next steps depend on whether you just want to deploy the sample or you want
### Deploying the sample
-- Select Build > Deploy Solution.
+- Select Build > Deploy Solution.
### Deploying and running the sample
-- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging.
+- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging.
diff --git a/Samples/Geolocation/cppwinrt/Scenario1_TrackPosition.cpp b/Samples/Geolocation/cppwinrt/Scenario1_TrackPosition.cpp
index 1952d3f4e0..e746be2474 100644
--- a/Samples/Geolocation/cppwinrt/Scenario1_TrackPosition.cpp
+++ b/Samples/Geolocation/cppwinrt/Scenario1_TrackPosition.cpp
@@ -12,6 +12,7 @@
#include "pch.h"
#include "Scenario1_TrackPosition.h"
#include "Scenario1_TrackPosition.g.cpp"
+#include "SampleConfiguration.h"
using namespace winrt;
using namespace winrt::Windows::Devices::Geolocation;
@@ -173,6 +174,7 @@ namespace winrt::SDKTemplate::implementation
ScenarioOutput_Latitude().Text(L"No data");
ScenarioOutput_Longitude().Text(L"No data");
ScenarioOutput_Accuracy().Text(L"No data");
+ ScenarioOutput_Source().Text(L"No data");
ScenarioOutput_IsRemoteSource().Text(L"No data");
}
else
@@ -180,6 +182,7 @@ namespace winrt::SDKTemplate::implementation
ScenarioOutput_Latitude().Text(to_hstring(position.Coordinate().Point().Position().Latitude));
ScenarioOutput_Longitude().Text(to_hstring(position.Coordinate().Point().Position().Longitude));
ScenarioOutput_Accuracy().Text(to_hstring(position.Coordinate().Accuracy()));
+ ScenarioOutput_Source().Text(to_hstring(position.Coordinate().PositionSource()));
ScenarioOutput_IsRemoteSource().Text(to_hstring(position.Coordinate().IsRemoteSource()));
}
}
diff --git a/Samples/Geolocation/cs/Geolocation.csproj b/Samples/Geolocation/cs/Geolocation.csproj
index f147accdf6..f6527d208a 100644
--- a/Samples/Geolocation/cs/Geolocation.csproj
+++ b/Samples/Geolocation/cs/Geolocation.csproj
@@ -21,6 +21,30 @@
512{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+
+ true
+ bin\ARM64\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP
+ ;2008
+ true
+ full
+ ARM64
+ false
+ 7.3
+ prompt
+
+
+ bin\ARM64\Release\
+ TRACE;NETFX_CORE;WINDOWS_UAP
+ true
+ ;2008
+ true
+ pdbonly
+ ARM64
+ false
+ 7.3
+ prompt
+ truebin\ARM\Debug\
@@ -53,7 +77,6 @@
x64falseprompt
- truebin\x64\Release\
@@ -64,7 +87,6 @@
x64falseprompt
- truetrue
@@ -194,6 +216,9 @@
Assets\smallTile-sdk.png
+
+ Assets\badge-logo.png
+
Assets\splash-sdk.png
@@ -218,12 +243,7 @@
- 5.0.0
-
-
-
-
- 5.0.0
+ 6.2.14
@@ -237,4 +257,4 @@
-->
-
\ No newline at end of file
+
diff --git a/Samples/Geolocation/cs/Geolocation.sln b/Samples/Geolocation/cs/Geolocation.sln
index 13246d85ab..89dae9f383 100644
--- a/Samples/Geolocation/cs/Geolocation.sln
+++ b/Samples/Geolocation/cs/Geolocation.sln
@@ -10,9 +10,11 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
+ Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
+ Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
@@ -20,6 +22,9 @@ Global
{C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Debug|ARM.ActiveCfg = Debug|ARM
{C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Debug|ARM.Build.0 = Debug|ARM
{C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Debug|ARM.Deploy.0 = Debug|ARM
+ {C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Debug|ARM64.Build.0 = Debug|ARM64
+ {C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Debug|ARM64.Deploy.0 = Debug|ARM64
{C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Debug|x64.ActiveCfg = Debug|x64
{C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Debug|x64.Build.0 = Debug|x64
{C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Debug|x64.Deploy.0 = Debug|x64
@@ -29,6 +34,9 @@ Global
{C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Release|ARM.ActiveCfg = Release|ARM
{C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Release|ARM.Build.0 = Release|ARM
{C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Release|ARM.Deploy.0 = Release|ARM
+ {C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Release|ARM64.ActiveCfg = Release|ARM64
+ {C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Release|ARM64.Build.0 = Release|ARM64
+ {C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Release|ARM64.Deploy.0 = Release|ARM64
{C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Release|x64.ActiveCfg = Release|x64
{C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Release|x64.Build.0 = Release|x64
{C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Release|x64.Deploy.0 = Release|x64
@@ -37,12 +45,16 @@ Global
{C214806D-57CA-5528-89FA-B9A7DEB22DFF}.Release|x86.Deploy.0 = Release|x86
{5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Debug|ARM.ActiveCfg = Debug|ARM
{5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Debug|ARM.Build.0 = Debug|ARM
+ {5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Debug|ARM64.Build.0 = Debug|ARM64
{5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Debug|x64.ActiveCfg = Debug|x64
{5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Debug|x64.Build.0 = Debug|x64
{5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Debug|x86.ActiveCfg = Debug|x86
{5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Debug|x86.Build.0 = Debug|x86
{5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Release|ARM.ActiveCfg = Release|ARM
{5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Release|ARM.Build.0 = Release|ARM
+ {5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Release|ARM64.ActiveCfg = Release|ARM64
+ {5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Release|ARM64.Build.0 = Release|ARM64
{5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Release|x64.ActiveCfg = Release|x64
{5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Release|x64.Build.0 = Release|x64
{5A7BDE18-030E-5DC9-B9A2-70EA568A6E9D}.Release|x86.ActiveCfg = Release|x86
diff --git a/Samples/Geolocation/cs/Package.appxmanifest b/Samples/Geolocation/cs/Package.appxmanifest
index 6254040535..736559af06 100644
--- a/Samples/Geolocation/cs/Package.appxmanifest
+++ b/Samples/Geolocation/cs/Package.appxmanifest
@@ -17,7 +17,7 @@
-
+
@@ -41,4 +41,4 @@
-
\ No newline at end of file
+
diff --git a/Samples/Geolocation/cs/Scenario1_TrackPosition.xaml.cs b/Samples/Geolocation/cs/Scenario1_TrackPosition.xaml.cs
index 490f59ef63..66258049ad 100644
--- a/Samples/Geolocation/cs/Scenario1_TrackPosition.xaml.cs
+++ b/Samples/Geolocation/cs/Scenario1_TrackPosition.xaml.cs
@@ -197,6 +197,7 @@ private void UpdateLocationData(Geoposition position)
ScenarioOutput_Latitude.Text = "No data";
ScenarioOutput_Longitude.Text = "No data";
ScenarioOutput_Accuracy.Text = "No data";
+ ScenarioOutput_Source.Text = "No data";
ScenarioOutput_IsRemoteSource.Text = "No data";
}
else
@@ -204,6 +205,7 @@ private void UpdateLocationData(Geoposition position)
ScenarioOutput_Latitude.Text = position.Coordinate.Point.Position.Latitude.ToString();
ScenarioOutput_Longitude.Text = position.Coordinate.Point.Position.Longitude.ToString();
ScenarioOutput_Accuracy.Text = position.Coordinate.Accuracy.ToString();
+ ScenarioOutput_Source.Text = position.Coordinate.PositionSource.ToString();
ScenarioOutput_IsRemoteSource.Text = position.Coordinate.IsRemoteSource.ToString();
}
}
diff --git a/Samples/Geolocation/cs/Tasks/Tasks.csproj b/Samples/Geolocation/cs/Tasks/Tasks.csproj
index 121251f654..3504250f19 100644
--- a/Samples/Geolocation/cs/Tasks/Tasks.csproj
+++ b/Samples/Geolocation/cs/Tasks/Tasks.csproj
@@ -21,6 +21,30 @@
512{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+
+ true
+ bin\ARM64\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP
+ ;2008
+ true
+ full
+ ARM64
+ false
+ 7.3
+ prompt
+
+
+ bin\ARM64\Release\
+ TRACE;NETFX_CORE;WINDOWS_UAP
+ true
+ ;2008
+ true
+ pdbonly
+ ARM64
+ false
+ 7.3
+ prompt
+ ARMtrue
@@ -56,7 +80,6 @@
x64falseprompt
- truex64
@@ -68,7 +91,6 @@
x64falseprompt
- truetrue
@@ -108,7 +130,7 @@
- 5.0.0
+ 6.2.14
@@ -122,4 +144,4 @@
-->
-
\ No newline at end of file
+
diff --git a/Samples/Geolocation/shared/Scenario1_TrackPosition.xaml b/Samples/Geolocation/shared/Scenario1_TrackPosition.xaml
index 25ed9d66b0..08cbcea613 100644
--- a/Samples/Geolocation/shared/Scenario1_TrackPosition.xaml
+++ b/Samples/Geolocation/shared/Scenario1_TrackPosition.xaml
@@ -36,17 +36,20 @@
+
-
+
+
-
+
+
Application is not able to get location data. Go to
diff --git a/Samples/NetworkConnectivity/README.md b/Samples/NetworkConnectivity/README.md
index 1de9d8508c..9e0e4f44fe 100644
--- a/Samples/NetworkConnectivity/README.md
+++ b/Samples/NetworkConnectivity/README.md
@@ -2,7 +2,6 @@
page_type: sample
languages:
- csharp
-- cpp
- cppwinrt
products:
- windows
@@ -33,28 +32,27 @@ This sample also demonstrates how to register for network connectivity change ev
Apps can subscribe to the events instead of building their
own logic to track network connectivity changes.
-> **Note:** This sample is part of a large collection of UWP feature samples.
+> **Note:** This sample is part of a large collection of UWP feature samples.
> You can download this sample as a standalone ZIP file
> [from docs.microsoft.com](https://docs.microsoft.com/samples/microsoft/windows-universal-samples/networkingconnectivity/),
> or you can download the entire collection as a single
-> [ZIP file](https://github.com/Microsoft/Windows-universal-samples/archive/main.zip), but be
-> sure to unzip everything to access shared dependencies. For more info on working with the ZIP file,
-> the samples collection, and GitHub, see [Get the UWP samples from GitHub](https://aka.ms/ovu2uq).
-> For more samples, see the [Samples portal](https://aka.ms/winsamples) on the Windows Dev Center.
+> [ZIP file](https://github.com/Microsoft/Windows-universal-samples/archive/main.zip), but be
+> sure to unzip everything to access shared dependencies. For more info on working with the ZIP file,
+> the samples collection, and GitHub, see [Get the UWP samples from GitHub](https://aka.ms/ovu2uq).
+> For more samples, see the [Samples portal](https://aka.ms/winsamples) on the Windows Dev Center.
-
-### Declaring the internetClient capability
+## Declaring the internetClient capability
This sample requires that internetClient capability be set in the *Package.appxmanifest* file to allow the app to access the Internet connection at runtime.
The capability can be set in the app manifest using Microsoft Visual Studio.
## System requirements
-* Windows 10
+- Requires Windows SDK 10.0.22621.0 to build and Windows 10 to run.
## Build the sample
-1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build.
+1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build.
2. Start Microsoft Visual Studio and select **File** \> **Open** \> **Project/Solution**.
3. Starting in the folder where you unzipped the samples, go to the Samples subfolder, then the subfolder for this specific sample, then the subfolder for your preferred language (C++, C#, or JavaScript). Double-click the Visual Studio Solution (.sln) file.
4. Press Ctrl+Shift+B or select **Build** \> **Build Solution**.
@@ -65,8 +63,8 @@ The next steps depend on whether you just want to deploy the sample or you want
### Deploying the sample
-- Select Build > Deploy Solution.
+- Select Build > Deploy Solution.
### Debugging and running the sample
-- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or select Debug > Start Without Debugging.
+- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or select Debug > Start Without Debugging.
diff --git a/Samples/NetworkConnectivity/cs/NetworkConnectivity.csproj b/Samples/NetworkConnectivity/cs/NetworkConnectivity.csproj
index c4b914af94..0a5c17847c 100644
--- a/Samples/NetworkConnectivity/cs/NetworkConnectivity.csproj
+++ b/Samples/NetworkConnectivity/cs/NetworkConnectivity.csproj
@@ -37,7 +37,7 @@
bin\ARM64\Release\
- TRACE;NETFX_CORE;WINDOWS_UAP;CODE_ANALYSIS
+ TRACE;NETFX_CORE;WINDOWS_UAPtrue;2008true
@@ -185,7 +185,7 @@
- 5.0.0
+ 6.2.14
@@ -199,4 +199,4 @@
-->
-
\ No newline at end of file
+
diff --git a/archived/CallerID/README.md b/Samples/PersonalDataEncryption/README.md
similarity index 56%
rename from archived/CallerID/README.md
rename to Samples/PersonalDataEncryption/README.md
index ff4eb78659..7a50030df5 100644
--- a/archived/CallerID/README.md
+++ b/Samples/PersonalDataEncryption/README.md
@@ -1,65 +1,62 @@
---
-topic: sample
+page_type: sample
languages:
- csharp
+- cplusplus
+- cppwinrt
products:
- windows
- windows-uwp
-urlFragment: CallerID
+urlFragment: PersonalDataEncryption
extendedZipContent:
- path: SharedContent
target: SharedContent
- path: LICENSE
target: LICENSE
-description: "Shows how to set Call Origin information for an unrecognized incoming call."
+description: "Demonstrates the usage of Personal Data Encryption (Windows Data Protection)."
---
-
+# Personal Data Encryption sample
-# Caller ID sample
-
-Shows how to set Call Origin information for an unrecognized incoming call.
+Shows how to use [Personal Data Encryption](https://learn.microsoft.com/windows/security/operating-system-security/data-protection/personal-data-encryption/)
+for protecting user files and memory buffers.
> **Note:** This sample is part of a large collection of UWP feature samples.
> You can download this sample as a standalone ZIP file
-> [from docs.microsoft.com](https://docs.microsoft.com/samples/microsoft/windows-universal-samples/callerid/),
+> [from docs.microsoft.com](https://docs.microsoft.com/samples/microsoft/windows-universal-samples/resizeappview/),
> or you can download the entire collection as a single
> [ZIP file](https://github.com/Microsoft/Windows-universal-samples/archive/master.zip), but be
> sure to unzip everything to access shared dependencies. For more info on working with the ZIP file,
> the samples collection, and GitHub, see [Get the UWP samples from GitHub](https://aka.ms/ovu2uq).
> For more samples, see the [Samples portal](https://aka.ms/winsamples) on the Windows Dev Center.
-Specifically, this sample shows how to:
-- Register a Caller ID background task to be triggered when an unrecognized incoming call arrives.
- The task sets the call location, category, category description, and display name of the call.
-- Display the system UI to let the user choose the active Caller ID app.
-- Determine whether the app is the the active Caller ID app.
+Personal Data Encryption can protect data either while a user is signed ("Level 1" or "L1") out or while a system is locked ("Level 2" or "L2").
-See the Package.appxmanifest file for the extensions and capabilities a Caller ID app must declare.
+The sample shows the following:
-**Note** The Windows universal samples require Visual Studio to build and Windows 10 to execute.
+- Marking a folder so that all new files are protected at a particular level, or removing protection.
+- Protecting a file at a particular level, or removing protection.
+- Protecting a memory buffer at a particular level, or removing protection.
-To obtain information about Windows 10 development, go to the [Windows Dev Center](http://go.microsoft.com/fwlink/?LinkID=532421)
+**Note** The Windows universal samples require Visual Studio to build and Windows 11 to execute.
+
+To obtain information about Windows development, go to the [Windows Dev Center](http://go.microsoft.com/fwlink/?LinkID=532421)
To obtain information about Microsoft Visual Studio and the tools for developing Windows apps, go to [Visual Studio](http://go.microsoft.com/fwlink/?LinkID=532422)
+## Related topics
+
### Reference
-[Windows.ApplicationModel.Calls.Provider namespace](https://msdn.microsoft.com/library/windows/apps/windows.applicationmodel.calls.provider.aspx)
+[UserDataProtectionManager class](https://learn.microsoft.com/en-us/uwp/api/windows.security.dataprotection.userdataprotectionmanager)
-[PhoneCallOriginManager class](https://msdn.microsoft.com/library/windows/apps/windows.applicationmodel.calls.provider.phonecalloriginmanager.aspx)
+### Related samples
-[PhoneCallOrigin class](https://msdn.microsoft.com/library/windows/apps/windows.applicationmodel.calls.provider.phonecallorigin.aspx)
+* [EnterpriseDataProtection](/Samples/EnterpriseDataProtection)
## System requirements
-**Client:** Not Supported
-
-**Server:** Not Supported
-
-**Phone:** Windows 10
+* Windows 11 version 22H2 or higher
## Build the sample
@@ -78,4 +75,5 @@ The next steps depend on whether you just want to deploy the sample or you want
### Deploying and running the sample
-- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging.
+- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or select Debug > Start Without Debugging.
+- In order for the sample to exercise Personal Data Encryption, [it must be configured](https://learn.microsoft.com/windows/security/operating-system-security/data-protection/personal-data-encryption/configure).
diff --git a/Samples/PersonalDataEncryption/cppwinrt/Package.appxmanifest b/Samples/PersonalDataEncryption/cppwinrt/Package.appxmanifest
new file mode 100644
index 0000000000..4ecd12324e
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cppwinrt/Package.appxmanifest
@@ -0,0 +1,39 @@
+
+
+
+
+
+ Personal Data Encryption C++/WinRT Sample
+ Microsoft Corporation
+ Assets\storelogo-sdk.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/PersonalDataEncryption/cppwinrt/PersonalDataEncryption.sln b/Samples/PersonalDataEncryption/cppwinrt/PersonalDataEncryption.sln
new file mode 100644
index 0000000000..b47cbde1f4
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cppwinrt/PersonalDataEncryption.sln
@@ -0,0 +1,40 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.27004.2006
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PersonalDataEncryption", "PersonalDataEncryption.vcxproj", "{3180E6C1-8D0E-4120-B794-AEFF6D6055B9}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM = Debug|ARM
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Debug|ARM = Debug|ARM
+ Release|ARM = Release|ARM
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Debug|ARM.ActiveCfg = Debug|ARM
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Debug|ARM.Build.0 = Debug|ARM
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Debug|ARM.Deploy.0 = Debug|ARM
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Debug|x64.ActiveCfg = Debug|x64
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Debug|x64.Build.0 = Debug|x64
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Debug|x64.Deploy.0 = Debug|x64
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Debug|x86.ActiveCfg = Debug|Win32
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Debug|x86.Build.0 = Debug|Win32
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Debug|x86.Deploy.0 = Debug|Win32
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Release|ARM.ActiveCfg = Release|ARM
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Release|ARM.Build.0 = Release|ARM
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Release|ARM.Deploy.0 = Release|ARM
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Release|x64.ActiveCfg = Release|x64
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Release|x64.Build.0 = Release|x64
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Release|x64.Deploy.0 = Release|x64
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Release|x86.ActiveCfg = Release|Win32
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Release|x86.Build.0 = Release|Win32
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}.Release|x86.Deploy.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Samples/PersonalDataEncryption/cppwinrt/PersonalDataEncryption.vcxproj b/Samples/PersonalDataEncryption/cppwinrt/PersonalDataEncryption.vcxproj
new file mode 100644
index 0000000000..8e1a218fef
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cppwinrt/PersonalDataEncryption.vcxproj
@@ -0,0 +1,188 @@
+
+
+
+
+ $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), LICENSE))\SharedContent
+
+
+ true
+ true
+ {3180E6C1-8D0E-4120-B794-AEFF6D6055B9}
+ PersonalDataEncryption
+ SDKTemplate
+ en-US
+ 15.0
+ true
+ Windows Store
+ 10.0
+ 10.0.22000.0
+ $(WindowsTargetPlatformVersion)
+
+
+
+
+ Debug
+ ARM
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ ARM
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+ Application
+ Unicode
+
+
+ true
+ true
+
+
+ false
+ true
+ false
+
+
+
+
+
+
+
+ $(VC_IncludePath);$(UniversalCRT_IncludePath);$(WindowsSDK_IncludePath);$(SharedContentDir)\cppwinrt
+ true
+
+
+
+ Use
+ pch.h
+ $(IntDir)pch.pch
+ Level4
+ %(AdditionalOptions) /bigobj
+ 4453;28204
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+
+
+
+
+ $(SharedContentDir)\xaml\App.xaml
+
+
+ $(SharedContentDir)\xaml\MainPage.xaml
+
+
+
+ ..\shared\Scenario1_Files.xaml
+
+
+ ..\shared\Scenario2_Memory.xaml
+
+
+
+
+
+ Designer
+
+
+ Designer
+
+
+
+
+ Styles\Styles.xaml
+
+
+
+
+ $(SharedContentDir)\xaml\App.xaml
+
+
+ $(SharedContentDir)\xaml\MainPage.xaml
+
+
+
+ ..\shared\Scenario1_Files.xaml
+
+
+ ..\shared\Scenario2_Memory.xaml
+
+
+ Create
+
+
+ Project.idl
+
+
+
+
+ $(SharedContentDir)\xaml\MainPage.xaml
+
+
+
+
+
+ Designer
+
+
+
+
+ Assets\microsoft-sdk.png
+
+
+ Assets\smallTile-sdk.png
+
+
+ Assets\splash-sdk.png
+
+
+ Assets\squareTile-sdk.png
+
+
+ Assets\storeLogo-sdk.png
+
+
+ Assets\tile-sdk.png
+
+
+ Assets\windows-sdk.png
+
+
+
+
+
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
\ No newline at end of file
diff --git a/archived/RadioManager/cpp/RadioManager.vcxproj.filters b/Samples/PersonalDataEncryption/cppwinrt/PersonalDataEncryption.vcxproj.filters
similarity index 55%
rename from archived/RadioManager/cpp/RadioManager.vcxproj.filters
rename to Samples/PersonalDataEncryption/cppwinrt/PersonalDataEncryption.vcxproj.filters
index 0e55041794..98996670ea 100644
--- a/archived/RadioManager/cpp/RadioManager.vcxproj.filters
+++ b/Samples/PersonalDataEncryption/cppwinrt/PersonalDataEncryption.vcxproj.filters
@@ -1,47 +1,41 @@
-
+
- 80bfd669-aa83-4537-9611-027cffe0d8af
+ 4416d50a-7676-4d0a-9b2c-91ff70c6047fbmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png
-
- {c6978fb6-bc64-498d-97c8-f5b53997e54e}
-
-
+
+
+
+
+
+
+
+
-
-
+
+
+
-
-
-
-
+
+
-
-
+
+
-
-
-
-
+
+
-
-
-
- Styles
-
-
- Assets
@@ -65,4 +59,10 @@
Assets
+
+
+
+
+
+
\ No newline at end of file
diff --git a/archived/RadioManager/cpp/SampleConfiguration.cpp b/Samples/PersonalDataEncryption/cppwinrt/Project.idl
similarity index 61%
rename from archived/RadioManager/cpp/SampleConfiguration.cpp
rename to Samples/PersonalDataEncryption/cppwinrt/Project.idl
index a32329ab52..f8ac2d3410 100644
--- a/archived/RadioManager/cpp/SampleConfiguration.cpp
+++ b/Samples/PersonalDataEncryption/cppwinrt/Project.idl
@@ -9,13 +9,17 @@
//
//*********************************************************
-#include "pch.h"
-#include "MainPage.xaml.h"
-#include "SampleConfiguration.h"
-
-using namespace SDKTemplate;
-
-Platform::Array^ MainPage::scenariosInner = ref new Platform::Array
+namespace SDKTemplate
{
- { "Toggle Radios", "SDKTemplate.Scenario1_ToggleRadios" }
-};
+ [default_interface]
+ runtimeclass Scenario1_Files : Windows.UI.Xaml.Controls.Page
+ {
+ Scenario1_Files();
+ }
+
+ [default_interface]
+ runtimeclass Scenario2_Memory : Windows.UI.Xaml.Controls.Page
+ {
+ Scenario2_Memory();
+ }
+}
diff --git a/Samples/PersonalDataEncryption/cppwinrt/SampleConfiguration.cpp b/Samples/PersonalDataEncryption/cppwinrt/SampleConfiguration.cpp
new file mode 100644
index 0000000000..7c2c8bd42a
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cppwinrt/SampleConfiguration.cpp
@@ -0,0 +1,30 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
+// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
+// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
+// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
+//
+//*********************************************************
+
+#include "pch.h"
+#include
+#include "MainPage.h"
+#include "SampleConfiguration.h"
+
+using namespace winrt;
+using namespace Windows::Foundation::Collections;
+using namespace SDKTemplate;
+
+hstring implementation::MainPage::FEATURE_NAME()
+{
+ return L"Personal Data Encryption";
+}
+
+IVector implementation::MainPage::scenariosInner = winrt::single_threaded_observable_vector(
+{
+ Scenario{ L"Files and folders", xaml_typename() },
+ Scenario{ L"Memory", xaml_typename() },
+});
diff --git a/archived/RadioManager/cpp/pch.cpp b/Samples/PersonalDataEncryption/cppwinrt/SampleConfiguration.h
similarity index 86%
rename from archived/RadioManager/cpp/pch.cpp
rename to Samples/PersonalDataEncryption/cppwinrt/SampleConfiguration.h
index e5b0b06e30..ba0eb7c8c2 100644
--- a/archived/RadioManager/cpp/pch.cpp
+++ b/Samples/PersonalDataEncryption/cppwinrt/SampleConfiguration.h
@@ -9,8 +9,9 @@
//
//*********************************************************
-//
-// Include the standard header and generate the precompiled header.
-//
-
+#pragma once
#include "pch.h"
+
+namespace winrt::SDKTemplate
+{
+}
diff --git a/Samples/PersonalDataEncryption/cppwinrt/Scenario1_Files.cpp b/Samples/PersonalDataEncryption/cppwinrt/Scenario1_Files.cpp
new file mode 100644
index 0000000000..e27133a86f
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cppwinrt/Scenario1_Files.cpp
@@ -0,0 +1,116 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
+// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
+// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
+// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
+//
+//*********************************************************
+
+#include "pch.h"
+#include "Scenario1_Files.h"
+#include "Scenario1_Files.g.cpp"
+
+using namespace winrt::Windows::Foundation;
+using namespace winrt::Windows::Security::DataProtection;
+using namespace winrt::Windows::Storage;
+using namespace winrt::Windows::Storage::Pickers;
+using namespace winrt::Windows::UI::Xaml;
+using namespace winrt::Windows::UI::Xaml::Navigation;
+
+namespace winrt::SDKTemplate::implementation
+{
+ Scenario1_Files::Scenario1_Files()
+ {
+ InitializeComponent();
+ }
+
+ void Scenario1_Files::OnNavigatedTo(NavigationEventArgs const&)
+ {
+ userDataProtectionManager = UserDataProtectionManager::TryGetDefault();
+ if (userDataProtectionManager)
+ {
+ AvailablePanel().Visibility(Visibility::Visible);
+ UnavailablePanel().Visibility(Visibility::Collapsed);
+ }
+ else
+ {
+ AvailablePanel().Visibility(Visibility::Collapsed);
+ UnavailablePanel().Visibility(Visibility::Visible);
+ }
+ }
+
+ fire_and_forget Scenario1_Files::ChooseFile_Click(IInspectable const&, RoutedEventArgs const&)
+ {
+ auto lifetime = get_strong();
+ FileOpenPicker picker;
+ picker.FileTypeFilter().Append(L"*");
+ UpdateItem(co_await picker.PickSingleFileAsync());
+ }
+
+ fire_and_forget Scenario1_Files::ChooseFolder_Click(IInspectable const&, RoutedEventArgs const&)
+ {
+ auto lifetime = get_strong();
+ FolderPicker picker;
+ UpdateItem(co_await picker.PickSingleFolderAsync());
+ }
+
+ void Scenario1_Files::UpdateItem(IStorageItem const& item)
+ {
+ selectedItem = item;
+ if (selectedItem != nullptr)
+ {
+ ItemOperationsPanel().Visibility(Visibility::Visible);
+ ItemNameBlock().Text(item.Path());
+ }
+ else
+ {
+ ItemOperationsPanel().Visibility(Visibility::Collapsed);
+ }
+ }
+
+ fire_and_forget Scenario1_Files::ProtectL1_Click(IInspectable const&, RoutedEventArgs const&)
+ {
+ auto lifetime = get_strong();
+ UserDataStorageItemProtectionStatus status = co_await userDataProtectionManager.ProtectStorageItemAsync(selectedItem, UserDataAvailability::AfterFirstUnlock);
+ ReportStatus(L"Protect L1", status);
+ }
+
+ fire_and_forget Scenario1_Files::ProtectL2_Click(IInspectable const&, RoutedEventArgs const&)
+ {
+ auto lifetime = get_strong();
+ UserDataStorageItemProtectionStatus status = co_await userDataProtectionManager.ProtectStorageItemAsync(selectedItem, UserDataAvailability::WhileUnlocked);
+ ReportStatus(L"Protect L2", status);
+ }
+
+ fire_and_forget Scenario1_Files::Unprotect_Click(IInspectable const&, RoutedEventArgs const&)
+ {
+ auto lifetime = get_strong();
+ UserDataStorageItemProtectionStatus status = co_await userDataProtectionManager.ProtectStorageItemAsync(selectedItem, UserDataAvailability::Always);
+ ReportStatus(L"Protect L2", status);
+ }
+
+ void Scenario1_Files::ReportStatus(hstring const& operation, UserDataStorageItemProtectionStatus status)
+ {
+ switch (status)
+ {
+ case UserDataStorageItemProtectionStatus::Succeeded:
+ rootPage.NotifyUser(operation + L" succeeded", NotifyType::StatusMessage);
+ break;
+
+ case UserDataStorageItemProtectionStatus::NotProtectable:
+ rootPage.NotifyUser(operation + L" failed: Not protectable", NotifyType::ErrorMessage);
+ break;
+
+ case UserDataStorageItemProtectionStatus::DataUnavailable:
+ rootPage.NotifyUser(operation + L" failed: Data unavailable", NotifyType::ErrorMessage);
+ break;
+
+ default:
+ rootPage.NotifyUser(operation + L" failed: Unknown failure", NotifyType::ErrorMessage);
+ break;
+ }
+ }
+}
diff --git a/Samples/PersonalDataEncryption/cppwinrt/Scenario1_Files.h b/Samples/PersonalDataEncryption/cppwinrt/Scenario1_Files.h
new file mode 100644
index 0000000000..952fa745f2
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cppwinrt/Scenario1_Files.h
@@ -0,0 +1,47 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
+// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
+// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
+// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
+//
+//*********************************************************
+
+#pragma once
+
+#include "Scenario1_Files.g.h"
+#include "MainPage.h"
+
+namespace winrt::SDKTemplate::implementation
+{
+ struct Scenario1_Files : Scenario1_FilesT
+ {
+ Scenario1_Files();
+
+ void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
+
+ fire_and_forget ChooseFile_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
+ fire_and_forget ChooseFolder_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
+ fire_and_forget ProtectL1_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
+ fire_and_forget ProtectL2_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
+ fire_and_forget Unprotect_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
+
+ private:
+ SDKTemplate::MainPage rootPage{ MainPage::Current() };
+ winrt::Windows::Security::DataProtection::UserDataProtectionManager userDataProtectionManager{ nullptr };
+ winrt::Windows::Storage::IStorageItem selectedItem{ nullptr };
+
+ void UpdateItem(winrt::Windows::Storage::IStorageItem const& item);
+ void ReportStatus(winrt::hstring const& operation, winrt::Windows::Security::DataProtection::UserDataStorageItemProtectionStatus status);
+
+ };
+}
+
+namespace winrt::SDKTemplate::factory_implementation
+{
+ struct Scenario1_Files : Scenario1_FilesT
+ {
+ };
+}
diff --git a/Samples/PersonalDataEncryption/cppwinrt/Scenario2_Memory.cpp b/Samples/PersonalDataEncryption/cppwinrt/Scenario2_Memory.cpp
new file mode 100644
index 0000000000..3fc5124e98
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cppwinrt/Scenario2_Memory.cpp
@@ -0,0 +1,108 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
+// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
+// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
+// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
+//
+//*********************************************************
+
+#include "pch.h"
+#include "Scenario2_Memory.h"
+#include "Scenario2_Memory.g.cpp"
+
+using namespace winrt::Windows::Foundation;
+using namespace winrt::Windows::Security::Cryptography;
+using namespace winrt::Windows::Security::DataProtection;
+using namespace winrt::Windows::Storage::Streams;
+using namespace winrt::Windows::UI::Xaml;
+using namespace winrt::Windows::UI::Xaml::Navigation;
+
+namespace winrt::SDKTemplate::implementation
+{
+ Scenario2_Memory::Scenario2_Memory()
+ {
+ InitializeComponent();
+ }
+
+ void Scenario2_Memory::OnNavigatedTo(NavigationEventArgs const&)
+ {
+ userDataProtectionManager = UserDataProtectionManager::TryGetDefault();
+ if (userDataProtectionManager)
+ {
+ AvailablePanel().Visibility(Visibility::Visible);
+ UnavailablePanel().Visibility(Visibility::Collapsed);
+ }
+ else
+ {
+ AvailablePanel().Visibility(Visibility::Collapsed);
+ UnavailablePanel().Visibility(Visibility::Visible);
+ }
+ }
+
+ fire_and_forget Scenario2_Memory::ProtectL1_Click(IInspectable const&, RoutedEventArgs const&)
+ {
+ auto lifetime = get_strong();
+ hstring text = DataTextBox().Text();
+ if (text.empty())
+ {
+ // Cannot protect a zero-length buffer.
+ rootPage.NotifyUser(L"Please enter data to protect", NotifyType::ErrorMessage);
+ co_return;
+ }
+
+ IBuffer buffer = CryptographicBuffer::ConvertStringToBinary(text, BinaryStringEncoding::Utf8);
+
+ IBuffer result = co_await userDataProtectionManager.ProtectBufferAsync(buffer, UserDataAvailability::AfterFirstUnlock);
+ ReportProtectedBuffer(result);
+ }
+
+ fire_and_forget Scenario2_Memory::ProtectL2_Click(IInspectable const&, RoutedEventArgs const&)
+ {
+ auto lifetime = get_strong();
+ hstring text = DataTextBox().Text();
+ if (text.empty())
+ {
+ // Cannot protect a zero-length buffer.
+ rootPage.NotifyUser(L"Please enter data to protect", NotifyType::ErrorMessage);
+ co_return;
+ }
+
+ IBuffer buffer = CryptographicBuffer::ConvertStringToBinary(text, BinaryStringEncoding::Utf8);
+
+ IBuffer result = co_await userDataProtectionManager.ProtectBufferAsync(buffer, UserDataAvailability::WhileUnlocked);
+ ReportProtectedBuffer(result);
+ }
+
+ void Scenario2_Memory::ReportProtectedBuffer(IBuffer const& buffer)
+ {
+ protectedBuffer = buffer;
+ ProtectedDataTextBlock().Text(CryptographicBuffer::EncodeToHexString(buffer));
+ UnprotectPanel().Visibility(Visibility::Visible);
+ rootPage.NotifyUser(L"", NotifyType::StatusMessage);
+ }
+
+ fire_and_forget Scenario2_Memory::Unprotect_Click(IInspectable const&, RoutedEventArgs const&)
+ {
+ auto lifetime = get_strong();
+ UnprotectedDataTextBlock().Text(L"");
+ UserDataBufferUnprotectResult result = co_await userDataProtectionManager.UnprotectBufferAsync(protectedBuffer);
+ switch (result.Status())
+ {
+ case UserDataBufferUnprotectStatus::Succeeded:
+ rootPage.NotifyUser(L"Unprotected successfully", NotifyType::StatusMessage);
+ UnprotectedDataTextBlock().Text(CryptographicBuffer::ConvertBinaryToString(BinaryStringEncoding::Utf8, result.UnprotectedBuffer()));
+ break;
+
+ case UserDataBufferUnprotectStatus::Unavailable:
+ rootPage.NotifyUser(L"Unable to unprotect: Unavailable", NotifyType::ErrorMessage);
+ break;
+
+ default:
+ rootPage.NotifyUser(L"Unable to unprotect: Unknown error", NotifyType::ErrorMessage);
+ break;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/PersonalDataEncryption/cppwinrt/Scenario2_Memory.h b/Samples/PersonalDataEncryption/cppwinrt/Scenario2_Memory.h
new file mode 100644
index 0000000000..066676c623
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cppwinrt/Scenario2_Memory.h
@@ -0,0 +1,43 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
+// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
+// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
+// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
+//
+//*********************************************************
+
+#pragma once
+
+#include "Scenario2_Memory.g.h"
+#include "MainPage.h"
+
+namespace winrt::SDKTemplate::implementation
+{
+ struct Scenario2_Memory : Scenario2_MemoryT
+ {
+ Scenario2_Memory();
+
+ void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const& e);
+
+ fire_and_forget ProtectL1_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
+ fire_and_forget ProtectL2_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
+ fire_and_forget Unprotect_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
+
+ private:
+ SDKTemplate::MainPage rootPage{ MainPage::Current() };
+ winrt::Windows::Security::DataProtection::UserDataProtectionManager userDataProtectionManager{ nullptr };
+ winrt::Windows::Storage::Streams::IBuffer protectedBuffer{ nullptr };
+
+ void ReportProtectedBuffer(Windows::Storage::Streams::IBuffer const& buffer);
+ };
+}
+
+namespace winrt::SDKTemplate::factory_implementation
+{
+ struct Scenario2_Memory : Scenario2_MemoryT
+ {
+ };
+}
diff --git a/Samples/PersonalDataEncryption/cppwinrt/packages.config b/Samples/PersonalDataEncryption/cppwinrt/packages.config
new file mode 100644
index 0000000000..7a9561b2b5
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cppwinrt/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Samples/PersonalDataEncryption/cppwinrt/pch.cpp b/Samples/PersonalDataEncryption/cppwinrt/pch.cpp
new file mode 100644
index 0000000000..01484ff5aa
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cppwinrt/pch.cpp
@@ -0,0 +1,6 @@
+//
+// pch.cpp
+// Include the standard header and generate the precompiled header.
+//
+
+#include "pch.h"
diff --git a/Samples/PersonalDataEncryption/cppwinrt/pch.h b/Samples/PersonalDataEncryption/cppwinrt/pch.h
new file mode 100644
index 0000000000..351fe75257
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cppwinrt/pch.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include
+#include "winrt/Windows.Foundation.h"
+#include "winrt/Windows.Foundation.Collections.h"
+#include "winrt/Windows.ApplicationModel.Activation.h"
+#include "winrt/Windows.Security.Cryptography.h"
+#include "winrt/Windows.Security.DataProtection.h"
+#include "winrt/Windows.Storage.h"
+#include "winrt/Windows.Storage.Pickers.h"
+#include "winrt/Windows.Storage.Streams.h"
+#include "winrt/Windows.System.h"
+#include "winrt/Windows.UI.Core.h"
+#include "winrt/Windows.UI.Xaml.h"
+#include "winrt/Windows.UI.Xaml.Automation.Peers.h"
+#include "winrt/Windows.UI.Xaml.Controls.h"
+#include "winrt/Windows.UI.Xaml.Controls.Primitives.h"
+#include "winrt/Windows.UI.Xaml.Documents.h"
+#include "winrt/Windows.UI.Xaml.Interop.h"
+#include "winrt/Windows.UI.Xaml.Markup.h"
+#include "winrt/Windows.UI.Xaml.Media.h"
+#include "winrt/Windows.UI.Xaml.Navigation.h"
diff --git a/archived/RadioManager/cpp/Package.appxmanifest b/Samples/PersonalDataEncryption/cs/Package.appxmanifest
similarity index 63%
rename from archived/RadioManager/cpp/Package.appxmanifest
rename to Samples/PersonalDataEncryption/cs/Package.appxmanifest
index 725ef789e1..8459c8793a 100644
--- a/archived/RadioManager/cpp/Package.appxmanifest
+++ b/Samples/PersonalDataEncryption/cs/Package.appxmanifest
@@ -7,20 +7,21 @@
IgnorableNamespaces="uap mp">
-
+
+
- RadioManager C++ Sample
+ Personal Data Encryption C# SampleMicrosoft CorporationAssets\StoreLogo-sdk.png
-
+
@@ -28,17 +29,16 @@
-
+ EntryPoint="PersonalDataEncryption.App">
-
+ Square44x44Logo="Assets\SmallTile-sdk.png"
+ Description="PersonalDataEncryption C# sample"
+ BackgroundColor="#00b2f0">
+
@@ -47,8 +47,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/archived/CallerID/cs/CallerID.csproj b/Samples/PersonalDataEncryption/cs/PersonalDataEncryption.csproj
similarity index 85%
rename from archived/CallerID/cs/CallerID.csproj
rename to Samples/PersonalDataEncryption/cs/PersonalDataEncryption.csproj
index f61e83bf48..a7b37c93c2 100644
--- a/archived/CallerID/cs/CallerID.csproj
+++ b/Samples/PersonalDataEncryption/cs/PersonalDataEncryption.csproj
@@ -6,18 +6,16 @@
Debug
- x86
- {B2B78D7B-9604-5013-B7F1-ED35BE8D4C48}
+ {69AB702D-59CB-4062-B010-5BFA49237536}AppContainerExePropertiesSDKTemplate
- CallerID
+ PersonalDataEncryptionen-USUAP
- 10.0.18362.0
- 10.0.18362.0
+ 10.0.22000.0
+ 10.0.22000.014
- truetrue512{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
@@ -104,12 +102,10 @@
Properties\AssemblyInfo.cs
-
- Scenario2_SetDefault.xaml
-
-
- Scenario1_Register.xaml
+
+ Scenario1_Files.xaml
+
@@ -127,11 +123,13 @@
MSBuild:CompileDesigner
-
+
+ Scenario1_Files.xaml
MSBuild:CompileDesigner
-
+
+ Scenario2_Memory.xaml
MSBuild:CompileDesigner
@@ -167,20 +165,6 @@
Assets\windows-sdk.png
-
-
- {b866a3f0-0d25-4146-9855-2c13c424f319}
- Tasks
-
-
-
-
- Microsoft Visual C++ 2013 Runtime Package for Windows Universal
-
-
- Windows Mobile Extensions for the UWP
-
- 5.0.0
diff --git a/Samples/PersonalDataEncryption/cs/PersonalDataEncryption.sln b/Samples/PersonalDataEncryption/cs/PersonalDataEncryption.sln
new file mode 100644
index 0000000000..71b1dcdbdd
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cs/PersonalDataEncryption.sln
@@ -0,0 +1,40 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26228.4
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonalDataEncryption", "PersonalDataEncryption.csproj", "{69AB702D-59CB-4062-B010-5BFA49237536}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM = Debug|ARM
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|ARM = Release|ARM
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Debug|ARM.ActiveCfg = Debug|ARM
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Debug|ARM.Build.0 = Debug|ARM
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Debug|ARM.Deploy.0 = Debug|ARM
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Debug|x64.ActiveCfg = Debug|x64
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Debug|x64.Build.0 = Debug|x64
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Debug|x64.Deploy.0 = Debug|x64
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Debug|x86.ActiveCfg = Debug|x86
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Debug|x86.Build.0 = Debug|x86
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Debug|x86.Deploy.0 = Debug|x86
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Release|ARM.ActiveCfg = Release|ARM
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Release|ARM.Build.0 = Release|ARM
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Release|ARM.Deploy.0 = Release|ARM
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Release|x64.ActiveCfg = Release|x64
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Release|x64.Build.0 = Release|x64
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Release|x64.Deploy.0 = Release|x64
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Release|x86.ActiveCfg = Release|x86
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Release|x86.Build.0 = Release|x86
+ {69AB702D-59CB-4062-B010-5BFA49237536}.Release|x86.Deploy.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Samples/PersonalDataEncryption/cs/SampleConfiguration.cs b/Samples/PersonalDataEncryption/cs/SampleConfiguration.cs
new file mode 100644
index 0000000000..345ab714d8
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cs/SampleConfiguration.cs
@@ -0,0 +1,34 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
+// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
+// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
+// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
+//
+//*********************************************************
+
+using System;
+using System.Collections.Generic;
+using Windows.UI.Xaml.Controls;
+
+namespace SDKTemplate
+{
+ public partial class MainPage : Page
+ {
+ public const string FEATURE_NAME = "Personal Data Encryption";
+
+ List scenarios = new List
+ {
+ new Scenario() { Title="Files and folders", ClassType=typeof(Scenario1_Files)},
+ new Scenario() { Title="Memory", ClassType=typeof(Scenario2_Memory)},
+ };
+ }
+
+ public class Scenario
+ {
+ public string Title { get; set; }
+ public Type ClassType { get; set; }
+ }
+}
diff --git a/Samples/PersonalDataEncryption/cs/Scenario1_Files.xaml.cs b/Samples/PersonalDataEncryption/cs/Scenario1_Files.xaml.cs
new file mode 100644
index 0000000000..357b5906a5
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cs/Scenario1_Files.xaml.cs
@@ -0,0 +1,116 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
+// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
+// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
+// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
+//
+//*********************************************************
+
+using System;
+using Windows.Security.DataProtection;
+using Windows.Storage;
+using Windows.Storage.Pickers;
+using Windows.System.Update;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Navigation;
+
+namespace SDKTemplate
+{
+ public sealed partial class Scenario1_Files : Page
+ {
+ private MainPage rootPage = MainPage.Current;
+ UserDataProtectionManager userDataProtectionManager = null;
+ IStorageItem selectedItem = null;
+
+ public Scenario1_Files()
+ {
+ this.InitializeComponent();
+ }
+
+ protected override void OnNavigatedTo(NavigationEventArgs e)
+ {
+ userDataProtectionManager = UserDataProtectionManager.TryGetDefault();
+ if (userDataProtectionManager != null)
+ {
+ AvailablePanel.Visibility = Visibility.Visible;
+ UnavailablePanel.Visibility = Visibility.Collapsed;
+ }
+ else
+ {
+ AvailablePanel.Visibility = Visibility.Collapsed;
+ UnavailablePanel.Visibility = Visibility.Visible;
+ }
+ }
+
+ private async void ChooseFile_Click(object sender, RoutedEventArgs e)
+ {
+ var picker = new FileOpenPicker();
+ picker.FileTypeFilter.Add("*");
+ UpdateItem(await picker.PickSingleFileAsync());
+ }
+
+ private async void ChooseFolder_Click(object sender, RoutedEventArgs e)
+ {
+ var picker = new FolderPicker();
+ UpdateItem(await picker.PickSingleFolderAsync());
+ }
+
+ private void UpdateItem(IStorageItem item)
+ {
+ selectedItem = item;
+ if (selectedItem != null)
+ {
+ ItemOperationsPanel.Visibility = Visibility.Visible;
+ ItemNameBlock.Text = item.Path;
+ }
+ else
+ {
+ ItemOperationsPanel.Visibility = Visibility.Collapsed;
+ }
+ }
+
+ private async void ProtectL1_Click(object sender, RoutedEventArgs e)
+ {
+ UserDataStorageItemProtectionStatus status = await userDataProtectionManager.ProtectStorageItemAsync(selectedItem, UserDataAvailability.AfterFirstUnlock);
+ ReportStatus("Protect L1", status);
+ }
+
+ private async void ProtectL2_Click(object sender, RoutedEventArgs e)
+ {
+ UserDataStorageItemProtectionStatus status = await userDataProtectionManager.ProtectStorageItemAsync(selectedItem, UserDataAvailability.WhileUnlocked);
+ ReportStatus("Protect L2", status);
+ }
+
+ private async void Unprotect_Click(object sender, RoutedEventArgs e)
+ {
+ UserDataStorageItemProtectionStatus status = await userDataProtectionManager.ProtectStorageItemAsync(selectedItem, UserDataAvailability.Always);
+ ReportStatus("Unprotect", status);
+ }
+
+ private void ReportStatus(string operation, UserDataStorageItemProtectionStatus status)
+ {
+ switch (status)
+ {
+ case UserDataStorageItemProtectionStatus.Succeeded:
+ rootPage.NotifyUser(operation + " succeeded", NotifyType.StatusMessage);
+ break;
+
+ case UserDataStorageItemProtectionStatus.NotProtectable:
+ rootPage.NotifyUser(operation + " failed: Not protectable", NotifyType.ErrorMessage);
+ break;
+
+ case UserDataStorageItemProtectionStatus.DataUnavailable:
+ rootPage.NotifyUser(operation + " failed: Data unavailable", NotifyType.ErrorMessage);
+ break;
+
+ default:
+ rootPage.NotifyUser(operation + " failed: Unknown failure", NotifyType.ErrorMessage);
+ break;
+ }
+ }
+ }
+}
diff --git a/Samples/PersonalDataEncryption/cs/Scenario2_Memory.xaml.cs b/Samples/PersonalDataEncryption/cs/Scenario2_Memory.xaml.cs
new file mode 100644
index 0000000000..df77098393
--- /dev/null
+++ b/Samples/PersonalDataEncryption/cs/Scenario2_Memory.xaml.cs
@@ -0,0 +1,112 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
+// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
+// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
+// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
+//
+//*********************************************************
+
+using System;
+using Windows.Foundation;
+using Windows.Security.Cryptography;
+using Windows.Security.DataProtection;
+using Windows.Storage.Streams;
+using Windows.UI.ViewManagement;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Navigation;
+
+namespace SDKTemplate
+{
+ public sealed partial class Scenario2_Memory : Page
+ {
+ private MainPage rootPage = MainPage.Current;
+ UserDataProtectionManager userDataProtectionManager = null;
+ IBuffer protectedBuffer = null;
+
+ public Scenario2_Memory()
+ {
+ this.InitializeComponent();
+ }
+
+ protected override void OnNavigatedTo(NavigationEventArgs e)
+ {
+ userDataProtectionManager = UserDataProtectionManager.TryGetDefault();
+ if (userDataProtectionManager != null)
+ {
+ AvailablePanel.Visibility = Visibility.Visible;
+ UnavailablePanel.Visibility = Visibility.Collapsed;
+ }
+ else
+ {
+ AvailablePanel.Visibility = Visibility.Collapsed;
+ UnavailablePanel.Visibility = Visibility.Visible;
+ }
+ }
+
+ private async void ProtectL1_Click(object sender, RoutedEventArgs e)
+ {
+ string text = DataTextBox.Text;
+ if (text.Length == 0)
+ {
+ // Cannot protect a zero-length buffer.
+ rootPage.NotifyUser("Please enter data to protect", NotifyType.ErrorMessage);
+ return;
+ }
+
+ IBuffer buffer = CryptographicBuffer.ConvertStringToBinary(text, BinaryStringEncoding.Utf8);
+
+ IBuffer result = await userDataProtectionManager.ProtectBufferAsync(buffer, UserDataAvailability.AfterFirstUnlock);
+ ReportProtectedBuffer(result);
+ }
+
+ private async void ProtectL2_Click(object sender, RoutedEventArgs e)
+ {
+ string text = DataTextBox.Text;
+ if (text.Length == 0)
+ {
+ // Cannot protect a zero-length buffer.
+ rootPage.NotifyUser("Please enter data to protect", NotifyType.ErrorMessage);
+ return;
+ }
+
+ IBuffer buffer = CryptographicBuffer.ConvertStringToBinary(text, BinaryStringEncoding.Utf8);
+
+ IBuffer result = await userDataProtectionManager.ProtectBufferAsync(buffer, UserDataAvailability.WhileUnlocked);
+ ReportProtectedBuffer(result);
+ }
+
+ void ReportProtectedBuffer(IBuffer buffer)
+ {
+ protectedBuffer = buffer;
+ ProtectedDataTextBlock.Text = CryptographicBuffer.EncodeToHexString(buffer);
+ UnprotectPanel.Visibility = Visibility.Visible;
+ rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
+ }
+
+ private async void Unprotect_Click(object sender, RoutedEventArgs e)
+ {
+ UnprotectedDataTextBlock.Text = string.Empty;
+ UserDataBufferUnprotectResult result = await userDataProtectionManager.UnprotectBufferAsync(protectedBuffer);
+ switch (result.Status)
+ {
+ case UserDataBufferUnprotectStatus.Succeeded:
+ rootPage.NotifyUser("Unprotected successfully", NotifyType.StatusMessage);
+ UnprotectedDataTextBlock.Text = CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8, result.UnprotectedBuffer);
+ break;
+
+ case UserDataBufferUnprotectStatus.Unavailable:
+ rootPage.NotifyUser("Unable to unprotect: Unavailable", NotifyType.ErrorMessage);
+ break;
+
+ default:
+ rootPage.NotifyUser("Unable to unprotect: Unknown error", NotifyType.ErrorMessage);
+ break;
+ }
+ }
+ }
+}
diff --git a/Samples/PersonalDataEncryption/shared/Scenario1_Files.xaml b/Samples/PersonalDataEncryption/shared/Scenario1_Files.xaml
new file mode 100644
index 0000000000..26b92b961f
--- /dev/null
+++ b/Samples/PersonalDataEncryption/shared/Scenario1_Files.xaml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+ Protecting and unprotecting files and folders
+
+
+ Protecting and unprotecting a folder controls the protection of new files
+ created in the folder. It does not affect the protection of files which are already
+ present in the folder.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Personal Data Encryption is not enabled.
+
+
+
+
+
diff --git a/Samples/PersonalDataEncryption/shared/Scenario2_Memory.xaml b/Samples/PersonalDataEncryption/shared/Scenario2_Memory.xaml
new file mode 100644
index 0000000000..8925c254f7
--- /dev/null
+++ b/Samples/PersonalDataEncryption/shared/Scenario2_Memory.xaml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+ Protecting and unprotecting memory
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Personal Data Encryption is not enabled.
+
+
+
+
+
diff --git a/Samples/RadioManager/README.md b/Samples/RadioManager/README.md
index 826366cc7a..b4ba7c6a68 100644
--- a/Samples/RadioManager/README.md
+++ b/Samples/RadioManager/README.md
@@ -2,7 +2,6 @@
page_type: sample
languages:
- csharp
-- cpp
- cppwinrt
products:
- windows
@@ -23,35 +22,25 @@ description: "Shows how to enumerate radios on a device, toggle radio state chan
# Radios sample
-Shows how to use the [Windows.Devices.Radios](https://msdn.microsoft.com/library/windows/apps/windows.devices.radios.aspx) API to enumerate radios on a device,
-toggle radio state changes, and register for state changes on individual radios.
+Shows how to use the [Windows.Devices.Radios](https://msdn.microsoft.com/library/windows/apps/windows.devices.radios.aspx) API to enumerate radios on a device,
+toggle radio state changes, and register for state changes on individual radios.
-> **Note:** This sample is part of a large collection of UWP feature samples.
+> **Note:** This sample is part of a large collection of UWP feature samples.
> You can download this sample as a standalone ZIP file
> [from docs.microsoft.com](https://docs.microsoft.com/samples/microsoft/windows-universal-samples/radiomanager/),
> or you can download the entire collection as a single
-> [ZIP file](https://github.com/Microsoft/Windows-universal-samples/archive/master.zip), but be
-> sure to unzip everything to access shared dependencies. For more info on working with the ZIP file,
-> the samples collection, and GitHub, see [Get the UWP samples from GitHub](https://aka.ms/ovu2uq).
-> For more samples, see the [Samples portal](https://aka.ms/winsamples) on the Windows Dev Center.
-
-## Related topics
-
-### Related samples
-
-[RadioManager](/archived/RadioManager) for C++/CX (archived)
+> [ZIP file](https://github.com/Microsoft/Windows-universal-samples/archive/master.zip), but be
+> sure to unzip everything to access shared dependencies. For more info on working with the ZIP file,
+> the samples collection, and GitHub, see [Get the UWP samples from GitHub](https://aka.ms/ovu2uq).
+> For more samples, see the [Samples portal](https://aka.ms/winsamples) on the Windows Dev Center.
## System requirements
-**Client:** Windows 10
-
-**Server:** Windows Server 2016 Technical Preview
-
-**Phone:** Windows 10
+- Requires Windows SDK 10.0.22621.0 to build and Windows 10 to run.
## Build the sample
-1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build.
+1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build.
2. Start Microsoft Visual Studio and select **File** \> **Open** \> **Project/Solution**.
3. Starting in the folder where you unzipped the samples, go to the Samples subfolder, then the subfolder for this specific sample, then the subfolder for your preferred language (C++, C#, or JavaScript). Double-click the Visual Studio Solution (.sln) file.
4. Press Ctrl+Shift+B, or select **Build** \> **Build Solution**.
@@ -62,7 +51,7 @@ The next steps depend on whether you just want to deploy the sample or you want
### Deploying the sample
-- Select **Build** \> **Deploy Solution**.
+- Select **Build** \> **Deploy Solution**.
### Deploying and running the sample
diff --git a/Samples/RadioManager/cppwinrt/RadioManager.sln b/Samples/RadioManager/cppwinrt/RadioManager.sln
index dc7a5f2132..95c4a82c3f 100644
--- a/Samples/RadioManager/cppwinrt/RadioManager.sln
+++ b/Samples/RadioManager/cppwinrt/RadioManager.sln
@@ -1,32 +1,32 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.31702.278
+# Visual Studio Version 17
+VisualStudioVersion = 17.7.34302.85
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RadioManager", "RadioManager.vcxproj", "{A2D33437-5635-4832-AD71-08D653A37053}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|ARM = Debug|ARM
+ Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
- Release|ARM = Release|ARM
+ Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {A2D33437-5635-4832-AD71-08D653A37053}.Debug|ARM.ActiveCfg = Debug|ARM
- {A2D33437-5635-4832-AD71-08D653A37053}.Debug|ARM.Build.0 = Debug|ARM
- {A2D33437-5635-4832-AD71-08D653A37053}.Debug|ARM.Deploy.0 = Debug|ARM
+ {A2D33437-5635-4832-AD71-08D653A37053}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {A2D33437-5635-4832-AD71-08D653A37053}.Debug|ARM64.Build.0 = Debug|ARM64
+ {A2D33437-5635-4832-AD71-08D653A37053}.Debug|ARM64.Deploy.0 = Debug|ARM64
{A2D33437-5635-4832-AD71-08D653A37053}.Debug|x64.ActiveCfg = Debug|x64
{A2D33437-5635-4832-AD71-08D653A37053}.Debug|x64.Build.0 = Debug|x64
{A2D33437-5635-4832-AD71-08D653A37053}.Debug|x64.Deploy.0 = Debug|x64
{A2D33437-5635-4832-AD71-08D653A37053}.Debug|x86.ActiveCfg = Debug|Win32
{A2D33437-5635-4832-AD71-08D653A37053}.Debug|x86.Build.0 = Debug|Win32
{A2D33437-5635-4832-AD71-08D653A37053}.Debug|x86.Deploy.0 = Debug|Win32
- {A2D33437-5635-4832-AD71-08D653A37053}.Release|ARM.ActiveCfg = Release|ARM
- {A2D33437-5635-4832-AD71-08D653A37053}.Release|ARM.Build.0 = Release|ARM
- {A2D33437-5635-4832-AD71-08D653A37053}.Release|ARM.Deploy.0 = Release|ARM
+ {A2D33437-5635-4832-AD71-08D653A37053}.Release|ARM64.ActiveCfg = Release|ARM64
+ {A2D33437-5635-4832-AD71-08D653A37053}.Release|ARM64.Build.0 = Release|ARM64
+ {A2D33437-5635-4832-AD71-08D653A37053}.Release|ARM64.Deploy.0 = Release|ARM64
{A2D33437-5635-4832-AD71-08D653A37053}.Release|x64.ActiveCfg = Release|x64
{A2D33437-5635-4832-AD71-08D653A37053}.Release|x64.Build.0 = Release|x64
{A2D33437-5635-4832-AD71-08D653A37053}.Release|x64.Deploy.0 = Release|x64
diff --git a/Samples/RadioManager/cppwinrt/RadioManager.vcxproj b/Samples/RadioManager/cppwinrt/RadioManager.vcxproj
index d80645f563..277c28b1c4 100644
--- a/Samples/RadioManager/cppwinrt/RadioManager.vcxproj
+++ b/Samples/RadioManager/cppwinrt/RadioManager.vcxproj
@@ -1,6 +1,6 @@
-
+ $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), LICENSE))\SharedContent
@@ -20,9 +20,9 @@
-
+ Debug
- ARM
+ ARM64Debug
@@ -32,9 +32,9 @@
Debugx64
-
+ Release
- ARM
+ ARM64Release
@@ -176,13 +176,13 @@
-
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
+
+
-
\ No newline at end of file
+
diff --git a/Samples/RadioManager/cppwinrt/packages.config b/Samples/RadioManager/cppwinrt/packages.config
index fb20a4e613..1b8cfbd961 100644
--- a/Samples/RadioManager/cppwinrt/packages.config
+++ b/Samples/RadioManager/cppwinrt/packages.config
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/Samples/RadioManager/cs/RadioManager.csproj b/Samples/RadioManager/cs/RadioManager.csproj
index 3f002ae7e4..ed422ed029 100644
--- a/Samples/RadioManager/cs/RadioManager.csproj
+++ b/Samples/RadioManager/cs/RadioManager.csproj
@@ -21,28 +21,31 @@
512{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
-
+ true
- bin\ARM\Debug\
+ bin\ARM64\Debug\DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP;2008
+ truefull
- ARM
+ ARM64false
+ 7.3prompttrue
-
- bin\ARM\Release\
+
+ bin\ARM64\Release\TRACE;NETFX_CORE;WINDOWS_UAPtrue;2008
+ truepdbonly
- ARM
+ ARM64false
+ 7.3prompttrue
- truetrue
@@ -163,7 +166,7 @@
- 5.0.0
+ 6.2.14
@@ -177,4 +180,4 @@
-->
-
\ No newline at end of file
+
diff --git a/Samples/RadioManager/cs/RadioManager.sln b/Samples/RadioManager/cs/RadioManager.sln
index 21b501d63e..151b8b729d 100644
--- a/Samples/RadioManager/cs/RadioManager.sln
+++ b/Samples/RadioManager/cs/RadioManager.sln
@@ -1,32 +1,32 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.4
+# Visual Studio Version 17
+VisualStudioVersion = 17.7.34302.85
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RadioManager", "RadioManager.csproj", "{C90B6F98-3F0B-51A1-8C89-FB21B133A284}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|ARM = Debug|ARM
+ Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
- Release|ARM = Release|ARM
+ Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Debug|ARM.ActiveCfg = Debug|ARM
- {C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Debug|ARM.Build.0 = Debug|ARM
- {C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Debug|ARM.Deploy.0 = Debug|ARM
+ {C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Debug|ARM64.Build.0 = Debug|ARM64
+ {C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Debug|ARM64.Deploy.0 = Debug|ARM64
{C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Debug|x64.ActiveCfg = Debug|x64
{C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Debug|x64.Build.0 = Debug|x64
{C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Debug|x64.Deploy.0 = Debug|x64
{C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Debug|x86.ActiveCfg = Debug|x86
{C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Debug|x86.Build.0 = Debug|x86
{C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Debug|x86.Deploy.0 = Debug|x86
- {C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Release|ARM.ActiveCfg = Release|ARM
- {C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Release|ARM.Build.0 = Release|ARM
- {C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Release|ARM.Deploy.0 = Release|ARM
+ {C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Release|ARM64.ActiveCfg = Release|ARM64
+ {C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Release|ARM64.Build.0 = Release|ARM64
+ {C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Release|ARM64.Deploy.0 = Release|ARM64
{C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Release|x64.ActiveCfg = Release|x64
{C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Release|x64.Build.0 = Release|x64
{C90B6F98-3F0B-51A1-8C89-FB21B133A284}.Release|x64.Deploy.0 = Release|x64
diff --git a/Samples/ResizeAppView/cpp/Scenario1_Basic.xaml.cpp b/Samples/ResizeAppView/cpp/Scenario1_Basic.xaml.cpp
index 38425e8256..c0565e487f 100644
--- a/Samples/ResizeAppView/cpp/Scenario1_Basic.xaml.cpp
+++ b/Samples/ResizeAppView/cpp/Scenario1_Basic.xaml.cpp
@@ -22,8 +22,28 @@ using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Input;
+using namespace Windows::UI;
+
+// This is a clone of IUIContentRoot but is not exclusiveto
+[uuid(1DFCBAC6-B36B-5CB9-9BC5-2B7A0EDDC378)]
+public interface class IUIContentRootClone
+{
+ property Windows::UI::UIContext^ UIContext
+ {
+ Windows::UI::UIContext^ get();
+ }
+};
+ref class MockUIContentRoot : public IUIContentRootClone {
+public:
+ property Windows::UI::UIContext^ UIContext
+ { virtual Windows::UI::UIContext^ get() { return nullptr; }}
+
+};
Scenario1_Basic::Scenario1_Basic() : rootPage(MainPage::Current)
{
+ UIContentRoot^ root = safe_cast(reinterpret_cast
-
+ true
- bin\ARM\Debug\
+ bin\ARM64\Debug\DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP;2008
+ truefull
- ARM
+ ARM64false
+ 7.3prompttrue
-
- bin\ARM\Release\
+
+ bin\ARM64\Release\TRACE;NETFX_CORE;WINDOWS_UAPtrue;2008
+ truepdbonly
- ARM
+ ARM64false
+ 7.3prompttrue
- falsetrue
@@ -164,12 +167,10 @@
Assets\tile-sdk.png
-
-
-
+
- 5.0.0
+ 6.2.14
@@ -183,4 +184,4 @@
-->
-
\ No newline at end of file
+
diff --git a/archived/VoIP/cs/VoipBackEnd/VoipBackEnd.vcxproj b/archived/VoIP/cs/VoipBackEnd/VoipBackEnd.vcxproj
index 6418010345..a9a5a07491 100644
--- a/archived/VoIP/cs/VoipBackEnd/VoipBackEnd.vcxproj
+++ b/archived/VoIP/cs/VoipBackEnd/VoipBackEnd.vcxproj
@@ -1,9 +1,9 @@
-
+ Debug
- ARM
+ ARM64Debug
@@ -13,9 +13,9 @@
Debugx64
-
+ Release
- ARM
+ ARM64Release
@@ -38,8 +38,8 @@
14.0trueWindows Store
- 10.0.18362.0
- 10.0.18362.0
+ 10.0.22621.0
+ 10.0.22621.010.0
@@ -47,7 +47,7 @@
DynamicLibrarytrue
-
+ DynamicLibrarytrue
@@ -60,7 +60,7 @@
falsetrue
-
+ DynamicLibraryfalsetrue
@@ -81,10 +81,10 @@
-
+
-
+
@@ -101,10 +101,10 @@
false
-
+ false
-
+ false
@@ -143,7 +143,7 @@
false
-
+ Use_WINRT_DLL;%(PreprocessorDefinitions)
@@ -158,7 +158,7 @@
false
-
+ Use_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)
@@ -219,8 +219,8 @@
CreateCreate
- Create
- Create
+ Create
+ CreateCreateCreate
@@ -228,4 +228,4 @@
-
\ No newline at end of file
+
diff --git a/archived/VoIP/cs/VoipHost/VoipHost.vcxproj b/archived/VoIP/cs/VoipHost/VoipHost.vcxproj
index a273d98d93..b85037e8af 100644
--- a/archived/VoIP/cs/VoipHost/VoipHost.vcxproj
+++ b/archived/VoIP/cs/VoipHost/VoipHost.vcxproj
@@ -1,9 +1,9 @@
-
+ Debug
- ARM
+ ARM64Debug
@@ -13,9 +13,9 @@
Debugx64
-
+ Release
- ARM
+ ARM64Release
@@ -44,8 +44,8 @@
14.0trueWindows Store
- 10.0.18362.0
- 10.0.18362.0
+ 10.0.22621.0
+ 10.0.22621.010.0
@@ -53,7 +53,7 @@
Applicationtrue
-
+ Applicationtrue
@@ -66,7 +66,7 @@
falsetrue
-
+ Applicationfalsetrue
@@ -87,10 +87,10 @@
-
+
-
+
@@ -107,10 +107,10 @@
false
-
+ false
-
+ false
@@ -149,7 +149,7 @@
false
-
+ NotUsing_WINRT_DLL;%(PreprocessorDefinitions)
@@ -164,7 +164,7 @@
false
-
+ NotUsing_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)
@@ -212,4 +212,4 @@
-
\ No newline at end of file
+
diff --git a/archived/VoIP/cs/VoipTasks/VoipTasks.csproj b/archived/VoIP/cs/VoipTasks/VoipTasks.csproj
index 3f18743571..bd230a0ebe 100644
--- a/archived/VoIP/cs/VoipTasks/VoipTasks.csproj
+++ b/archived/VoIP/cs/VoipTasks/VoipTasks.csproj
@@ -14,7 +14,7 @@
VoipTasksen-USUAP
- 10.0.18362.0
+ 10.0.22621.010.0.18362.014512
@@ -40,27 +40,29 @@
prompt4
-
- ARM
+ true
- bin\ARM\Debug\
+ bin\ARM64\Debug\DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP;2008
+ truefull
- ARM
+ ARM64false
+ 7.3prompttrue
-
- ARM
- bin\ARM\Release\
+
+ bin\ARM64\Release\TRACE;NETFX_CORE;WINDOWS_UAPtrue;2008
+ truepdbonly
- ARM
+ ARM64false
+ 7.3prompttrue
@@ -120,11 +122,6 @@
-
-
- Windows Mobile Extensions for the UWP
-
- {fc9cbb95-624c-4ce8-86a8-3ab5a415aa65}
@@ -133,9 +130,14 @@
- 5.0.0
+ 6.2.14
+
+
+ Windows Mobile Extensions for the UWP
+
+ 14.0