MMRESULT mmioCreateChunk(hmmio, lpck, uFlags) | |||
HMMIO hmmio; | |||
LPMMCKINFO lpck; | |||
UINT uFlags; |
The mmioCreateChunk function creates a chunk in a RIFF file opened with mmioOpen. The new chunk is created at the current file position. After the new chunk is created, the current file position is the beginning of the data portion of the new chunk.
hmmio
Specifies the file handle of an open RIFF file.
lpck
Specifies a pointer to a caller-supplied MMCKINFO structure containing information about the chunk to be created. The MMCKINFO structure should be set up as follows:
The cksize field specifies the size of the data portion of the chunk, including the form type or list type (if any). If this value is not correct when mmioAscend is called to mark the end of the chunk, them mmioAscend will correct the chunk size.
The fccType field specifies the form type or list type if the chunk is a “RIFF” or “LIST” chunk. If the chunk is not a “RIFF” or “LIST” chunk, this field need not be filled in.
The dwDataOffset field need not be filled in. The mmioCreateChunk function will fill this field with the file offset of the data portion of the chunk.
The dwFlags field need not be filled in. The mmioCreateChunk function will set the MMIO_DIRTY flag in dwFlags.
uFlags
Specifies flags to optionally create either a “RIFF” chunk or a “LIST” chunk. Can contain one of the following flags:
Value | Meaning |
MMIO_CREATERIFF | ||
Creates a “RIFF” chunk. | ||
MMIO_CREATELIST | ||
Creates a “LIST” chunk. |
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:
Value | Meaning |
MMIOERR_CANNOTWRITE | Unable to write the chunk header. |
MMIOERR_CANNOTSEEK | Unable to determine offset of data portion of the chunk. |
This function cannot insert a chunk into the middle of a file. If a chunk is created anywhere but the end of a file,mmioCreateChunk will overwrite existing information in the file.