MIDM_UNPREPARE

The MIDM_UNPREPARE message requests a MIDI input driver to remove the buffer preparation that was performed in response to a MIDM_PREPARE message.

Parameters

uDeviceId

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

uMsg

MIDM_UNPREPARE

dwUser

Device instance identifier.

dwParam1

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

dwParam2

Specifies the size of MIDIHDR in bytes.

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 midiInUnprepareHeader return values in the Win32 SDK.

Comments

A client sends the MIDM_UNPREPARE 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 removes the buffer preparation. For most drivers, this behavior is sufficient. If the driver does support MIDM_UNPREPARE, it must clear MHDR_PREPARED in the dwFlags member of MIDIHDR and return MMSYSERR_NOERROR.

For additional information, see Transferring MIDI Input Data.