IItemMetadata::TryGetFieldByteArray

Gets the value of a byte array field.

HRESULT TryGetFieldByteArray(
  LPCWSTR pcszFieldName,
  BYTE * pbValue,
  ULONG * pcbValue);

Parameters

  • pcszFieldName
    [in, string] The name of the field.
  • pbValue
    [in, out, unique, size_is(* pcbValue)] Returns the value of the specified field.
  • pcbValue
    [in, out] Specifies the number of bytes in pbValue. Returns the number of bytes required to retrieve the specified field value when pbValue is too small; otherwise, returns the number of bytes written.

Return Value

  • S_OK.

  • S_FALSE if the value has not been set or if it has been set to NULL.

  • E_POINTER.

  • E_INVALIDARG.

  • SYNC_E_METADATA_FIELD_INVALID_NAME if the field does not exist.

  • SYNC_E_METADATA_FIELD_INVALID_TYPE if the field is not a byte array.

  • HRESULT_FROM_WIN32(ERROR_MORE_DATA) when pbValue is not large enough to receive the field value. In this situation, pcbValue returns the required number of bytes.

Remarks

Custom fields must be defined by using a CUSTOM_FIELD_DEFINITION structure when the replica metadata is first initialized.

If IItemMetadata::SetFieldByteArray was called to set the field value, but the change has not yet been saved by a call to IReplicaMetadata::SaveItemMetadata, TryGetFieldByteArray returns the value that is contained in the IItemMetadata object and not the value that is stored in the metadata store.

See Also

Reference

IItemMetadata Interface