winmm: More compatible waveIn/Out[Un]Prepare WHDR_* flag handling.

Joerg-Cyril.Hoehle at Joerg-Cyril.Hoehle at
Mon Feb 18 05:24:03 CST 2013


One thing to note is a slight change when Prepare is called twice in a row.

When the ACM is used, the former Wine code would prepare the ACM
again, leaking the memory of the previous preparation.  Now that code
is by-passed as the header is prepared exactly once, the first time.

What if the app changes dwBufferLength in between?

We don't know what exactly native does.  My tests only show that
*some* code is by-passed, because when WHDR_PREPARE is found already
set, the other flags are not repeatedly cleared.  All calls return NOERROR.

The 16 bit code has a comment
>    /* dwBufferLength can be reduced between prepare & write */
>    if (... && wh32->dwBufferLength < wh16->dwBufferLength) {

I've checked neither
- what native does in that case when the ACM is involved, nor
- how Wine drives the ACM in that case.
It's reasonable to assume that only dwBufferLength at the time of
waveOutWrite should be relevant.  Let's hope that dwBufferLength from
the time of Prepare doesn't matter in Wine's 32 bit ACM.

	Jörg Höhle

More information about the wine-devel mailing list