Jump to content

MMIOM_BEGININSERT

From EDM2

The MMIOM_BEGININSERT message is sent to a Multimedia I/O (MMIO) procedure to request that the file expand dynamically to insert new data. When an I/O procedure receives this message, it changes its writing mode so that subsequent `mmioWrite` calls insert data at the current file position rather than overwriting existing data.

Syntax

rc = mmioSendMessage(hmmio, MMIOM_BEGININSERT, lParam1, lParam2);

Parameters

pmmioinfo (PMMIOINFO)
A pointer to an MMIOINFO data structure maintaining the current state of the open file.
usMsg (USHORT)
The message identifier, set to `MMIOM_BEGININSERT`.
lParam1 (LONG)
This parameter is not used.
lParam2 (LONG)
This parameter is not used.

Return Value

rc (ULONG)
Return codes indicating success or the type of failure:
  • MMIO_SUCCESS: The I/O procedure successfully transitioned the file into insert mode.
  • MMIO_ERROR: An error occurred, and the file remains in its previous writing mode.

Remarks

By default, standard file operations overwrite downstream data when writing to an arbitrary position within a file.

  • Behavior Change: Sending MMIOM_BEGININSERT shifts the I/O procedure's state. Any data written after this message pushes the existing downstream data further down the file, expanding the file size dynamically.
  • Ending Insert Mode: To return to standard overwriting or appending behavior, the application must send a balancing MMIOM_ENDINSERT message.
  • Custom I/O Procedures: If you are writing a custom I/O procedure for a specialized file format (such as a custom audio or video wrapper), your procedure must implement this message to support editing operations that require non-destructive insertion.

Related Functions

Related Messages