Applications that are performance-sensitive can optimize file I/O performance by directly accessing the file I/O buffer. Exercise care if you choose to do this-by accessing the file I/O buffer directly, you bypass some of the safeguards and error checking provided by the MMIO Manager.
The MMIO functions shown in the following table allow you to support direct I/O buffer access on a file opened for buffered I/O.
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³Function ³Description ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³mmioGetInfo ³Retrieves information on the file I/O buffer ³ ³ ³of a file opened for buffered I/O. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³mmioAdvance ³Fills and empties the contents of an I/O ³ ³ ³buffer of a file set up for direct I/O buffer³ ³ ³access. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³mmioSetInfo ³Changes information on the file I/O buffer of³ ³ ³a file opened for buffered I/O. ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Note: After you call mmioGetInfo, do not call any MMIO functions other than mmioAdvance. You can begin calling MMIO functions again after you call the mmioSetInfo function.
The MMIO Manager uses the MMIOINFO data structure to maintain state information on an open file. The MMIOINFO data structure is defined in the MMIOOS2.H header file as as shown.
typedef struct _MMIOINFO { /* mmioinfo */ ULONG ulFlags; /* Open flags */ FOURCC fccIOProc; /* FOURCC of the IOProc to use */ PMMIOPROC pIOProc; /* Function Pointer to IOProc to use */ ULONG ulErrorRet; /* Extended Error return code */ LONG cchBuffer; /* I/O buff size (if used), Fsize if MEM */ PCHAR pchBuffer; /* Start of I/O buff */ PCHAR pchNext; /* Next char to read or write in buff */ PCHAR pchEndRead; /* Last char in buff can be read + 1 */ PCHAR pchEndWrite; /* Last char in buff can be written + 1 */ LONG lBufOffset; /* Offset in buff to pchNext */ LONG lDiskOffset; /* Disk offset in file */ ULONG aulInfo[4]; /* IOProc specific fields */ LONG lLogicalFilePos; /* Actual file position, buffered or not */ ULONG ulTranslate; /* Translation field */ FOURCC fccChildIOProc; /* FOURCC of Child IOProc */ PVOID pExtraInfoStruct; /* Pointer to a structure of related data */ HMMIO hmmio; /* Handle to media element */ } MMIOINFO;