-api-id | -api-type |
---|---|
M:Windows.Security.EnterpriseData.FileRevocationManager.CopyProtectionAsync(Windows.Storage.IStorageItem,Windows.Storage.IStorageItem) |
winrt method |
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.
Note
FileRevocationManager may be unavailable for releases after Windows 10. Instead, use FileProtectionManager.
Copy the selective wipe protection state of a file or folder to a new file or folder.
The source item to copy the selective wipe protection status from.
The target item to copy the selective wipe protection status to.
true if the copy operation was successful; otherwise false.
If you save a new copy of a file as the result of a "save as" operation, the selective wipe protection status is not copied with the file. To protect the file, you must call the CopyProtectionAsync method to copy the existing protection status to the new file. If you copy a protected file using the CopyAsync or CopyAndReplaceAsync methods, the selective wipe protection status is copied with the file and you do not need to call the CopyProtectionAsync method.
[!code-csharp_CopyProtection]
The CopyProtectionAsync method requires exclusive access to the file or folder being encrypted, and will fail if another process is using has a handle open to the file or folder.
FileRevocationManager sample, How to protect files with Selective Wipe (C#/VB/C++)