winmm/tests: waveOutGetDevCaps called with invalid size
astrand at cendio.se
Thu Apr 24 09:41:37 CDT 2008
> > > There are only two options: only pass the number of bytes requested
> > > or return an error for unreasonable sizes. What is Terminal Server
> > > doing?
> > It's returning an error.
> And what is the error? If you know the error code returned, Ill add it
> to the code so we can end this discussion.
The error is MMSYSERR_INVALPARAM.
Sure, you can add the error code to the list of accepted return code, but
I still don't understand the meaning of this test. You are basically
testing the sound card driver, rather than the winmm subsystem.
> > > waveOutGetDevCapsW lets the driver do the copy (just like old versions of
> > > windows). The driver should be checking the size and only copying that
> > > much.
> > > If it doesn't, then it broken.
> > Any references for this claim?
> Read the code.
Since we are trying to follow MS, reading the Wine code doesn't really
give us a hint of what MS considers valid or invalid.
> > You are saying that the driver "should only copy that much", but *what*
> > should it copy? In other words: If the size doesn't match the size of any
> > known structure (WAVEOUTCAPSA/WAVEOUTCAPSW/WAVEOUTCAPS2A/WAVEOUTCAPS2W),
> > should the driver then just *assume* some structure? Which one? As far as I
> > know, there's no guarantee that, for example, the first sizeof(WAVEOUTCAPSW)
> > bytes of WAVEOUTCAPSW are the same as WAVEOUTCAPS2W.
> Again, read the code. WAVEOUTCAPS2 is a superset of WAVEOUTCAPS
> so it doesn't matter when the length is shorter than WAVEOUTCAPS. The
> drivers only support W so mixing A and W is not an issue.
Are you saying that WODM_GETDEVCAPS messages are always limited to the "W"
versions? So, drivers don't need to handle WODM_GETDEVCAPS messages with
"A" type structs? I had no idea of that. Any reference for this?
Peter Åstrand ThinLinc Chief Developer
Cendio AB http://www.cendio.se
Wallenbergs gata 4
583 30 Linköping Phone: +46-13-21 46 00
More information about the wine-devel