MODM_CLOSE

The MODM_CLOSE message requests a MIDI output driver to close a specified device instance that was previously opened with a MODM_OPEN message.

Parameters

uDeviceId

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

uMsg

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

Comments

A client sends the MODM_CLOSE message by calling the user-mode driver's modMessage entry point, passing the specified parameters.

If the client has passed data buffers to the user-mode driver by means of MODM_LONGDATA messages, and if the user-mode driver hasn't finished sending the data to the kernel-mode driver, the user-mode driver should return MIDIERR_STILLPLAYING in response to MODM_CLOSE.

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

For additional information, see Transferring MIDI Output Data.