The MIDM_PREPARE message requests a MIDI input driver to prepare a system-exclusive data buffer for input.
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 midiInPrepareHeader return values in the Win32 SDK.
A client sends the MIDM_PREPARE message by calling the user-mode driver’s midMessage entry point, passing the specified parameters.
Support for this message by user-mode drivers is optional. If the driver supports MIDM_PREPARE, it must also support MIDM_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 Input Data.