Skip to content

Commit 589f33b

Browse files
committed
Windows 11 - May 2022 Samples Update
* ApplicationData: Remove roaming scenarios that don't apply to Windows 11 * Geolocation: Add geometric and time dilution of position properties * WindowsAudioSession: Fix buffer leaks, waveformat leaks, low latency, hardware offload, handle systems with no sound device * UserInfo: New CheckUserAgeConsentGroupAsync method * ApplicationData, PasswordVault, WindowsAudioSession: Ported to C++/WinRT
1 parent 7b34a9f commit 589f33b

File tree

167 files changed

+8411
-1290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+8411
-1290
lines changed

Samples/ApplicationData/README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
page_type: sample
33
languages:
44
- csharp
5-
- vb
5+
- cpp
6+
- cppwinrt
67
products:
78
- windows
89
- windows-uwp
@@ -37,41 +38,41 @@ Shows how to store and retrieve data that is specific to each user and app by us
3738
Application data includes session state, user preferences, and other settings. It is created, read, updated, and deleted when the app is running. The operating system manages these data stores for your app:
3839

3940
- local: Data that exists on the current device and is backed up in the cloud
40-
- roaming: Data that exists on all devices on which the user has installed the app
4141
- temporary: Data that could be removed by the system any time the app isn't running
4242
- localcache: Persistent data that exists only on the current device
4343

44-
If you use roaming data in your app, your users can easily keep your app's application data in sync across multiple devices. The operating system replicates roaming data to the cloud when it is updated, and synchronizes the data to any other devices on which the app is installed, reducing the amount of setup work that the user needs to do to install your app on multiple devices.
45-
4644
If you use local data in your app, your users can back up application data in the cloud. This application data can then be restored back on any other device while setting up the device with the same account.
4745

46+
The system also manages a roaming data store,
47+
but the data no longer roams starting in Windows 11.
48+
4849
The sample covers these key tasks:
4950

5051
- Reading and writing settings to an app data store
5152
- Reading and writing files to an app data store
52-
- Responding to roaming events
53-
54-
## Guidelines
5553

56-
[Guidelines for roaming application data](http://msdn.microsoft.com/library/windows/apps/hh465094)
54+
## Related topics
5755

58-
## Concepts
56+
### Concepts
5957

6058
[Store and retrieve settings and other app data](https://msdn.microsoft.com/library/windows/apps/mt299098)
6159

62-
## Reference
60+
### Related samples
61+
62+
* [ApplicationData sample](/archived/ApplicationData/) for Visual Basic (archived)
63+
64+
### Reference
6365

6466
[Windows.Storage.ApplicationData](http://msdn.microsoft.com/library/windows/apps/br241587)
6567
[Windows.Storage.ApplicationDataCompositeValue](http://msdn.microsoft.com/library/windows/apps/br241588)
6668
[Windows.Storage.ApplicationDataContainer](http://msdn.microsoft.com/library/windows/apps/br241599)
6769
[Windows.Storage.ApplicationDataContainerSettings](http://msdn.microsoft.com/library/windows/apps/br241600)
68-
[WinJS.Application](http://msdn.microsoft.com/library/windows/apps/br229774)
6970

7071
## System requirements
7172

7273
**Client:** Windows 10
7374

74-
**Server:** Windows Server 2016 Technical Preview
75+
**Server:** Windows Server 2016
7576

7677
**Phone:** Windows 10
7778

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.31424.327
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ApplicationData", "ApplicationData.vcxproj", "{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|ARM = Debug|ARM
11+
Debug|x64 = Debug|x64
12+
Debug|x86 = Debug|x86
13+
Release|ARM = Release|ARM
14+
Release|x64 = Release|x64
15+
Release|x86 = Release|x86
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Debug|ARM.ActiveCfg = Debug|ARM
19+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Debug|ARM.Build.0 = Debug|ARM
20+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Debug|ARM.Deploy.0 = Debug|ARM
21+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Debug|x64.ActiveCfg = Debug|x64
22+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Debug|x64.Build.0 = Debug|x64
23+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Debug|x64.Deploy.0 = Debug|x64
24+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Debug|x86.ActiveCfg = Debug|Win32
25+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Debug|x86.Build.0 = Debug|Win32
26+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Debug|x86.Deploy.0 = Debug|Win32
27+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Release|ARM.ActiveCfg = Release|ARM
28+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Release|ARM.Build.0 = Release|ARM
29+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Release|ARM.Deploy.0 = Release|ARM
30+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Release|x64.ActiveCfg = Release|x64
31+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Release|x64.Build.0 = Release|x64
32+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Release|x64.Deploy.0 = Release|x64
33+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Release|x86.ActiveCfg = Release|Win32
34+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Release|x86.Build.0 = Release|Win32
35+
{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}.Release|x86.Deploy.0 = Release|Win32
36+
EndGlobalSection
37+
GlobalSection(SolutionProperties) = preSolution
38+
HideSolutionNode = FALSE
39+
EndGlobalSection
40+
GlobalSection(ExtensibilityGlobals) = postSolution
41+
SolutionGuid = {391ED8DE-38FA-49C2-A23C-4D0CE73F0017}
42+
EndGlobalSection
43+
EndGlobal
Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props')" />
4+
<PropertyGroup>
5+
<SharedContentDir>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), LICENSE))\SharedContent</SharedContentDir>
6+
</PropertyGroup>
7+
<PropertyGroup Label="Globals">
8+
<MinimalCoreWin>true</MinimalCoreWin>
9+
<ProjectGuid>{83665FC5-1A28-4FF1-A403-2A7ACBA3E6A5}</ProjectGuid>
10+
<ProjectName>ApplicationData</ProjectName>
11+
<RootNamespace>SDKTemplate</RootNamespace>
12+
<DefaultLanguage>en-US</DefaultLanguage>
13+
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
14+
<AppContainerApplication>true</AppContainerApplication>
15+
<ApplicationType>Windows Store</ApplicationType>
16+
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
17+
<WindowsTargetPlatformVersion>10.0.22000.0</WindowsTargetPlatformVersion>
18+
<WindowsTargetPlatformMinVersion>$(WindowsTargetPlatformVersion)</WindowsTargetPlatformMinVersion>
19+
</PropertyGroup>
20+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
21+
<ItemGroup Label="ProjectConfigurations">
22+
<ProjectConfiguration Include="Debug|ARM">
23+
<Configuration>Debug</Configuration>
24+
<Platform>ARM</Platform>
25+
</ProjectConfiguration>
26+
<ProjectConfiguration Include="Debug|Win32">
27+
<Configuration>Debug</Configuration>
28+
<Platform>Win32</Platform>
29+
</ProjectConfiguration>
30+
<ProjectConfiguration Include="Debug|x64">
31+
<Configuration>Debug</Configuration>
32+
<Platform>x64</Platform>
33+
</ProjectConfiguration>
34+
<ProjectConfiguration Include="Release|ARM">
35+
<Configuration>Release</Configuration>
36+
<Platform>ARM</Platform>
37+
</ProjectConfiguration>
38+
<ProjectConfiguration Include="Release|Win32">
39+
<Configuration>Release</Configuration>
40+
<Platform>Win32</Platform>
41+
</ProjectConfiguration>
42+
<ProjectConfiguration Include="Release|x64">
43+
<Configuration>Release</Configuration>
44+
<Platform>x64</Platform>
45+
</ProjectConfiguration>
46+
</ItemGroup>
47+
<PropertyGroup Label="Configuration">
48+
<ConfigurationType>Application</ConfigurationType>
49+
<PlatformToolset>v142</PlatformToolset>
50+
<CharacterSet>Unicode</CharacterSet>
51+
</PropertyGroup>
52+
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
53+
<UseDebugLibraries>true</UseDebugLibraries>
54+
<LinkIncremental>true</LinkIncremental>
55+
</PropertyGroup>
56+
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
57+
<UseDebugLibraries>false</UseDebugLibraries>
58+
<WholeProgramOptimization>true</WholeProgramOptimization>
59+
<LinkIncremental>false</LinkIncremental>
60+
</PropertyGroup>
61+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
62+
<ImportGroup Label="PropertySheets">
63+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
64+
</ImportGroup>
65+
<PropertyGroup Label="UserMacros" />
66+
<PropertyGroup>
67+
<IncludePath>$(VC_IncludePath);$(UniversalCRT_IncludePath);$(WindowsSDK_IncludePath);$(SharedContentDir)\cppwinrt</IncludePath>
68+
<CppWinRTOptimized>true</CppWinRTOptimized>
69+
</PropertyGroup>
70+
<ItemDefinitionGroup>
71+
<ClCompile>
72+
<PrecompiledHeader>Use</PrecompiledHeader>
73+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
74+
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
75+
<WarningLevel>Level4</WarningLevel>
76+
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
77+
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
78+
</ClCompile>
79+
</ItemDefinitionGroup>
80+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
81+
<ClCompile>
82+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
83+
</ClCompile>
84+
<Link>
85+
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">WindowsApp.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
86+
</Link>
87+
<Link>
88+
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">WindowsApp.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
89+
</Link>
90+
<Link>
91+
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">WindowsApp.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
92+
</Link>
93+
</ItemDefinitionGroup>
94+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
95+
<ClCompile>
96+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
97+
</ClCompile>
98+
<Link>
99+
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">WindowsApp.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
100+
</Link>
101+
<Link>
102+
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WindowsApp.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
103+
</Link>
104+
<Link>
105+
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">WindowsApp.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
106+
</Link>
107+
</ItemDefinitionGroup>
108+
<ItemGroup>
109+
<ClInclude Include="$(SharedContentDir)\cppwinrt\App.h">
110+
<DependentUpon>$(SharedContentDir)\xaml\App.xaml</DependentUpon>
111+
</ClInclude>
112+
<ClInclude Include="$(SharedContentDir)\cppwinrt\MainPage.h">
113+
<DependentUpon>$(SharedContentDir)\xaml\MainPage.xaml</DependentUpon>
114+
</ClInclude>
115+
<ClInclude Include="SampleConfiguration.h" />
116+
<ClInclude Include="Scenario1_Files.h">
117+
<DependentUpon>..\shared\Scenario1_Files.xaml</DependentUpon>
118+
</ClInclude>
119+
<ClInclude Include="Scenario2_Settings.h">
120+
<DependentUpon>..\shared\Scenario2_Settings.xaml</DependentUpon>
121+
</ClInclude>
122+
<ClInclude Include="Scenario3_SettingContainer.h">
123+
<DependentUpon>..\shared\Scenario3_SettingContainer.xaml</DependentUpon>
124+
</ClInclude>
125+
<ClInclude Include="Scenario4_CompositeSettings.h">
126+
<DependentUpon>..\shared\Scenario4_CompositeSettings.xaml</DependentUpon>
127+
</ClInclude>
128+
<ClInclude Include="Scenario5_Msappdata.h">
129+
<DependentUpon>..\shared\Scenario5_Msappdata.xaml</DependentUpon>
130+
</ClInclude>
131+
<ClInclude Include="Scenario6_ClearScenario.h">
132+
<DependentUpon>..\shared\Scenario6_ClearScenario.xaml</DependentUpon>
133+
</ClInclude>
134+
<ClInclude Include="Scenario7_SetVersion.h">
135+
<DependentUpon>..\shared\Scenario7_SetVersion.xaml</DependentUpon>
136+
</ClInclude>
137+
<ClInclude Include="pch.h" />
138+
</ItemGroup>
139+
<ItemGroup>
140+
<ApplicationDefinition Include="$(SharedContentDir)\xaml\App.xaml">
141+
<SubType>Designer</SubType>
142+
</ApplicationDefinition>
143+
<Page Include="$(SharedContentDir)\xaml\MainPage.xaml">
144+
<SubType>Designer</SubType>
145+
</Page>
146+
<Page Include="..\shared\Scenario1_Files.xaml" />
147+
<Page Include="..\shared\Scenario2_Settings.xaml" />
148+
<Page Include="..\shared\Scenario3_SettingContainer.xaml" />
149+
<Page Include="..\shared\Scenario4_CompositeSettings.xaml" />
150+
<Page Include="..\shared\Scenario5_Msappdata.xaml" />
151+
<Page Include="..\shared\Scenario6_ClearScenario.xaml" />
152+
<Page Include="..\shared\Scenario7_SetVersion.xaml" />
153+
<Page Include="$(SharedContentDir)\xaml\Styles.xaml">
154+
<Link>Styles\Styles.xaml</Link>
155+
</Page>
156+
</ItemGroup>
157+
<ItemGroup>
158+
<ClCompile Include="$(SharedContentDir)\cppwinrt\App.cpp">
159+
<DependentUpon>$(SharedContentDir)\xaml\App.xaml</DependentUpon>
160+
</ClCompile>
161+
<ClCompile Include="$(SharedContentDir)\cppwinrt\MainPage.cpp">
162+
<DependentUpon>$(SharedContentDir)\xaml\MainPage.xaml</DependentUpon>
163+
</ClCompile>
164+
<ClCompile Include="SampleConfiguration.cpp">
165+
<DependentUpon>SampleConfiguration.h</DependentUpon>
166+
</ClCompile>
167+
<ClCompile Include="Scenario1_Files.cpp">
168+
<DependentUpon>..\shared\Scenario1_Files.xaml</DependentUpon>
169+
</ClCompile>
170+
<ClCompile Include="Scenario2_Settings.cpp">
171+
<DependentUpon>..\shared\Scenario2_Settings.xaml</DependentUpon>
172+
</ClCompile>
173+
<ClCompile Include="Scenario3_SettingContainer.cpp">
174+
<DependentUpon>..\shared\Scenario3_SettingContainer.xaml</DependentUpon>
175+
</ClCompile>
176+
<ClCompile Include="Scenario4_CompositeSettings.cpp">
177+
<DependentUpon>..\shared\Scenario4_CompositeSettings.xaml</DependentUpon>
178+
</ClCompile>
179+
<ClCompile Include="Scenario5_Msappdata.cpp">
180+
<DependentUpon>..\shared\Scenario5_Msappdata.xaml</DependentUpon>
181+
</ClCompile>
182+
<ClCompile Include="Scenario6_ClearScenario.cpp">
183+
<DependentUpon>..\shared\Scenario6_ClearScenario.xaml</DependentUpon>
184+
</ClCompile>
185+
<ClCompile Include="Scenario7_SetVersion.cpp">
186+
<DependentUpon>..\shared\Scenario7_SetVersion.xaml</DependentUpon>
187+
</ClCompile>
188+
<ClCompile Include="pch.cpp">
189+
<PrecompiledHeader>Create</PrecompiledHeader>
190+
<DependentUpon>pch.h</DependentUpon>
191+
</ClCompile>
192+
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp">
193+
<DependentUpon>Project.idl</DependentUpon>
194+
</ClCompile>
195+
</ItemGroup>
196+
<ItemGroup>
197+
<Midl Include="$(SharedContentDir)\cppwinrt\MainPage.idl">
198+
<DependentUpon>$(SharedContentDir)\xaml\MainPage.xaml</DependentUpon>
199+
</Midl>
200+
<Midl Include="Project.idl" />
201+
</ItemGroup>
202+
<ItemGroup>
203+
<AppxManifest Include="Package.appxmanifest">
204+
<SubType>Designer</SubType>
205+
</AppxManifest>
206+
</ItemGroup>
207+
<ItemGroup>
208+
<Image Include="$(SharedContentDir)\media\microsoft-sdk.png">
209+
<Link>Assets\microsoft-sdk.png</Link>
210+
</Image>
211+
<Image Include="$(SharedContentDir)\media\smalltile-sdk.png">
212+
<Link>Assets\smallTile-sdk.png</Link>
213+
</Image>
214+
<Image Include="$(SharedContentDir)\media\splash-sdk.png">
215+
<Link>Assets\splash-sdk.png</Link>
216+
</Image>
217+
<Image Include="$(SharedContentDir)\media\squaretile-sdk.png">
218+
<Link>Assets\squareTile-sdk.png</Link>
219+
</Image>
220+
<Image Include="$(SharedContentDir)\media\storelogo-sdk.png">
221+
<Link>Assets\storeLogo-sdk.png</Link>
222+
</Image>
223+
<Image Include="$(SharedContentDir)\media\tile-sdk.png">
224+
<Link>Assets\tile-sdk.png</Link>
225+
</Image>
226+
<Image Include="$(SharedContentDir)\media\windows-sdk.png">
227+
<Link>Assets\windows-sdk.png</Link>
228+
</Image>
229+
<Image Include="..\shared\Assets\appDataLocal.png">
230+
<Link>Assets\appDataLocal.png</Link>
231+
</Image>
232+
<Image Include="..\shared\Assets\appDataRoaming.png">
233+
<Link>Assets\appDataRoaming.png</Link>
234+
</Image>
235+
<Image Include="..\shared\Assets\appDataTemp.png">
236+
<Link>Assets\appDataTemp.png</Link>
237+
</Image>
238+
</ItemGroup>
239+
<ItemGroup>
240+
<None Include="packages.config" />
241+
</ItemGroup>
242+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
243+
<ImportGroup Label="ExtensionTargets">
244+
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets')" />
245+
</ImportGroup>
246+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
247+
<PropertyGroup>
248+
<ErrorText>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}.</ErrorText>
249+
</PropertyGroup>
250+
<Error Condition="!Exists('packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props'))" />
251+
<Error Condition="!Exists('packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets'))" />
252+
</Target>
253+
</Project>

0 commit comments

Comments
 (0)