Windows Multimedia DDK (mddkqh.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
MIDM_ADDBUFFER
                                                 Contents Index Back
────────────────────────────────────────────────────────────────────────────
MIDM_ADDBUFFER
 
        This message is sent to a MIDI input device driver to add a
        buffer to the input queue.
 
Parameters
        DWORD dwParam1
            Specifies a far pointer to a MIDIHDR data structure
            identifying the buffer.
 
        DWORD dwParam2
            Specifies the size of the MIDIHDR structure.
 
Return value
        The return value is an error code, or zero (MMSYSERR_NOERROR) if
        the operation is successful. Possible error codes are:
 
        MMSYSERR_NOTENABLED
            The driver failed to load or initialize.
 
        MIDIERR_UNPREPARED
            The specified data buffer has not been prepared for input.
 
Comments
        The driver should first check the MHDR_PREPARED bit in the
        dwFlags field of the MIDIHDR structure. If the bit is not set,
        the driver should return MIDIERR_UNPREPARED. The driver should
        clear the MHDR_DONE bit and set the MHDR_INQUEUE bit in the
        header structure, and place the data block in its input queue.
        Then the driver should return control to the client by returning
        MMSYSERR_NOERROR.
 
        Input to the buffer should occur as an interrupt-driven
        process. Only system-exclusive data is placed in the buffer.
        Other MIDI events are sent directly to the client application by
        sending a MIM_DONE message with the DriverCallback function.
 
        Recording begins when the driver receives a MIDM_START message.
        Once the data block has been filled with data, the driver should
        set the MHDR_DONE bit and clear the MHDR_INQUEUE bit before
        notifying the client by using DriverCallback to send a
        MIM_DONE message.
 
        If the driver receives data with no buffers in its input queue, it
        should ignore the data without notifying the client.
 
                                       -♦-