winmm/tests: waveOutGetDevCaps called with invalid size

Robert Reif reif at earthlink.net
Fri Apr 18 09:33:41 CDT 2008


Peter Åstrand wrote:
> Changelog:
>
> Calling waveOutGetDevCapsA/waveOutGetDevCapsW with size 4 is wrong, the 
> size should be the sizeof the structure used. waveOutGetDevCapsA needs to 
> succeed since the capsA structure is used later. 
>
> Index: wave.c
> ===================================================================
> RCS file: /home/wine/wine/dlls/winmm/tests/wave.c,v
> retrieving revision 1.67
> diff -u -r1.67 wave.c
> --- wave.c	29 Feb 2008 12:18:36 -0000	1.67
> +++ wave.c	18 Apr 2008 08:43:54 -0000
> @@ -853,15 +853,13 @@
>         "expected, got %s\n",dev_name(device),wave_out_error(rc));
>      }
>  
> -    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;
>  
>      nameA=NULL;
>      rc=waveOutMessage((HWAVEOUT)device, DRV_QUERYDEVICEINTERFACESIZE,
>
>
> ---
> Peter Åstrand		ThinLinc Chief Developer
> Cendio AB		http://www.cendio.se
> Wallenbergs gata 4
> 583 30 Linköping	Phone: +46-13-21 46 00
> ------------------------------------------------------------------------
>
>
>   
That's the whole point of the test, to check what happens with an 
invalid argument.



More information about the wine-devel mailing list