ucrtbase: Add __stdio_common_vsprintf_p.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2017-10-13 20:11:24 +02:00 committed by Alexandre Julliard
parent 2fb1002f32
commit 8b6eada458
3 changed files with 27 additions and 10 deletions

View File

@ -12,7 +12,7 @@
@ cdecl __stdio_common_vsnprintf_s(int64 ptr long long str ptr ptr) ucrtbase.__stdio_common_vsnprintf_s @ cdecl __stdio_common_vsnprintf_s(int64 ptr long long str ptr ptr) ucrtbase.__stdio_common_vsnprintf_s
@ cdecl __stdio_common_vsnwprintf_s(int64 ptr long long wstr ptr ptr) ucrtbase.__stdio_common_vsnwprintf_s @ cdecl __stdio_common_vsnwprintf_s(int64 ptr long long wstr ptr ptr) ucrtbase.__stdio_common_vsnwprintf_s
@ cdecl __stdio_common_vsprintf(int64 ptr long str ptr ptr) ucrtbase.__stdio_common_vsprintf @ cdecl __stdio_common_vsprintf(int64 ptr long str ptr ptr) ucrtbase.__stdio_common_vsprintf
@ stub __stdio_common_vsprintf_p @ cdecl __stdio_common_vsprintf_p(int64 ptr long str ptr ptr) ucrtbase.__stdio_common_vsprintf_p
@ cdecl __stdio_common_vsprintf_s(int64 ptr long str ptr ptr) ucrtbase.__stdio_common_vsprintf_s @ cdecl __stdio_common_vsprintf_s(int64 ptr long str ptr ptr) ucrtbase.__stdio_common_vsprintf_s
@ cdecl __stdio_common_vsscanf(int64 ptr long str ptr ptr) ucrtbase.__stdio_common_vsscanf @ cdecl __stdio_common_vsscanf(int64 ptr long str ptr ptr) ucrtbase.__stdio_common_vsscanf
@ cdecl __stdio_common_vswprintf(int64 ptr long wstr ptr ptr) ucrtbase.__stdio_common_vswprintf @ cdecl __stdio_common_vswprintf(int64 ptr long wstr ptr ptr) ucrtbase.__stdio_common_vswprintf

View File

@ -1447,11 +1447,8 @@ int CDECL MSVCRT_vswprintf_s_l(MSVCRT_wchar_t* str, MSVCRT_size_t numberOfElemen
format, locale, args ); format, locale, args );
} }
/********************************************************************* static int MSVCRT_vsprintf_p_l_opt(char *buffer, MSVCRT_size_t length, const char *format,
* _vsprintf_p_l (MSVCRT.@) DWORD options, MSVCRT__locale_t locale, __ms_va_list args)
*/
int CDECL MSVCRT_vsprintf_p_l(char *buffer, MSVCRT_size_t length, const char *format,
MSVCRT__locale_t locale, __ms_va_list args)
{ {
static const char nullbyte = '\0'; static const char nullbyte = '\0';
printf_arg args_ctx[MSVCRT__ARGMAX+1]; printf_arg args_ctx[MSVCRT__ARGMAX+1];
@ -1466,17 +1463,26 @@ int CDECL MSVCRT_vsprintf_p_l(char *buffer, MSVCRT_size_t length, const char *fo
*MSVCRT__errno() = MSVCRT_EINVAL; *MSVCRT__errno() = MSVCRT_EINVAL;
return ret; return ret;
} else if(ret == 0) } else if(ret == 0)
ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale, MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale,
arg_clbk_valist, NULL, &args); MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER | options, arg_clbk_valist, NULL, &args);
else else
ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale, ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale,
MSVCRT_PRINTF_POSITIONAL_PARAMS | MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, MSVCRT_PRINTF_POSITIONAL_PARAMS | MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER | options,
arg_clbk_positional, args_ctx, NULL); arg_clbk_positional, args_ctx, NULL);
puts_clbk_str_a(&puts_ctx, 1, &nullbyte); puts_clbk_str_a(&puts_ctx, 1, &nullbyte);
return ret; return ret;
} }
/*********************************************************************
* _vsprintf_p_l (MSVCRT.@)
*/
int CDECL MSVCRT_vsprintf_p_l(char *buffer, MSVCRT_size_t length, const char *format,
MSVCRT__locale_t locale, __ms_va_list args)
{
return MSVCRT_vsprintf_p_l_opt(buffer, length, format, 0, locale, args);
}
/********************************************************************* /*********************************************************************
* _vsprintf_p (MSVCRT.@) * _vsprintf_p (MSVCRT.@)
*/ */
@ -1486,6 +1492,17 @@ int CDECL MSVCRT_vsprintf_p(char *buffer, MSVCRT_size_t length,
return MSVCRT_vsprintf_p_l(buffer, length, format, NULL, args); return MSVCRT_vsprintf_p_l(buffer, length, format, NULL, args);
} }
/*********************************************************************
* __stdio_common_vsprintf_p (UCRTBASE.@)
*/
int CDECL MSVCRT__stdio_common_vsprintf_p(unsigned __int64 options, char *buffer, MSVCRT_size_t length,
const char *format, MSVCRT__locale_t locale, __ms_va_list args)
{
if (options & ~UCRTBASE_PRINTF_MASK)
FIXME("options %s not handled\n", wine_dbgstr_longlong(options));
return MSVCRT_vsprintf_p_l_opt(buffer, length, format, options & UCRTBASE_PRINTF_MASK, locale, args);
}
/********************************************************************* /*********************************************************************
* _sprintf_p_l (MSVCRT.@) * _sprintf_p_l (MSVCRT.@)
*/ */

View File

@ -157,7 +157,7 @@
@ cdecl __stdio_common_vsnprintf_s(int64 ptr long long str ptr ptr) MSVCRT__stdio_common_vsnprintf_s @ cdecl __stdio_common_vsnprintf_s(int64 ptr long long str ptr ptr) MSVCRT__stdio_common_vsnprintf_s
@ cdecl __stdio_common_vsnwprintf_s(int64 ptr long long wstr ptr ptr) MSVCRT__stdio_common_vsnwprintf_s @ cdecl __stdio_common_vsnwprintf_s(int64 ptr long long wstr ptr ptr) MSVCRT__stdio_common_vsnwprintf_s
@ cdecl __stdio_common_vsprintf(int64 ptr long str ptr ptr) MSVCRT__stdio_common_vsprintf @ cdecl __stdio_common_vsprintf(int64 ptr long str ptr ptr) MSVCRT__stdio_common_vsprintf
@ stub __stdio_common_vsprintf_p @ cdecl __stdio_common_vsprintf_p(int64 ptr long str ptr ptr) MSVCRT__stdio_common_vsprintf_p
@ cdecl __stdio_common_vsprintf_s(int64 ptr long str ptr ptr) MSVCRT__stdio_common_vsprintf_s @ cdecl __stdio_common_vsprintf_s(int64 ptr long str ptr ptr) MSVCRT__stdio_common_vsprintf_s
@ cdecl __stdio_common_vsscanf(int64 ptr long str ptr ptr) MSVCRT__stdio_common_vsscanf @ cdecl __stdio_common_vsscanf(int64 ptr long str ptr ptr) MSVCRT__stdio_common_vsscanf
@ cdecl __stdio_common_vswprintf(int64 ptr long wstr ptr ptr) MSVCRT__stdio_common_vswprintf @ cdecl __stdio_common_vswprintf(int64 ptr long wstr ptr ptr) MSVCRT__stdio_common_vswprintf