[PATCH] winmm: RegQueryValueExW wants the size in bytes, not the size in characters. (resend)

Andrew Eikum aeikum at codeweavers.com
Tue Feb 14 08:16:18 CST 2017


Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>

On Sun, Feb 12, 2017 at 02:00:47PM +0100, Carlo Bramini wrote:
> RESEND
> 
> 
> Da: "Carlo Bramini" <carlo.bramix at libero.it>
> Data: 26/12/2016 16.25
> A: <wine-patches at winehq.org>
> Ogg: [PATCH] winmm: RegQueryValueExW wants the size in bytes, not the size in 
> characters.
> 
> There is a bug into dlls/winmm/playsound.c
> Function RegQueryValueExW accepts the size in bytes as parameter, not the size 
> in characters.
> 
> See:
> https://msdn.microsoft.com/en-us/library/windows/desktop/ms724911(v=vs.85).
> aspx
> 
> Sincerely.
> 
> Signed-off-by: Carlo Bramini <carlo_bramini at users.sourceforge.net> 

> diff --git a/dlls/winmm/playsound.c b/dlls/winmm/playsound.c
> index 5d9aed0..6525db5 100644
> --- a/dlls/winmm/playsound.c
> +++ b/dlls/winmm/playsound.c
> @@ -140,7 +140,7 @@ static HMMIO	get_mmioFromProfile(UINT uFlags, LPCWSTR lpszName)
>          if (err != 0)
>              goto none;
>      }
> -    count = sizeof(str)/sizeof(str[0]);
> +    count = sizeof(str);
>      err = RegQueryValueExW(hSnd, NULL, 0, &type, (LPBYTE)str, &count);
>      RegCloseKey(hSnd);
>      if (err != 0 || !*str) goto none;

> 




More information about the wine-patches mailing list