MODM_PREPARE - 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-prepare)

MODM_PREPARE function

WINMM sends the MODM_PREPARE message to the modMessage function of a MIDI output driver to request that the driver configure a system-exclusive data block for output. If data blocks are accessed at interrupt time, they must be page-locked to ensure that the memory is not swapped out to disk.

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.
MMSYSERR_NOTSUPPORTED The driver does not support this message.

Remarks

Driver support for this message is optional. If a driver supports this message, it must also support MODM_UNPREPARE.

The default response for this message is to return MMSYSERR_NOTSUPPORTED. In this case, WINMM converts the memory segment to page-locked memory for the driver. If a driver has to perform other operations so that it can prepare a data block for output, it must set the MHDR_PREPARED bit in the dwFlags field of the MIDIHDR structure and return MMSYSERR_NOERROR. In this case, WINMM assumes the driver has prepared the data block and does not page-lock the memory.

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

MODM_UNPREPARE