Platform SDK: Files and I/O

FileEncryptionStatus

The FileEncryptionStatus function retrieves the encryption status of the specified file.

BOOL FileEncryptionStatus(
  LPCTSTR lpFileName,  // file name
  LPDWORD lpStatus     // encryption status
);

Parameters

lpFileName
[in] Pointer to a null-terminated string that specifies the name of the file.
lpStatus
[out] Pointer to a variable that receives the encryption status of the file. This parameter can be one of the following values.
Value Meaning
FILE_ENCRYPTABLE The file can be encrypted.
FILE_IS_ENCRYPTED The file is encrypted.
FILE_SYSTEM_ATTR The file is a system file. System files cannot be encrypted.
FILE_ROOT_DIR The file is a root directory. Root directories cannot be encrypted.
FILE_SYSTEM_DIR The file is a system directory. System directories cannot be encrypted.
FILE_UNKNOWN The encryption status is unknown. The file may be encrypted.
FILE_SYSTEM_NOT_SUPPORT The file system does not support file encryption.
FILE_USER_DISALLOWED Reserved for future use.
FILE_READ_ONLY The file is a read-only file.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Winbase.h; include Windows.h.
  Library: Use Advapi32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows 2000.

See Also

File Systems Overview, File System Functions, EncryptFile