ACMDM_STREAM_SIZE

The ACMDM_STREAM_SIZE message requests an ACM driver to return the size required for a source (or destination) buffer, given a specified destination (or source) buffer size along with source and destination format descriptions.

Parameters

dwDriverID

Driver instance identifier. This is the value returned by the driver in response to the DRV_OPEN message.

hDriver

Driver handle.

uMsg

ACMDM_STREAM_SIZE

lParam1

Pointer to an ACMDRVSTREAMINSTANCE structure.

lParam2

Pointer to an ACMDRVSTREAMSIZE structure.

Return Value

The driver should return MMSYSERR_NOERROR if the operation succeeds. Otherwise it should return one of the MMSYSERR error codes defined in mmsystem.h, or one of the ACMERR error codes defined in msacm.h.

Comments

A client sends the ACMDM_STREAM_SIZE message by calling the driver's DriverProc entry point, passing the specified parameters. The ACM sends this message when an application calls the acmStreamSize function, which is described in the Win32 SDK.

All ACM drivers that provide stream conversions must support this message. For more information about stream conversions, see Converting Data Streams.

Based on the input arguments, the driver must answer one of the following questions:

·Given a specified source buffer size, how large does a destination buffer need to be in order to hold all of the converted data?

·Given a specified destination buffer size, what is the largest amount of source data that can specified without overflowing the destination buffer?

The ACMDRVSTREAMINSTANCE structure received with this message is the same structure that was received with a previous ACMDM_STREAM_OPEN message. The driver does not need to validate the structure's contents again.

The driver examines the ACMDRVSTREAMSIZE structure to determine which buffer (source or destination) the client has supplied. The ACMDRVSTREAMINSTANCE structure contains structures that describe the source and destination formats, and, possibly, a filter specification. The driver uses this information to determine the size of the requested buffer.

If the driver returns a buffer length of zero, the ACM provides an error return code of ACMERR_NOTPOSSIBLE to acmStreamSize.