Share via


ProtectionPolicyManager.IsFileProtectionRequiredForNewFileAsync Method

Definition

Note

Starting in July 2022, Microsoft is deprecating Windows Information Protection (WIP) and the APIs that support WIP. Microsoft will continue to support WIP on supported versions of Windows. New versions of Windows won't include new capabilities for WIP, and it won't be supported in future versions of Windows. For more information, see Announcing sunset of Windows Information Protection.

For your data protection needs, Microsoft recommends that you use Microsoft Purview Information Protection and Microsoft Purview Data Loss Prevention. Purview simplifies the configuration set-up and provides an advanced set of capabilities.

Indicates whether a file needs to be protected by the enterprise identity.

public:
 static IAsyncOperation<bool> ^ IsFileProtectionRequiredForNewFileAsync(IStorageFolder ^ parentFolder, Platform::String ^ identity, Platform::String ^ desiredName);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<bool> IsFileProtectionRequiredForNewFileAsync(IStorageFolder const& parentFolder, winrt::hstring const& identity, winrt::hstring const& desiredName);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<bool> IsFileProtectionRequiredForNewFileAsync(IStorageFolder parentFolder, string identity, string desiredName);
function isFileProtectionRequiredForNewFileAsync(parentFolder, identity, desiredName)
Public Shared Function IsFileProtectionRequiredForNewFileAsync (parentFolder As IStorageFolder, identity As String, desiredName As String) As IAsyncOperation(Of Boolean)

Parameters

parentFolder
IStorageFolder

The folder that contains files that you want to know whether to protect.

identity
String

Platform::String

winrt::hstring

The enterprise identity.

Important

Due to a bug in the current implementation of this property, please pass the enterprise identity to the desiredName parameter.

desiredName
String

Platform::String

winrt::hstring

The name that you would like to give the file.

Important

Due to a bug in the current implementation of this property, please pass this name to the identity parameter.

Returns

true if files in this folder should be protected, otherwise false.

Attributes

Windows requirements

Device family
Windows Desktop Extension SDK (introduced in 10.0.15063.0)
Windows Mobile Extension SDK (introduced in 10.0.15063.0)
API contract
Windows.Security.EnterpriseData.EnterpriseDataContract (introduced in v4.0)

Remarks

See the remarks section of this method: IsFileProtectionRequiredAsync.

Applies to