MODM_LONGDATA - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// mmddk.h

DWORD modMessage(
   UINT      uDeviceID,
   UINT      uMsg,
   DWORD_PTR dwUser,
   DWORD_PTR dwParam1,
   DWORD_PTR dwParam2
);
View the official Windows hardware development documentation

NtDoc

No description available.

Windows hardware development documentation (modm-longdata)

MODM_LONGDATA function

WINMM sends the MODM_LONGDATA message to the modMessage function of a MIDI output driver when a client application wants the driver to make a data block available as output. This data block typically contains one or more MIDI events, including system-exclusive events. If the data block contains more than one MIDI event, the events are packed into the data block with no padding.

If a client of the MIDI output driver wants to send a single MIDI event, it is more efficient to use the MODM_DATA message.

Parameters

Return value

The modMessage function returns MMSYSERR_NOERROR if the operation is successful. Otherwise, it returns one of the error messages in the following table.

Return code Description
MMSYSERR_NOTENABLED The driver failed to load or initialize.
MIDIERR_UNPREPARED The specified data block has not been prepared.
MIDIERR_NOTREADY The MIDI hardware is busy processing other data.

Remarks

The driver must first check the MHDR_PREPARED bit in the dwFlags field of the MIDIHDR structure. If the bit is not set, the driver must return MIDIERR_UNPREPARED. The driver must also clear the MHDR_DONE bit, set the MHDR_INQUEUE bit, and place the data block in its output queue. Then the driver must return control to the client by returning MMSYSERR_NOERROR.

After the data block has been sent as an output, the driver must set the MHDR_DONE bit and clear the MHDR_INQUEUE bit before it notifies the client by using DriverCallback to send a MOM_DONE message.

The driver developer can design the driver to not return until the message has been sent to the output device. Alternatively, the driver can return immediately, but work in the background to send the MIDI data as output. The driver must maintain MIDI status across multiple MODM_DATA and MODM_LONGDATA calls.

Requirements

Target platform Desktop
Version Available in Windows XP and later Windows operating systems.
Header Mmddk.h (include Mmddk.h, Mmsystem.h, or Windows.h)

See also

modMessage

MIDIHDR

DriverCallback

MOM_DONE