IFileDataRetriever::GetFileHash

Gets the hash value of the file when hashing is in use.

Syntax

HRESULT GetFileHash(
  BYTE *pbFileHash,
  ULONG *pcbFileHash);

Parameters

  • pbFileHash
    [in, out, size_is(*pcbFileHash), unique] Returns the hash value of the file.

  • pcbFileHash
    [in, out] Specifies the number of bytes in pbFileHash. Returns the number of bytes required to retrieve the ID when pbFileHash is too small, or returns the number of bytes written.

Return Value

  • S_OK

  • E_NOTIMPL if hashing is not being used.

  • E_POINTER

  • E_INVALIDARG

  • HRESULT_FROM_WIN32(ERROR_MORE_DATA) when pbFileHash is too small. In this case, the required number of bytes is returned in pcbFileHash.

Remarks

A hash value is computed for a file and used for conflict detection only when FILESYNC_INIT_FLAG_USE_HASHING is passed to the IFileSyncProvider::Initialize method. For more information, see FILESYNC_INIT_FLAGS Enumeration.

See Also

Reference

IFileDataRetriever Interface