[PATCH] advapi32: Set *lpSize properly in GetUserNameA (resend)

Alexandre Julliard julliard at winehq.org
Fri Jul 1 13:23:27 CDT 2011


Alex Stanev <alex at stanev.org> writes:

> -    ret = GetUserNameW( buffer, &sizeW );
> +    ret = GetUserNameW( buffer, lpSize );
>      if (ret)
> -        WideCharToMultiByte( CP_ACP, 0, buffer, -1, lpszName, *lpSize, NULL, NULL );
> -    else
> -        *lpSize = sizeW;
> +        *lpSize = WideCharToMultiByte( CP_ACP, 0, buffer, -1, lpszName, *lpSize, NULL, NULL );

This is wrong, you can't use the W result as the A buffer size.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list