Share via


IFilterKeyMap::Serialize

Serializes the filter key map data to a byte array.

Syntax

HRESULT Serialize(
  BYTE * pbFilterKeyMap,
  DWORD * pcbFilterKeyMap);

Parameters

  • pbFilterKeyMap
    [in, out, unique, size_is(*pcbFilterKeyMap)] The byte array that receives the serialized data.

  • pcbFilterKeyMap
    [in, out] Specifies the number of bytes in pbFilterKeyMap. Returns the number of bytes required to serialize the filter key map data when pbFilterKeyMap is too small, or returns the number of bytes written.

Return Value

  • S_OK.

  • E_INVALIDARG when a filter stored in the map reports that it successfully serialized itself, but the number of bytes written does not match the size of the filter.

  • E_POINTER.

  • E_OUTOFMEMORY.

  • HRESULT_FROM_WIN32(ERROR_MORE_DATA) when pbFilterKeyMap is too small. In this situation, the required number of bytes is returned in pcbFilterKeyMap.

Remarks

To serialize the filters contained in the filter key map, this method first obtains the sizes of the filters by calling ISyncFilter::Serialize on each filter, specifying NULL for the byte array parameter. The filters are then serialized by calling ISyncFilter::Serialize on each filter again. When the number of bytes written to the byte array for a filter do not match the size of the filter reported by the first call to ISyncFilter::Serialize, serialization is canceled and E_INVALIDARG is returned.

See Also

Reference

IFilterKeyMap Interface