The ACMDM_STREAM_UNPREPARE message requests an ACM driver to clear the preparation of the buffers associated with an ACMDRVSTREAMHEADER structure.
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_UNPREPARE
lParam1
Pointer to an ACMDRVSTREAMINSTANCE structure.
lParam2
Pointer to an ACMDRVSTREAMHEADER 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_UNPREPARE message by calling the driver's DriverProc entry point, passing the specified parameters. The ACM sends this message when an application calls the acmStreamUnprepareHeader function, which is described in the Win32 SDK.
Support for this message is optional. If a driver supports ACMDM_STREAM_PREPARE, it must support ACMDM_STREAM_UNPREPARE.
If the driver returns MMSYSERR_NOTSUPPORTED, the ACM clears the buffer preparation. For most drivers, this behavior is sufficient. If the driver does clear buffer preparation, it should return MMSYSERR_NOERROR. In either case, the ACM clears ACMSTREAMHEADER_STATUSF_PREPARED in the ACMDRVSTREAMHEADER structure's fdwStatus member. The driver never modifies this flag. (If you want both your driver and the ACM to clear buffer preparations, the driver should return MMSYSERR_NOTSUPPORTED after clearing its preparation. The ACM can then also clear its preparation.)
Before calling the driver's DriverProc function, the ACM verifies that:
·The ACMDRVSTREAMHEADER structure is readable and writeable.
·The ACMDRVSTREAMHEADER structure's cbStruct member contains a size value that is at least as large as the structure's defined size.
·The buffers have been previously prepared.
·The buffer addresses and sizes match those specified when these buffers were prepared.
·The buffers are not currently in use by an asynchronous driver, based on the ACMDRVSTREAMHEADER structure's ACMSTREAMHEADER_STATUSF_INQUEUE flag value.
For more information about the use of ACMDM_STREAM_UNPREPARE, see Converting Data Streams.