MMIOM_TEMPCHANGE
Appearance
The MMIOM_TEMPCHANGE message is sent to a Multimedia I/O (MMIO) procedure to shift its operating state into a non-destructive transaction mode. Once received, the I/O procedure handles all subsequent data alterations or MMIOM_WRITE requests as transient, uncommitted changes—typically by redirecting modifications into an isolated temporary scratch file.
Syntax
rc = mmioSendMessage(hmmio, MMIOM_TEMPCHANGE, (LONG)pszTempDirectory, lParam2);
Parameters
- pmmioinfo (PMMIOINFO)
- A pointer to an MMIOINFO data structure maintaining the current runtime state of the open file channel.
- usMsg (USHORT)
- The message identifier, set to `MMIOM_TEMPCHANGE`.
- lParam1 (LONG)
- A pointer to a null-terminated string (`pszTempDirectory`) specifying the target directory path where the I/O procedure should allocate and maintain its temporary file buffers.
- lParam2 (LONG)
- This parameter is not used.
Return Value
- rc (ULONG)
- Return codes indicating success or isolation failures:
- MMIO_SUCCESS: The file context successfully entered transient editing mode and is isolating subsequent writes.
- MMIO_ERROR: The operation failed (e.g., the specified temporary directory is invalid, read-only, or has insufficient disk space).
Remarks
- **Transactional Isolation**: This message alters the behavior of the standard teardown lifecycle. When an application invokes mmioClose (or issues MMIOM_CLOSE), any modifications made after an MMIOM_TEMPCHANGE handshake are discarded completely, leaving the original source file intact.
- **Committing Changes**: To solidify edits made during a temporary recording mode, the calling application must explicitly dispatch an MMIOM_SAVE message *prior* to closing the file handle.
- **Scratch File Creation**: The I/O procedure uses the directory path supplied in lParam1 to seed standard file creation logic, building an anonymous binary swap file to cache incoming delta-writes. It is the responsibility of the I/O procedure to clean up and delete this scratch asset when the primary file channel terminates.