An application can access the I/O buffer directly, as follows:
Call mmioGetInfo. The pchNext field of the MMIOINFO structure is a pointer to the next byte that can be read from or written to.
To read directly from the buffer, the application reads from the location pointed to by pchNext up to (but not including) the location pointed to by the pchEndRead pointer.
To write directly to the buffer, the application writes to the location pointed to by pchNext up to (but not including) the location pointed to by the pchEndWrite pointer.
Once pchNext is modified, do not call any MMIO functions (except for mmioAdvance) until mmioSetInfo is called. In particular, do not call mmioRead and mmioWrite. Once mmioSetInfo is called, the caller must stop accessing the I/O buffer directly, and revert to using mmioRead and mmioWrite to read and write the file.
To read beyond pchEndRead or write beyond pchEndWrite, call mmioAdvance to read and write the contents of the next full buffer. mmioAdvance will adjust various fields in your MMIOINFO block, including pchNext, pchEndRead, and pchEndWrite.
Before calling mmioAdvance or mmioSetInfo, make sure you set the MMIO_DIRTY flag of the ulFlags field of the MMIOINFO structure passed in the pmmioinfo parameter if you have written to the buffer. Otherwise, the buffer contents will not get written to the disk.
The caller must not move pchNext backward. No fields other than pchNext and the MMIO_DIRTY flag of ulFlags are to be modified.