Jump to content

MMIOM_CLOSE

From EDM2

The MMIOM_CLOSE message is sent to a Multimedia I/O (MMIO) procedure to request that an open file or media element be closed. This message is triggered behind the scenes when an application invokes the `mmioClose` function.

Syntax

rc = mmioSendMessage(hmmio, MMIOM_CLOSE, 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_CLOSE`.
lParam1 (LONG)
Contains the flags passed down from the usFlags parameter of mmioClose. Common options include:
  • MMIO_FHOPEN: Re-wraps or manages an existing OS/2 file handle instead of breaking the connection entirely.
lParam2 (LONG)
This parameter is not used.

Return Value

rc (ULONG)
Return codes indicating the state of the operation:
  • MMIO_SUCCESS: The specified file was closed successfully.
  • MMIO_ERROR: An error occurred, and the file cleanup could not be finalized.
  • MMIO_WARNING: The file was closed, but the I/O procedure encountered an unexpected state (e.g., missing chunks or trailing data sections that were expected).

Remarks

  • Cleanup Strategy: When an I/O procedure catches this message, it must flush out any leftover memory caches, finalize the structural integrity of media chunks (such as RIFF headers), and release the system resources bound to the instance.
  • Warning Handling: A return value of `MMIO_WARNING` is distinct from a hard failure. It signals that while the file handle has been safely released, the media layout might be truncated or structurally incomplete because the expected data block payloads were not fully written before the close request.

Related Functions