MIDM_RESET

The MIDM_RESET message requests a MIDI input driver to stop recording and return all buffers in the input queue to the client.

Parameters
uDeviceId
Device identifier (0, 1, 2, and so on) for the target device.
uMsg
MIDM_RESET
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 midiInReset return values in the Win32 SDK.

Comments

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

Typically, the user-mode driver stops recording by calling DeviceIoControl, sending the kernel-mode driver an IOCTL_MIDI_SET_STATE control code.

For each buffer remaining in the driver’s input queue (see MIDM_ADDBUFFER), the driver should set MHDR_DONE and clear MHDR_INQUEUE in the dwFlags member of the buffer’s MIDIHDR structure, and also set the structure’s dwBytesRecorded member. Finally, a MOM_DONE callback message should be sent for each buffer.

For additional information, see Transferring MIDI Input Data.