MMIOM_SETHEADER
Appearance
The MMIOM_SETHEADER message is sent to a Multimedia I/O (MMIO) procedure by the mmioSetHeader function to supply and write media-specific configuration headers (such as resolution, color tables, sampling rates, or clip durations) into an open file or compound element container.
Syntax
bytesWritten = mmioSendMessage(hmmio, MMIOM_SETHEADER, (LONG)pHeaderBuffer, headerLength);
Parameters
- pmmioinfo (PMMIOINFO)
- A pointer to an MMIOINFO data structure maintaining the runtime state of the open file channel. If the validation check fails, the procedure logs errors here.
- usMsg (USHORT)
- The message identifier, set to `MMIOM_SETHEADER`.
- lParam1 (LONG)
- A pointer to a caller-allocated memory buffer containing the complete, pre-populated media presentation header data structure.
- lParam2 (LONG)
- The exact length, in bytes, of the header structure supplied in lParam1.
Return Value
- rc (ULONG)
- Returns transaction metrics or error state indicators:
- Greater than 0: Successful completion; returns the exact number of bytes successfully initialized or written into the target header block.
- 0: The structural update failed, or a write error occurred.
- Structural Exception: If the internal data layout or magic signatures are malformed, the I/O procedure sets the `ulErrorRet` field of the MMIOINFO structure to `MMIOERR_INVALID_STRUCTURE`.
Remarks
- **Handle Requirement**: Executing this message requires a valid, active `hmmio` file handle previously initialized via a successful MMIOM_OPEN transaction sequence.
- **Standard Presentation Format**: The input parameters passed into lParam1 must represent the standardized OS/2 MMIO **presentation format** rather than the literal, bitwise raw layout found on disk. The I/O procedure assumes the responsibility of translating this abstract logical definition into the proprietary physical format required by the targeted media container codec. Depending on the media type, lParam1 points to standard structures such as:
- MMIMAGEHEADER (Canvas metrics, bit depth, and color palette records)
- MMAUDIOHEADER (Sampling rate, audio channels, and quantization bit sizes)
- MMMIDIHEADER (Track count allocations and timing division configurations)
- MMMOVIEHEADER / MMVIDEOHEADER (Digital video stream layouts and cinematic frame arrays)