# IRdChunksList Interface Reference

Inherits IUnknown.

List of all members.

## Public Member Functions
HRESULT | GetNumChunks ([out, retval] RtDWORD *pVal)
HRESULT | GetChunkIID ([in] RtDWORD dwIndex,[out, retval] VARIANT *pvChunkIID)
HRESULT | GetChunkCustId ([in] RtDWORD dwIndex,[out, retval] VARIANT *pvCustId)
HRESULT | GetChunkAddress ([in] RtDWORD dwIndex,[out, retval] VARIANT *pvAddress)
HRESULT | GetChunkLength ([in] RtDWORD dwIndex,[out, retval] VARIANT *pvLength)
HRESULT | GetChunkInfoFlags ([in] RtDWORD dwIndex,[out, retval] VARIANT *pvFlags)
HRESULT | GetChunkInfo ([in] RtDWORD dwIndex,[out] RtChunkListInfo *pChunkListInfo,[out] RtDWORD *pdwFlags)
HRESULT | Clear ()
HRESULT | AddChunkInfo ([in] const RtChunkListInfo *pChunkListInfo,[in] RtDWORD dwFlags)
HRESULT | InsertChunkInfo ([in] RtDWORD dwIndex,[in] const RtChunkListInfo *pChunkListInfo,[in] RtDWORD dwFlags)
HRESULT | SetChunkInfo ([in] RtDWORD dwIndex,[in] const RtChunkListInfo *pChunkListInfo)
HRESULT | SetChunkInfoFlags ([in] RtDWORD dwIndex,[in] RtDWORD dwFlags)
HRESULT | RemoveChunkInfo ([in] RtDWORD dwIndex)
HRESULT | FindChunkByAddr ([in] RtQWORD qwAddress,[in] RtDWORD dwLastInd,[out, retval] RtDWORD *pdwIndex)
HRESULT | FindChunkByIID ([in] IID iidChunk,[in] RtDWORD dwLastInd,[out, retval] RtDWORD *pdwIndex)

## Detailed Description

This chunk allows you fast object scanning for all its chunks. In case of stream/file partial damage, it allows you to extract at least some chunks which survived.

## Member Function Documentation

HRESULT IRdChunksList::GetNumChunks | ( | [out, retval] RtDWORD * | pVal | ) |

Get number of chunks, this Chunks List is not included.

Parameters:

  | pVal | [out, retval] returns total number of chunks.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdChunksList::GetChunkIID | ( | [in] RtDWORD | dwIndex,
|  | [out, retval] VARIANT * | pvChunkIID |
| ) |  |  |

Get chunk IID.

Parameters:

  | dwIndex | [in] index of the chunk.
  | pvChunkIID | [out, retval] returns chunk's IID.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdChunksList::GetChunkCustId | ( | [in] RtDWORD | dwIndex,
|  | [out, retval] VARIANT * | pvCustId |
| ) |  |  |

Get chunk's custom identification (usually used as version).

Parameters:

  | dwIndex | [in] index of the chunk.
  | pvCustId | [out, retval] returns chunk's custom Id.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdChunksList::GetChunkAddress | ( | [in] RtDWORD | dwIndex,
|  | [out, retval] VARIANT * | pvAddress |
| ) |  |  |

Get chunk's start address from beginning of the stream/file.

Parameters:

  | dwIndex | [in] index of the chunk.
  | pvAddress | [out, retval] returns chunk's start address.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdChunksList::GetChunkLength | ( | [in] RtDWORD | dwIndex,
|  | [out, retval] VARIANT * | pvLength |
| ) |  |  |

Get chunk's length in bytes.

Parameters:

  | dwIndex | [in] index of the chunk.
  | pvLength | [out, retval] returns chunk's length.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdChunksList::GetChunkInfoFlags | ( | [in] RtDWORD | dwIndex,
|  | [out, retval] VARIANT * | pvFlags |
| ) |  |  |

Get chunk's flags. The flags are not stored in the stream/file, they indicate only the current chunk's status.
Flags (RdChunksList::ReChunkListInfoFlags):

- RSCHUNK_LST_FLG_MODIFIED (1) - The chunk was modified and its content is different from the one stored in stream/file.
- RSCHUNK_LST_FLG_ERRLOAD (2) - The chunk was written to table, but not found in the stream/file.
- RSCHUNK_LST_FLG_NOT_IN_TABLE (4) - The chunk was found in the stream/file, but was not found in the table.
- RSCHUNK_LST_FLG_INCONSISTENT (8) - The chunk was found in the stream/file and in the table, but are different.
- RSCHUNK_LST_FLG_BAD_SIZE (16)- The chunk was loaded from the stream/file, but size in chunk's header and actual size are different

Parameters:

  | dwIndex | [in] index of the chunk.
  | pvFlags | [out, retval] returns chunk's flags.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdChunksList::GetChunkInfo | ( | [in] RtDWORD | dwIndex,
|  | [out] RtChunkListInfo * | pChunkListInfo,
|  | [out] RtDWORD * | pdwFlags |
| ) |  |  |

Get chunk's info.

Parameters:

  | dwIndex | [in] index of the chunk.
  | pChunkListInfo | [out, retval] returns chunk's info record.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdChunksList::Clear | ( |  | ) |

Clear the list.

Referenced by IMPLEMENT_DISPATCH().

HRESULT IRdChunksList::AddChunkInfo | ( | [in] const RtChunkListInfo * | pChunkListInfo,
|  | [in] RtDWORD | dwFlags |
| ) |  |  |

Add chunk info into the list.

Parameters:

  | pChunkListInfo | [in] pointer of the chunk info structure.
  | dwFlags | [in] flags for the chunk info.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdChunksList::InsertChunkInfo | ( | [in] RtDWORD | dwIndex,
|  | [in] const RtChunkListInfo * | pChunkListInfo,
|  | [in] RtDWORD | dwFlags |
| ) |  |  |

Insert chunk info into the list.

Parameters:

  | dwIndex | [in] Index of the new chunk info.
  | pChunkListInfo | [in] pointer of the chunk info structure.
  | dwFlags | flags for the chunk info.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdChunksList::SetChunkInfo | ( | [in] RtDWORD | dwIndex,
|  | [in] const RtChunkListInfo * | pChunkListInfo |
| ) |  |  |

Replace existing chunk info.

Parameters:

  | dwIndex | [in] Index of the existing chunk info, which will be replaced.
  | pChunkListInfo | [in] pointer of the chunk info structure.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdChunksList::SetChunkInfoFlags | ( | [in] RtDWORD | dwIndex,
|  | [in] RtDWORD | dwFlags |
| ) |  |  |

Replace already existing chunk info flags.

Parameters:

  | dwIndex | [in] Index of the existing chunk info, which will be replaced.
  | dwFlags | [in] New flags.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdChunksList::RemoveChunkInfo | ( | [in] RtDWORD | dwIndex | ) |

Remove chunk info from the list.

Parameters:

  | dwIndex | [in] Index of the chunk into that will be removed.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdChunksList::FindChunkByAddr | ( | [in] RtQWORD | qwAddress,
|  | [in] RtDWORD | dwLastInd,
|  | [out, retval] RtDWORD * | pdwIndex |
| ) |  |  |

Find chunk by its address.

Parameters:

  | qwAddress | [in] Address.
  | dwLastInd | [in] Index where search is to start. Setting to -1 will search from the beginning.
  | pdwIndex | [out, retval] Returns index of the chunk if found. If not found, returns -1.

Returns:
  S_OK if found, S_FALSE if not found.

HRESULT IRdChunksList::FindChunkByIID | ( | [in] IID | iidChunk,
|  | [in] RtDWORD | dwLastInd,
|  | [out, retval] RtDWORD * | pdwIndex |
| ) |  |  |

Find chunk by its IID.

Parameters:

  | IID | [in] chunk identification.
  | dwLastInd | [in] Index where search is to start. Setting to -1 will search from the beginning.
  | pdwIndex | [out, retval] Returns index of the chunk if found. If not found, returns -1.

Returns:
  S_OK if found, S_FALSE if not found.