attrib: Use FormatMessageW() for better internationalization support.

Alexandre Julliard julliard at winehq.org
Thu Oct 20 08:11:12 CDT 2011


Francois Gouget <fgouget at free.fr> writes:

> @@ -72,10 +72,12 @@ static int ATTRIB_wprintf(const WCHAR *format, ...) {
>      }
>  
>      va_start(parms, format);
> -    len = vsnprintfW(output_bufW, MAX_WRITECONSOLE_SIZE/sizeof(WCHAR), format, parms);
> +    SetLastError(NO_ERROR);
> +    len = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, format, 0, 0, output_bufW,
> +                   MAX_WRITECONSOLE_SIZE/sizeof(*output_bufW), &parms);

You have to use __ms_va_list with FormatMessage for it to work properly
on 64-bit.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list