Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion dev/ApplicationData/ApplicationData.idl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ namespace Microsoft.Windows.Storage
static ApplicationData GetForPackageFamily(String packageFamilyName);

/// Get an instance of ApplicationData for the specified unpackaged app for the current user.
[feature(Feature_ApplicationData)]
/// @note This method respects impersonation.
/// @warning The returned instance of ApplicationData does not support LocalCache, PublisherCache or SharedLocal features.
[contract(ApplicationDataContract, 2)]
static ApplicationData GetForUnpackaged(String publisher, String product);

Expand All @@ -95,6 +96,7 @@ namespace Microsoft.Windows.Storage

/// Return the path for the local cache data store not included in backup and restore operations.
/// @note This is equivalent to Windows.Storage.ApplicationData.LocalCacheFolder().Path()
/// @warning This method is not supported if the ApplicationData instance was acquired via GetForUnpackaged().
/// @see https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.localcachefolder
String LocalCachePath { get; };

Expand All @@ -111,6 +113,7 @@ namespace Microsoft.Windows.Storage

/// Return the path for the shared data store.
/// @note This is equivalent to Windows.Storage.ApplicationData.SharedLocalFolder().Path()
/// @warning This method is not supported if the ApplicationData instance was acquired via GetForUnpackaged().
/// @see https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.sharedlocalfolder
String SharedLocalPath { get; };

Expand All @@ -120,6 +123,7 @@ namespace Microsoft.Windows.Storage
String TemporaryPath { get; };

/// Return a StorageFolder for the local cache data store not included in backup and restore operations.
/// @warning This method is not supported if the ApplicationData instance was acquired via GetForUnpackaged().
/// @see https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.localcachefolder
Windows.Storage.StorageFolder LocalCacheFolder { get; };

Expand All @@ -134,6 +138,7 @@ namespace Microsoft.Windows.Storage
Windows.Storage.StorageFolder MachineFolder { get; };

/// Return a StorageFolder for the shared data store.
/// @warning This method is not supported if the ApplicationData instance was acquired via GetForUnpackaged().
/// @see https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.sharedlocalfolder
Windows.Storage.StorageFolder SharedLocalFolder { get; };

Expand All @@ -157,10 +162,12 @@ namespace Microsoft.Windows.Storage

/// Return the specified path of the shared data store for the publisher of the app.
/// @note This is equivalent to Windows.Storage.ApplicationData.GetPublisherCacheFolder(folderName).Path()
/// @warning This method is not supported if the ApplicationData instance was acquired via GetForUnpackaged().
/// @see https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.getpublishercachefolder
String GetPublisherCachePath(String folderName);

/// Return the specified subfolder of the shared data store for the publisher of the app.
/// @warning This method is not supported if the ApplicationData instance was acquired via GetForUnpackaged().
/// @see https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.getpublishercachefolder
Windows.Storage.StorageFolder GetPublisherCacheFolder(String folderName);
}
Expand Down
7 changes: 6 additions & 1 deletion dev/ApplicationData/ApplicationData.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\common</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -16,12 +16,17 @@
<ItemGroup>
<ClCompile Include="$(MSBuildThisFileDirectory)M.W.S.ApplicationData.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)M.W.S.ApplicationDataContainer.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)UnpackagedApplicationData.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)UnpackagedApplicationDataContainer.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(MSBuildThisFileDirectory)M.W.S.ApplicationData.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)M.W.S.ApplicationDataContainer.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)M.W.S.ApplicationDataTelemetry.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)pch.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)UnpackagedApplicationData.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)UnpackagedApplicationDataContainer.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)Validate.h" />
</ItemGroup>
<ItemGroup>
<Midl Include="$(MSBuildThisFileDirectory)ApplicationData.idl" />
Expand Down
15 changes: 15 additions & 0 deletions dev/ApplicationData/ApplicationData.vcxitems.filters
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
<ClCompile Include="$(MSBuildThisFileDirectory)M.W.S.ApplicationDataContainer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)UnpackagedApplicationData.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)UnpackagedApplicationDataContainer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(MSBuildThisFileDirectory)M.W.S.ApplicationData.h">
Expand All @@ -31,6 +37,15 @@
<ClInclude Include="$(MSBuildThisFileDirectory)pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)UnpackagedApplicationData.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)UnpackagedApplicationDataContainer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)Validate.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Midl Include="$(MSBuildThisFileDirectory)ApplicationData.idl" />
Expand Down
14 changes: 13 additions & 1 deletion dev/ApplicationData/ApplicationDataTelemetry.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation and Contributors.
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT license.

#pragma once
Expand Down Expand Up @@ -26,4 +26,16 @@ class ApplicationDataTelemetry : public wil::TraceLoggingProvider
}
CATCH_LOG()
END_ACTIVITY_CLASS();
BEGIN_COMPLIANT_MEASURES_ACTIVITY_CLASS(UnpackagedClearAsync, PDT_ProductAndServicePerformance);
DEFINE_ACTIVITY_START(winrt::Microsoft::Windows::Storage::ApplicationDataLocality locality, winrt::hstring const& publisher, winrt::hstring const& product) noexcept try
{
TraceLoggingClassWriteStart(
UnpackagedClearAsync,
_GENERIC_PARTB_FIELDS_ENABLED,
TraceLoggingInt32(static_cast<std::int32_t>(locality), "Locality"),
TraceLoggingWideString(publisher.c_str(), "Publisher"),
TraceLoggingWideString(product.c_str(), "Product"));
}
CATCH_LOG()
END_ACTIVITY_CLASS();
};
Loading
Loading