MIDM_CLOSE

The MIDM_CLOSE message requests a MIDI input driver to close a specified device instance that was previously opened with a MIDM_OPEN message.

Parameters
uDeviceId
Device identifier (0, 1, 2, and so on) for the target device.
uMsg
MIDM_CLOSE
dwUser
Device instance identifier.
dwParam1
Not used.
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 midiInClose return values in the Win32 SDK.

Comments

A client sends the MIDM_CLOSE message by calling the user-mode driver’s midMessage entry point, passing the specified parameters.

If the driver has not filled and returned all of the buffers received with MIDM_ADDBUFFER messages, it should not close the instance and should instead return MIDIERR_STILLPLAYING.

After the driver closes the device instance it should send a MIM_CLOSE callback message to the client.

For more information about closing a device instance, see Transferring MIDI Input Data.