MODM_UNPREPARE function

WINMM sends the MODM_UNPREPARE message to the modMessage function of a MIDI output driver to clean up the memory segment that was configured by MODM_PREPARE.

Syntax


DWORD modMessage(
   UINT      uDeviceID,
   UINT      uMsg,
   DWORD_PTR dwUser,
   DWORD_PTR dwParam1,
   DWORD_PTR dwParam2
);

Parameters

uDeviceID

Specifies the ID of the target device. Device IDs are sequential and have an initial value of zero and a final value that is equal to one less than the number of devices that the driver supports.

uMsg

WINMM sets this parameter to MODM_UNPREPAE when it calls modMessage to process this message.

dwUser

Use this parameter to return instance data to the driver. Drivers that support multiple clients can use this instance data to track the client that is associated with the message.

dwParam1

Specifies a far pointer to a MIDIHDR structure that identifies the data block.

dwParam2

Specifies the size of the MIDIHDR structure.

Return value

The modMEssage function returns MMSYSERR_NOERROR if the operation is successful. Otherwise, it returns MMSYSERR_NOTENABLED to indicate that the driver failed to load or initialize.

Remarks

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

The default response for this message is to return MMSYSERR_NOTSUPPORTED. In this case, Mmsystem.dll cleans up the preparation that was previously done on the memory block. If a driver performs the PREPARE operation, it must clean up the preparation and reset the MHDR_PREPARED flag in the dwFlags field of the MIDIHDR structure.

Requirements

Target platform

Version

Available in Windows XP and later Windows operating systems.

Header

Mmddk.h (include Mmddk.h, Mmsystem.h, or Windows.h)

See also

modMessage
MODM_PREPARE
MIDIHDR

 

 

Send comments about this topic to Microsoft

Show: