winmm/tests: waveOutGetDevCaps called with invalid size

Peter Åstrand astrand at
Wed Apr 30 01:32:08 CDT 2008

On Tue, 29 Apr 2008, Robert Reif wrote:

> First of all, requesting 4 bytes is not invalid but a perfectly 
> reasonable thing to do. It is just reading the manufactures id and 
> product id.  However this behavior is not documented in MSDN so at best 
> it's just unspecified behavior.  The reason most hardware drivers get 
> this right is because Microsoft does check this behavior in their 
> hardware compatibility test so manufactures can get certification that 
> their hardware and drivers are working properly.  Now the two drivers 

Ok, you have convinced me. 

> The tests in wine are valid but incomplete because they don't check for 
> the possible buffer overrun that could occur if the driver just ignores 
> the requested size.  A black list should be added for Terminal Server 
> and your product because they behave differently than most hardware 
> drivers.  This would ensure that regressions don't slip into wine when 
> drivers are added or changed and that wine behaves like Microsoft 
> expects a hardware driver to behave.

Adding a black list for WTS sounds good to me; much better than just 
accepting MMSYSERR_INVALPARAM. GetSystemMetrics(SM_REMOTESESSION) can be 
used to detect WTS. 

Peter Åstrand		ThinLinc Chief Developer
Cendio AB
Wallenbergs gata 4
583 30 Linköping	Phone: +46-13-21 46 00

More information about the wine-devel mailing list