[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH 1/2] msvcrt: Introduce vfprintf helper function.
From:       Piotr Caban <piotr.caban () gmail ! com>
Date:       2017-09-25 11:43:00
Message-ID: 23217c25-ac5b-4f02-4807-92b11a335ae2 () gmail ! com
[Download RAW message or body]

Hi,

On 09/25/17 01:24, Gijs Vermeulen wrote:
> -int CDECL MSVCRT_vfprintf(MSVCRT_FILE* file, const char *format, __ms_va_list \
> valist) +static int vfprintf_helper(MSVCRT_FILE* file, const char *format, \
> __ms_va_list valist, +        MSVCRT__locale_t locale, BOOL secure)
> {
> BOOL tmp_buf;
> int ret;
> 
> +    if(secure)
> +        if(!MSVCRT_CHECK_PMT(file != NULL)) return -1;
> +
> MSVCRT__lock_file(file);
> tmp_buf = add_std_buffer(file);
> -    ret = pf_printf_a(puts_clbk_file_a, file, format, NULL, 0, arg_clbk_valist, \
> NULL, &valist); +
> +    if(!secure)
> +        ret = pf_printf_a(puts_clbk_file_a, file, format, NULL, 0, \
> arg_clbk_valist, NULL, &valist); +    else
> +    {
> +        if(!locale)
> +            ret = pf_printf_a(puts_clbk_file_a, file, format, NULL,
> +                    MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, arg_clbk_valist, \
> NULL, &valist); +        else
> +            ret = pf_printf_a(puts_clbk_file_a, file, format, locale, 0, \
> arg_clbk_valist, NULL, &valist); +    }
> +
> if(tmp_buf) remove_std_buffer(file);
> MSVCRT__unlock_file(file);
> 
> return ret;
> }
This helper changes current functions behavior.

Thanks,
Piotr


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic