MMIOM_SAVE
Appearance
The MMIOM_SAVE message is sent to a Multimedia I/O (MMIO) procedure to request that all temporary data modifications, edits, or memory-buffered adjustments currently applied to the open file context be committed permanently to physical storage.
Syntax
rc = mmioSendMessage(hmmio, MMIOM_SAVE, (LONG)pszNewFileName, lParam2);
Parameters
- pmmioinfo (PMMIOINFO)
- A pointer to an MMIOINFO data structure maintaining the current state of the open file channel.
- usMsg (USHORT)
- The message identifier, set to `MMIOM_SAVE`.
- lParam1 (LONG)
- An optional pointer to a null-terminated string (`pszFileName`) specifying a new target destination path. If provided, the storage engine treats the operation as a "Save As" transaction.
- lParam2 (LONG)
- This parameter is not used.
Return Value
- rc (ULONG)
- Return codes indicating success or failure:
- MMIO_SUCCESS: The changes were successfully committed, and the file has been saved to disk.
- MMIO_ERROR: An error occurred while writing to storage or serializing the file components.
Remarks
- **Commit-on-Demand Architecture**: For I/O procedures implementing transactional or memory-cached editing models (such as audio waveforms held in temporary scratch files), modifications are not written directly back to the original file source. Sending MMIOM_SAVE flushes these dynamic data buffers and solidifies the changes.
- **"Save As" Logic**: If a non-null string pointer is supplied in lParam1, the I/O procedure must redirect its output stream encoder to create and populate this newly specified filename path instead of overwriting the original file handle resource.