When you finish accessing a file I/O buffer, pass the MMIOINFO structure filled by mmioGetInfo to mmioSetInfo to terminate direct-buffer access. If you wrote to the buffer, set the MMIO_DIRTY flag in the dwFlags field of the MMIOINFO structure before calling mmioSetInfo. Otherwise, the buffer will not be flushed to disk.