共用方式為


2.3.72 FSCTL_SET_ENCRYPTION Reply

This message returns the results of the FSCTL_SET_ENCRYPTION request. If the file system of the volume containing the specified file or directory does not support encryption, the request MUST NOT succeed. The error code returned in this situation varies, depending on the file system.

This message returns a status code, as specified in section 2.2, as well as a DECRYPTION_STATUS_BUFFER (section 2.3.72.1) if an output buffer is passed in.

Upon success, the status code returned by the function that processes this FSCTL is STATUS_SUCCESS<71>. The most common error codes are listed in the following table.

 Error code

 Meaning

STATUS_MEDIA_WRITE_PROTECTED

0xC00000A2

The disk cannot be written to because it is write-protected.

STATUS_INVALID_PARAMETER

0xC000000D

The EncryptionOperation field value is invalid, the open request is not for a file or directory or stream encryption has been requested on a stream that is compressed.

STATUS_BUFFER_TOO_SMALL

0xC0000023

The size of the input buffer is less than the size of the encryption buffer structure defined in section 2.3.71, or an output buffer is present and is smaller than a DECRYPTION_STATUS_BUFFER structure.

STATUS_VOLUME_NOT_UPGRADED

0xC000029C

The version of the file system on the volume does not support encryption.<72>

STATUS_INVALID_DEVICE_REQUEST

0xC0000010

The request was invalid for a system-specific reason.<73>

STATUS_FILE_CORRUPT_ERROR

0xC0000102

A required attribute is missing from a directory for which encryption was requested.<74>

STATUS_VOLUME_DISMOUNTED

0xC000026E

The volume is not mounted.

STATUS_INVALID_USER_BUFFER

0xC00000E8

An exception was raised while accessing a user buffer.