[PATCH 1/2] winmm-wave: fixed waveOutGetDevCaps and waveInGetDevCaps

Nikolay Sivov nsivov at codeweavers.com
Tue Apr 28 02:47:04 CDT 2020


On 4/28/20 10:14 AM, dead ash wrote:
> diff --git a/dlls/winmm/waveform.c b/dlls/winmm/waveform.c
> index 42b888e1ac..dffc002c24 100644
> --- a/dlls/winmm/waveform.c
> +++ b/dlls/winmm/waveform.c
> @@ -1243,10 +1243,17 @@ static LRESULT WOD_Open(WINMM_OpenInfo *info)
>               lock = &g_devthread_lock;
>               internal_index = MAPPER_INDEX;
>           }else{
> -            if(info->req_device >= g_outmmdevices_count)
> -                return MMSYSERR_BADDEVICEID;
> +            if(info->req_device >= g_outmmdevices_count) {
> +                WINMM_Device *device = WINMM_GetDeviceFromHWAVE((HWAVE)info->req_device);
> +
> +                if(device == NULL) return MMSYSERR_BADDEVICEID;
> +
> +                mmdevice = device->parent;
> +            }
> +            else {
> +                mmdevice = read_map(g_out_map, info->req_device);
> +            }
>   
> -            mmdevice = read_map(g_out_map, info->req_device);
>   
>               if(!mmdevice->out_caps.szPname[0])
Please add a test for this. Also note req_device is shorter than HWAVE, 
on 64-bit.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200428/e17af11d/attachment.htm>


More information about the wine-devel mailing list