If the pmmioinfo parameter is provided the following fields must be filled in by the caller as described:
fccIOProc - If this field is not NULL, it is the four character code of an installed I/O procedure that will handle I/O. If fccIOProc and pIOProc are NULL, mmioOpen determines which I/O procedure to use based on the syntax of the pszFileName parameter. (See description of pszFileName.) If fccIOProc is NULL, but pIOProc is not NULL, the custom I/O procedure (pIOProc) is used. This I/O procedure does not need to be installed using mmioInstallIOProc.
The following I/O procedure identifiers are defined:
FOURCC_DOS
If MMIO_CREATE or MMIO_APPEND is specified when opening an element, the system automatically accesses the element as exclusive until the element is closed.
The pIOProc field uses a custom I/O procedure defined in this field. Set the fccIOProc field to NULL, and set the pIOProc field to the address of the custom I/O procedure to use. Otherwise, pIOProc must be zero.
cchBuffer specifies the size of the memory block to use as an I/O buffer or as a memory file. See descriptions of pchBuffer and the MMIO_ALLOCBUF flag for more information.
The pchBuffer field points to a caller-provided memory buffer to use as an I/O buffer or as a memory file. The cchBuffer field must be the size of the buffer. If the caller-provided memory buffer is not provided, pchBuffer must be NULL.
To open a memory file that performs I/O on an already allocated memory block, set the pszFileName parameter to NULL, the fccIOProc field to FOURCC_MEM, the pchBuffer field to point to the memory buffer, the cchBuffer field to the size of the memory buffer, the ulOpenFlags parameter to MMIO_READWRITE (plus MMIO_CREATE if the memory file is initially empty), and set all other fields of the MMIOINFO structure passed in the pmmioinfo parameter to zero.
For example, to open a memory file that is initially 32KB in size, but can be expanded at least 16KB at a time:
Initially this file will be empty.
A system-allocated memory buffer must be opened as MMIO_READWRITE, which is the default for that case. If this does not happen, the open-a-memory file process fails.
If both a user buffer is specified, and an expansion size is requested, the open-a-memory file process fails because it is not possible to later expand the buffer size in this situation.
As with DOS file handles, different applications cannot share a single hmmio. In other words, MMIO handles (HMMIO) are unique to a process.