mmioAscend

Syntax

WORD mmioAscend(hmmio, lpck, wFlags)

This function ascends out of a chunk in a RIFF file descended into with mmioDescend or created with mmioCreateChunk.

Parameters

HMMIO hmmio

Specifies the file handle of an open RIFF file.

LPMMCKINFO lpck

Specifies a far pointer to a caller-supplied MMCKINFO structure previously filled by mmioDescend or mmioCreateChunk.

WORD wFlags

Is not used and should be set to zero.

Return Value

The return value is zero if the function is successful. Otherwise, the return value specifies an error code. The error code can be one of the following codes:

MMIOERR_CANNOTWRITE

The contents of the buffer could not be written to disk.

MMIOERR_CANNOTSEEK

There was an error while seeking to the end of the chunk.

Comments

If the chunk was descended into using mmioDescend, then mmioAscend seeks to the location following the end of the chunk (past the extra pad byte, if any).

If the chunk was created and descended into using mmioCreateChunk, or if the MMIO_DIRTY flag is set in the dwFlags field of the MMCKINFO structure referenced by lpck, then the current file position is assumed to be the end of the data portion of the chunk. If the chunk size is not the same as the value stored in the cksize field when mmioCreateChunk was called, then mmioAscend corrects the chunk size in the file before ascending from the chunk. If the chunk size is odd, mmioAscend writes a null pad byte at the end of the chunk. After ascending from the chunk, the current file position is the location following the end of the chunk (past the extra pad byte, if any).

See Also

mmioDescend, mmioCreateChunk, MMCKINFO