WIDM_START

The WIDM_START message requests a waveform input driver to begin recording.

Parameters

uDeviceId

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

uMsg

WIDM_START

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 WAVERR error codes defined in mmsystem.h. See waveInStart return values in the Win32 SDK.

Comments

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

If the message is received after input has been started, the driver should return MMSYSERR_NOERROR.

User-mode waveform input drivers should handle input asynchronously, by creating a separate thread to handle communication with the kernel-mode driver. Typically, the new thread starts recording by calling DeviceIoControl to send the kernel-mode driver an IOCTL_WAVE_SET_STATE control code, and by calling ReadFileEx to request the kernel-mode driver to fill client-supplied buffers (see WIDM_ADDBUFFER). When the kernel-mode driver returns a filled buffer, the user-mode driver should:

·Set the dwBytesRecorded member in the buffer’s WAVEHDR structure.

·Set the buffer’s WHDR_DONE flag.

·Clear the buffer’s WHDR_INQUEUE flag.

·Send a WIM_DATA callback message to the client.

To avoid unnecessarily locking too much memory, do not send the kernel-mode driver too many buffers at once, or buffers that are excessively large.

Recording should continue until the client sends WIDM_STOP or WIDM_RESET.

For additional information, see Transferring Waveform Input Data.