Jump to content

MMIOM_WRITE

From EDM2

The MMIOM_WRITE message is sent to a Multimedia I/O (MMIO) procedure by the mmioWrite function to request that a specified number of bytes be written to an open file, device, or element stream from a caller-supplied source buffer.

Syntax

bytesWritten = mmioSendMessage(hmmio, MMIOM_WRITE, (LONG)pBuffer, bytesToWrite);

Parameters

pmmioinfo (PMMIOINFO)
A pointer to an MMIOINFO data structure maintaining the runtime state of the open file channel. The I/O procedure updates state tracking metrics, such as `lDiskOffset`, during the execution of the write loop.
usMsg (USHORT)
The message identifier, set to `MMIOM_WRITE`.
lParam1 (LONG)
A pointer to the source memory data buffer (`PCHAR`) containing the bytes that need to be committed to the file stream.
lParam2 (LONG)
The total number of bytes requested to be written from the source buffer.

Return Value

rc (ULONG)
Returns transaction metrics or error states:
  • Greater than or equal to 0: The exact number of bytes successfully written to the underlying storage media from the buffer.
  • MMIO_ERROR: The write operation failed due to a device collision, physical disk space limitation, file system access fault, or buffer breach.

Remarks

  • **Data Translation and Formats**: If a format-specific conversion mode (such as `MMIO_TRANSLATEDATA`) was established during the file initialization phase, the target I/O procedure handles the abstract translation overhead. It processes the standardized presentation layout incoming from the caller buffer and serializes it into the proprietary compressed or chunked structural encoding format expected on physical media.
  • **Seek Pointer Advancement**: Following a successful write block commit, the I/O procedure is strictly responsible for advancing the internal storage tracking marker (`lDiskOffset` inside the MMIOINFO block) forward by the exact byte length returned in rc. This mechanism preserves file pointer synchronization for sequential multi-part output logic.
  • **Transient Isolation Interaction**: If the file context has previously been configured with an MMIOM_TEMPCHANGE instruction, the data processed by an **MMIOM_WRITE** request is isolated into an external temporary file layer rather than being appended or committed directly into the primary input source handle.

Related Functions

Related Messages