[This is preliminary documentation and subject to change.]
The DecryptFile function decrypts a file or directory that was encrypted using the EncryptFile function.
BOOL DecryptFile(
LPCTSTR lpFileName,
DWORD dwReserved
);
The caller must have FILE_READ_DATA, FILE_WRITE_DATA, FILE_READ_ATTRIBUTES, FILE_WRITE_ATTRIBUTES, and SYNCHRONIZE access to the file.
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.
The DecryptFile function requires exclusive access to the file being decrypted, and will fail if another process is using the file. If the file is not encrypted, DecryptFile simply returns a nonzero value, which indicates success.
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
File Systems Overview, File System Functions, EncryptFile