MODM_PREPARE

The MODM_PREPARE message requests a MIDI output driver to prepare a system-exclusive data buffer for output.

Parameters

uDeviceId

Device identifier (0, 1, 2, and so on) for the target device.

uMsg

MODM_PREPARE

dwUser

Device instance identifier.

dwParam1

Pointer to a MIDIHDR structure identifying the buffer. (The MIDIHDR structure is described in the Win32 SDK.)

dwParam2

Size of the MIDIHDR structure.

Return Value

The driver should return MMSYSERR_NOERROR if the operation succeeds. Otherwise it should return one of the MMSYSERR or MIDIERR error codes defined in mmsystem.h. See midiOutPrepareHeader return values in the Win32 SDK.

Comments

A client sends the MODM_PREPARE message by calling the user-mode driver’s modMessage entry point, passing the specified parameters.

Support for this message by user-mode drivers is optional. If the driver supports MODM_PREPARE, it must also support MODM_UNPREPARE.

If the driver returns MMSYSERR_NOTSUPPORTED, winmm.dll prepares the buffer for use. For most drivers, this behavior is sufficient. If the driver does perform buffer preparation, it must set MHDR_PREPARED in the dwFlags member of MIDIHDR and return MMSYSERR_NOERROR.

For additional information, see Transferring MIDI Output Data.