The WIDM_UNPREPARE message requests a waveform input driver to remove the buffer preparation that was performed in response to a WIDM_PREPARE message.
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 waveInUnprepareHeader return values in the Win32 SDK.
A client sends the WIDM_UNPREPARE message by calling the user-mode driver’s widMessage entry point, passing the specified parameters.
Support for this message by user-mode drivers is optional. If the driver supports WIDM_PREPARE, it must also support WIDM_UNPREPARE.
If the driver returns MMSYSERR_NOTSUPPORTED, winmm.dll removes the buffer preparation. For most drivers, this behavior is sufficient. If the driver does support WIDM_UNPREPARE, it must clear WHDR_PREPARED in the dwFlags member of WAVEHDR and return MMSYSERR_NOERROR.
For additional information, see Transferring Waveform Input Data.