mmioFlush

The mmioFlush function writes the I/O buffer of a file to disk if the buffer has been written to.

MMRESULT mmioFlush(
  HMMIO hmmio,  
  UINT fuFlush  
);

Parameters

hmmio

File handle of a file opened by using the mmioOpen function.

fuFlush

Flag determining how the flush is carried out. It can be zero or the following.

Value Description
MMIO_EMPTYBUF Empties the buffer after writing it to the disk.

Return Values

Returns zero if successful or an error otherwise. Possible error values include the following.

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

Remarks

Closing a file with the mmioClose function automatically flushes its buffer.

If there is insufficient disk space to write the buffer, mmioFlush fails, even if the preceding calls of the mmioWrite function were successful.

Requirements

**  Windows NT/2000/XP:** Included in Windows NT 3.1 and later.
**  Windows 95/98/Me:** Included in Windows 95 and later.
**  Header:** Declared in Mmsystem.h; include Windows.h.
**  Library:** Use Winmm.lib.

See Also

mmioOpen, mmioClose, mmioWrite