The DVM_STREAM_PREPAREHEADER message requests a user-mode video capture driver to prepare a data buffer for use.
Parameters
dwDriverID
Video channel identifier. For this message, the driver should only accept VIDEO_IN. (For details, see Opening Video Channels.)
hDriver
Driver handle.
uMsg
DVM_STREAM_PREPAREHEADER
lParam1
Pointer to a VIDEOHDR structure.
lParam2
Size of the VIDEOHDR structure.
Return Value
The driver should return DV_ERR_OK if the operation succeeds. Otherwise, it should return one of the DV_ERR error codes defined in msvideo.h. Custom error codes are also allowed (see DVM_GETERRORTEXT).
Comments
A client sends the DVM_STREAM_PREPAREHEADER message by calling the driver's DriverProc entry point, passing the specified parameter values. Applications can send this message by calling the videoStreamPrepareHeader function, which is described in the Video for Windows Development Kit.
Use of this message is meant to ensure that the specified buffer is accessible by the kernel-mode driver. If the driver returns DV_ERR_NOTSUPPORTED, then msvfw32.dll or avicap32.dll will prepare the buffer. For most drivers, this behavior is sufficient. If the driver does perform buffer preparation, it should return DV_ERR_OK, which causes msvfw32.dll or avicap32.dll to set the VHDR_PREPARED flag in the VIDEOHDR structure's dwFlags member.
Drivers assume that the VIDEOHDR structure and the data buffer pointed to by its lpData member have been allocated with GlobalAlloc, using the GMEM_MOVEABLE and GMEM_SHARE flags, and locked with GlobalLock. (For further information about GlobalAlloc and GlobalLock, see the Win32 SDK.)
For information about using data buffers with video capture streams, see Transferring Streams of Captured Data.