To perform I/O procedures on a new or existing RIFF compound file, an application issues the mmioCFOpen function. This function constructs a CTOC in memory for a RIFF compound file. Specify the pmmiocfinfo parameter to identify a pointer to a user-supplied CTOC header structure containing optional header information. The pmmiocfinfo parameter can be NULL if the default values of the fields are sufficient. You can also specify the pmmioinfo parameter, which identifies a pointer to a user-supplied info structure containing optional open information that is passed to mmioOpen.
The ulFlags options for mmioCFOpen include the following.
┌────────────────────┬─────────────────────────────────────────────┐ │Flag │Description │ ├────────────────────┼─────────────────────────────────────────────┤ │MMIO_READ │Opens a file for reading only (default). │ ├────────────────────┼─────────────────────────────────────────────┤ │MMIO_WRITE │Opens a file for writing only. │ ├────────────────────┼─────────────────────────────────────────────┤ │MMIO_READWRITE │Opens a file for both reading and writing. │ ├────────────────────┼─────────────────────────────────────────────┤ │MMIO_CREATE │Creates a new file. │ ├────────────────────┼─────────────────────────────────────────────┤ │MMIO_EXCLUSIVE │Opens a file with exclusive mode, denying │ │ │other processes both read and write access to│ │ │the file. │ ├────────────────────┼─────────────────────────────────────────────┤ │MMIO_DENYWRITE │Opens a file and denies other processes write│ │ │access to the file. │ ├────────────────────┼─────────────────────────────────────────────┤ │MMIO_DENYREAD │Opens a file and denies other processes read │ │ │access to the file. │ ├────────────────────┼─────────────────────────────────────────────┤ │MMIO_DENYNONE │Opens a file without denying other processes │ │ │read or write access to the file. │ └────────────────────┴─────────────────────────────────────────────┘
If the file does not exist, an error is returned unless you specified the MMIO_CREATE option. If the file exists but is not a RIFF compound file, the system returns an error, regardless of whether or not you specified MMIO_CREATE.
The access and sharing flags are maintained only within the set of compound file (CF) functions. If the RIFF compound file or elements are accessed without using the CF functions, the access and sharing modes are unpredictable. An mmioOpen function with a fully qualified element name is considered a CF function since it internally calls mmioCFOpen, thus the flags are predictable in that case.