mmioDescend(3mms) — Subroutines
Name
mmioDescend --- Descend into a RIFF file chunk beginning at the current file position or search for a specified chunk
Syntax
#include <mme/mme_api.h>
MMRESULT APIENTRY mmioDescend(HMMIO hmmio,
LPMMCKINFO lpck,
LPMMCKINFO lpckParent,
UINT uFlags);
Arguments
HMMIO hmmio
Specifies the file handle to an open RIFF file.
LPMMCKINFO lpck
Specifies a pointer to an MMCKINFO data structure to be filled by the mmioDescend function.
MMCKINFO lpckParent
Specifies a pointer to an optional MMCKINFO data structure that identifies the parent of the chunk being searched. A parent of a chunk is the enclosing chunk; only RIFF and LIST chunks can be parents.
If the lpckParent argument is not NULL, then the mmioDescend function assumes that the MMCKINFO data structure it references was filled when the mmioDescend function was called to descend into the parent chunk. In this case, the mmioDescend function searches only for a chunk within the parent chunk. Set the lpckParent argument to NULL if no parent is being specified.
UINT uFlags
Specifies search options for a chunk. If no flags are specified, mmioDescend descends into the chunk at the current file position. The following flags are defined:
MMIO_FINDCHUNK
Searches for a chunk with the specified chunk ID.
MMIO_FINDRIFF
Searches for a chunk with chunk ID RIFF and with the specified form type.
MMIO_FINDLIST
Searches for a chunk with chunk ID LIST and with the specified form type.
Description
The mmioDescend function descends into a RIFF file chunk beginning at the current file position or searches for a specified chunk. When using the mmioDescend function to search for a chunk, position the file at the beginning of the chunk before calling the mmioDescend function. The search begins at the current file position and continues to the end of the file. If a parent chunk is specified, the file position should be within the parent chunk before calling the mmioDescend function. The search begins at the current file position and continues to the end of the parent chunk.
If the mmioDescend function is unsuccessful in searching for a chunk, the current file position is undefined. If the mmioDescend function is successful, the current file position is changed. If the chunk is a RIFF or LIST chunk, the new file position is immediately after the form or list type (12 bytes from the beginning of the chunk). For other chunks, the new file position is at the start of the data portion of the chunk (8 bytes from the beginning of the chunk).
Extensions
None.
Return Values
Returns MMSYSERR_NOERROR if the function is successful; otherwise, it returns the following error code:
MMIOERR_CHUNKNOTFOUND@T{ The end of the file or the end of the parent chunk was reached before the chunk was found. T}
See Also
mmioAscend(3mms), mmioCreateChunk(3mms), mmioFOURCC(3mms) mmioStringToFOURCC(3mms)