The MIDM_STOP message requests a MIDI input driver to stop recording.
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 midiInStop return values in the Win32 SDK.
A client sends the MIDM_STOP message by calling the user-mode driver’s midMessage entry point, passing the specified parameters.
If a buffer in the input queue (see MIDM_ADDBUFFER) has been partially filled, the driver should treat it as a full buffer and return it to the client (see MIDM_START). Empty buffers should remain in the queue.
While recording is stopped, the driver should maintain the current MIDI status byte for events using running status and the parsing state for multibyte events. If the driver receives a subsequent MIDM_START message, it should be able to resume recording from the point at which it was stopped.
If this message is received and recording is already stopped, the driver should return MMSYSERR_NOERROR.
Typically, the user-mode driver stops recording by calling DeviceIoControl, sending the kernel-mode driver an IOCTL_MIDI_SET_STATE control code.
For additional information, see Transferring MIDI Input Data.