winmm/tests: waveOutGetDevCaps called with invalid size

Peter Åstrand astrand at cendio.se
Mon Apr 21 03:54:07 CDT 2008


On Fri, 18 Apr 2008, Robert Reif wrote:

> > -    rc=waveOutGetDevCapsA(device,&capsA,4);
> > +    /* Final call must succeed, capsA will be used below */
> > +    rc=waveOutGetDevCapsA(device,&capsA,sizeof(capsA));
> >      ok(rc==MMSYSERR_NOERROR,
> >         "waveOutGetDevCapsA(%s): MMSYSERR_NOERROR expected, got %s\n",
> >         dev_name(device),wave_out_error(rc));
> > -
> > -    rc=waveOutGetDevCapsW(device,&capsW,4);
> > -    ok(rc==MMSYSERR_NOERROR || rc==MMSYSERR_NOTSUPPORTED,
> > -       "waveOutGetDevCapsW(%s): MMSYSERR_NOERROR or MMSYSERR_NOTSUPPORTED "
> > -       "expected, got %s\n",dev_name(device),wave_out_error(rc));
> > +    if (rc!=MMSYSERR_NOERROR)
> > +	return;


> That's the whole point of the test, to check what happens with an invalid
> argument.

So what do you think *should* happen with an invalid argument? The result 
is different on different Windows platforms. The behaviour is not 
specified by MSDN. 

In any case, continuing and executing code that uses "capsA" even though 
the waveOutGetDevCapsA call failed is definitely wrong. 

 
Rgds, 
---
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 mailing list