Windows desktop applications
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FileRevocationManager.CopyProtectionAsync | copyProtectionAsync method

[FileRevocationManager may be unavailable for releases after Windows 10. Instead, use FileProtectionManager.]

Note  Enterprise data protection (EDP) policy cannot be applied on Windows 10.
 

Copy the selective wipe protection state of a file or folder to a new file or folder.

Syntax


Windows.Security.EnterpriseData.FileRevocationManager.copyProtectionAsync(sourceStorageItem, targetStorageItem).done( /* Your success and error handlers */ );

Parameters

sourceStorageItem

Type: IStorageItem

The source item to copy the selective wipe protection status from.

targetStorageItem

Type: IStorageItem

The target item to copy the selective wipe protection status to.

Return value

Type: IAsyncOperation<Boolean>

True if the copy operation was successful; otherwise false.

Remarks

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.


function copyFile(file, newFolder) {
    file.copyAsync(newFolder).then(
        function (newFile) {
            Windows.Security.EnterpriseData.FileRevocationManager.
                copyProtectionAsync(file, newFile);
        },
        function (err) {
            // Handle error. For example, copy already exists.
        });
}


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.

Requirements (Windows 10 device family)

Device family

Desktop, introduced version 10.0.10240.0
Mobile, introduced version 10.0.10240.0

API contract

Windows.Security.EnterpriseData.EnterpriseDataContract, introduced version 1.0

Namespace

Windows.Security.EnterpriseData
Windows::Security::EnterpriseData [C++]

Metadata

Windows.Security.EnterpriseData.EnterpriseDataContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

None supported

Namespace

Windows.Security.EnterpriseData
Windows::Security::EnterpriseData [C++]

Metadata

Windows.winmd

See also

FileRevocationManager
FileRevocationManager sample
How to protect files with Selective Wipe (C#/VB/C++)
How to protect files with Selective Wipe (JavaScript)

 

 

Show:
© 2016 Microsoft