The MODM_DATA message requests a MIDI output driver to send a single MIDI short message.
Parameters
uDeviceId
Device identifier (0, 1, 2, and so on) for the target device.
uMsg
MODM_DATA
dwUser
Device instance identifier.
dwParam1
A MIDI short message. (See Comments section below.)
dwParam2
Not used.
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 midiOutShortMsg return values in the Win32 SDK.
Comments
A client sends the MODM_DATA message by calling the user-mode driver’s modMessage entry point, passing the specified parameters.
This message is used for the output of all MIDI events, except system-exclusive events. System-exclusive events are output with the MODM_LONGDATA message.
Because the client can employ running status, and because MIDI short messages have varying lengths, the user-mode driver must parse the dwParam1 parameter to determine the number of bytes to send to the kernel-mode driver. Unused bytes in dwParam1 are not guaranteed to be zero.
The driver can be designed to run synchronously, not returning until it sends the message, or asynchronously, returning immediately and sending the MIDI data in the background, using a separate thread.
Typically, the user-mode driver sends the message to the kernel-mode driver by calling DeviceIoControl with an IOCTL_MIDI_PLAY control code.