WIDM_ADDBUFFER

This message is sent to a waveform input device driver to add a buffer to the input queue.

Parameters

DWORD dwParam1

Specifies a far pointer to a WAVEHDR data structure identifying the buffer.

DWORD dwParam2

Specifies the size of the WAVEHDR 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.

WAVERR_UNPREPARED

The specified data buffer has not been prepared for input.

Comments

The driver should first check the WHDR_PREPARED bit in the dwFlags field of the WAVEHDR structure. If the bit is not set, the driver should return WAVERR_UNPREPARED. The driver should clear the WHDR_DONE bit and set the WHDR_INQUEUE bit in the header structure, and place the data block in its play 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. If data is received without any buffers in the input queue, the data should be ignored without notifying the client.

Recording begins when the driver receives a WIDM_START message. Once the data block has been filled with data, the driver should set the WHDR_DONE bit and clear the WHDR_INQUEUE bit before notifying the client by using DriverCallback to send a WIM_DATA message.