Platform SDK: Files and I/O

RemoveUsersFromEncryptedFile

The RemoveUsersFromEncryptedFile function removes specified certificate hashes from a specified file.

DWORD RemoveUsersFromEncryptedFile(
  LPCWSTR lpFileName,                        // file name
  PENCRYPTION_CERTIFICATE_HASH_LIST pHashes  // hash list
);

Parameters

lpFileName
[in] Pointer to a null-terminated Unicode string that specifies the name of the file.
pHashes
[in] Pointer to an ENCRYPTION_CERTIFICATE_HASH_LIST structure that contains a list of certificate hashes to be removed from the file.

Return Values

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a Win32 error code. For a complete list of error codes, see Error Codes or the Platform SDK header file WinError.h.

Remarks

The RemoveUsersFromEncryptedFile function removes the specified certificate hashes if they exist in the specified file. If any of the certificate hashes are not found in the specified file, they are ignored and no error code is returned.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Winefs.h; include Windows.h.
  Library: Use Advapi32.lib.

See Also

File Systems Overview, File System Functions, ENCRYPTION_CERTIFICATE_HASH_LIST