MIDM_ADDBUFFER

The MIDM_ADDBUFFER message requests a user-mode MIDI input driver to add an empty input buffer to its input buffer queue.

Parameters

uDeviceId

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

uMsg

AUXDM_SETVOLUME

dwUser

Device instance identifier.

dwParam1

Pointer to a MIDIHDR structure identifying the buffer. (The MIDIHDR structure is described in the Win32 SDK.)

dwParam2

Size of the MIDIHDR structure in bytes.

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

Comments

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

If the MHDR_PREPARED flag is not set in the dwFlags member of the MIDIHDR structure, the driver should return MIDIERR_UNPREPARED. If the flag is set, the driver should:

·Clear the MHDR_DONE flag.

·Set the MHDR_INQUEUE flag.

·Place the empty buffer in its input queue.

·Return control to the client with a return value of MMSYSERR_NOERROR.

Only system-exclusive events (long messages) should be placed in the buffer. Other MIDI events (short messages) should be passed to the client with a MIM_DATA callback message.

The user-mode driver starts recording when it receives a MIDM_START message.

For additional information, see Transferring MIDI Input Data.