Jump to content

MMIOM_QUERYHEADERLENGTH

From EDM2


The MMIOM_QUERYHEADERLENGTH message is sent to a Multimedia I/O (MMIO) procedure to ascertain the exact size, in bytes, of the header structure associated with the current file or compound file element. This allows calling applications to dynamically allocate an appropriately sized memory buffer before requesting the full header payload.

Syntax

headerLength = mmioSendMessage(hmmio, MMIOM_QUERYHEADERLENGTH, 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_QUERYHEADERLENGTH`.
lParam1 (LONG)
This parameter is not used.
lParam2 (LONG)
This parameter is not used.

Return Value

rc (ULONG)
Returns structural size metrics:
  • Greater than 0: Successful completion; returns the size of the header structure in bytes.
  • 0: The inquiry failed, or the I/O procedure could not determine the header size.

Remarks

  • **Buffer Allocation Synergy**: This message is designed to be paired directly with MMIOM_GETHEADER. By querying the length first, an application guarantees that the buffer pointer passed to a subsequent get request will fulfill the size constraints, avoiding `MMIOERR_INVALID_BUFFER_LENGTH` exceptions.
  • **Header Translation Context**: If translation modes are enabled, the I/O procedure must return the byte size of the standard *presentation* format structure rather than the physical size of the raw header on disk. For instance, the length returned should match the sizing layout of platform structures such as:
  • MMIMAGEHEADER (Includes image canvas metrics and space for a 256-color palette)
  • MMAUDIOHEADER (Tracks sampling rates, channels, and structural audio metrics)
  • MMMIDIHEADER (Defines MIDI track allocations and format constraints)
  • MMMOVIEHEADER / MMVIDEOHEADER (Encapsulates digital video framing profiles and canvas parameters)

Related Functions

Related Messages