Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49765 Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/msvcr100/msvcr100.spec | 8 ++-- dlls/msvcr110/msvcr110.spec | 8 ++-- dlls/msvcr120/msvcr120.spec | 8 ++-- dlls/msvcr120_app/msvcr120_app.spec | 8 ++-- dlls/msvcr80/msvcr80.spec | 7 ++-- dlls/msvcr90/msvcr90.spec | 8 ++-- dlls/msvcrt/msvcrt.spec | 8 ++-- dlls/msvcrt/wcs.c | 59 +++++++++++++++++++++++++++++ 8 files changed, 87 insertions(+), 27 deletions(-)
diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index f507406d52..4e6041e81e 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1293,8 +1293,8 @@ @ stub _setsystime(ptr long) @ cdecl _sleep(long) MSVCRT__sleep @ varargs _snprintf(ptr long str) MSVCRT__snprintf -@ stub _snprintf_c -@ stub _snprintf_c_l +@ varargs _snprintf_c(ptr long str) MSVCRT_snprintf_c +@ varargs _snprintf_c_l(ptr long str ptr) MSVCRT_snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) MSVCRT__snprintf_l @ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s @ stub _snprintf_s_l @@ -1376,8 +1376,8 @@ @ cdecl _strxfrm_l(ptr str long ptr) MSVCRT__strxfrm_l @ cdecl _swab(str str long) MSVCRT__swab @ varargs _swprintf(ptr wstr) MSVCRT_swprintf -@ stub _swprintf_c -@ stub _swprintf_c_l +@ varargs _swprintf_c(ptr long str) MSVCRT_swprintf_c +@ varargs _swprintf_c_l(ptr long str ptr) MSVCRT_swprintf_c_l @ stub _swprintf_p @ varargs _swprintf_p_l(ptr long wstr ptr) MSVCRT_swprintf_p_l @ varargs _swprintf_s_l(ptr long wstr ptr) MSVCRT__swprintf_s_l diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 7423a1ccd6..d8e6ffac2c 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1650,8 +1650,8 @@ @ stub _setsystime(ptr long) @ cdecl _sleep(long) MSVCRT__sleep @ varargs _snprintf(ptr long str) MSVCRT__snprintf -@ stub _snprintf_c -@ stub _snprintf_c_l +@ varargs _snprintf_c(ptr long str) MSVCRT_snprintf_c +@ varargs _snprintf_c_l(ptr long str ptr) MSVCRT_snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) MSVCRT__snprintf_l @ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s @ stub _snprintf_s_l @@ -1733,8 +1733,8 @@ @ cdecl _strxfrm_l(ptr str long ptr) MSVCRT__strxfrm_l @ cdecl _swab(str str long) MSVCRT__swab @ varargs _swprintf(ptr wstr) MSVCRT_swprintf -@ stub _swprintf_c -@ stub _swprintf_c_l +@ varargs _swprintf_c(ptr long str) MSVCRT_swprintf_c +@ varargs _swprintf_c_l(ptr long str ptr) MSVCRT_swprintf_c_l @ stub _swprintf_p @ varargs _swprintf_p_l(ptr long wstr ptr) MSVCRT_swprintf_p_l @ varargs _swprintf_s_l(ptr long wstr ptr) MSVCRT__swprintf_s_l diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 64b4e2d625..168ac8b332 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1661,8 +1661,8 @@ @ stub _setsystime(ptr long) @ cdecl _sleep(long) MSVCRT__sleep @ varargs _snprintf(ptr long str) MSVCRT__snprintf -@ stub _snprintf_c -@ stub _snprintf_c_l +@ varargs _snprintf_c(ptr long str) MSVCRT_snprintf_c +@ varargs _snprintf_c_l(ptr long str ptr) MSVCRT_snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) MSVCRT__snprintf_l @ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s @ stub _snprintf_s_l @@ -1750,8 +1750,8 @@ @ cdecl _strxfrm_l(ptr str long ptr) MSVCRT__strxfrm_l @ cdecl _swab(str str long) MSVCRT__swab @ varargs _swprintf(ptr wstr) MSVCRT_swprintf -@ stub _swprintf_c -@ stub _swprintf_c_l +@ varargs _swprintf_c(ptr long str) MSVCRT_swprintf_c +@ varargs _swprintf_c_l(ptr long str ptr) MSVCRT_swprintf_c_l @ stub _swprintf_p @ varargs _swprintf_p_l(ptr long wstr ptr) MSVCRT_swprintf_p_l @ varargs _swprintf_s_l(ptr long wstr ptr) MSVCRT__swprintf_s_l diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index d9e998c985..be0d87776d 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1380,8 +1380,8 @@ @ cdecl _setmbcp(long) msvcr120._setmbcp @ cdecl _setmode(long long) msvcr120._setmode @ varargs _snprintf(ptr long str) msvcr120._snprintf -@ stub _snprintf_c -@ stub _snprintf_c_l +@ varargs _snprintf_c(ptr long str) msvcr120._snprintf_c +@ varargs _snprintf_c_l(ptr long str ptr) msvcr120._snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) msvcr120._snprintf_l @ varargs _snprintf_s(ptr long long str) msvcr120._snprintf_s @ stub _snprintf_s_l @@ -1461,8 +1461,8 @@ @ cdecl _strxfrm_l(ptr str long ptr) msvcr120._strxfrm_l @ cdecl _swab(str str long) msvcr120._swab @ varargs _swprintf(ptr wstr) msvcr120._swprintf -@ stub _swprintf_c -@ stub _swprintf_c_l +@ varargs _swprintf_c(ptr long str) msvcr120._swprintf_c +@ varargs _swprintf_c_l(ptr long str ptr) msvcr120._swprintf_c_l @ stub _swprintf_p @ varargs _swprintf_p_l(ptr long wstr ptr) msvcr120._swprintf_p_l @ varargs _swprintf_s_l(ptr long wstr ptr) msvcr120._swprintf_s_l diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 9c4e56d0c3..539c548aff 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -973,8 +973,8 @@ @ stub _setsystime(ptr long) @ cdecl _sleep(long) MSVCRT__sleep @ varargs _snprintf(ptr long str) MSVCRT__snprintf -@ stub _snprintf_c -@ stub _snprintf_c_l +@ varargs _snprintf_c(ptr long str) MSVCRT_snprintf_c +@ varargs _snprintf_c_l(ptr long str ptr) MSVCRT_snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) MSVCRT__snprintf_l @ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s @ stub _snprintf_s_l @@ -1056,7 +1056,8 @@ @ cdecl _strxfrm_l(ptr str long ptr) MSVCRT__strxfrm_l @ cdecl _swab(str str long) MSVCRT__swab @ varargs _swprintf(ptr wstr) MSVCRT_swprintf -@ stub _swprintf_c +@ varargs _swprintf_c(ptr long str) MSVCRT_swprintf_c +@ varargs _swprintf_c_l(ptr long str ptr) MSVCRT_swprintf_c_l @ stub _swprintf_p @ varargs _swprintf_p_l(ptr long wstr ptr) MSVCRT_swprintf_p_l @ varargs _swprintf_s_l(ptr long wstr ptr) MSVCRT__swprintf_s_l diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 1b7e3810d8..1a7964a415 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -948,8 +948,8 @@ @ stub _setsystime(ptr long) @ cdecl _sleep(long) MSVCRT__sleep @ varargs _snprintf(ptr long str) MSVCRT__snprintf -@ stub _snprintf_c -@ stub _snprintf_c_l +@ varargs _snprintf_c(ptr long str) MSVCRT_snprintf_c +@ varargs _snprintf_c_l(ptr long str ptr) MSVCRT_snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) MSVCRT__snprintf_l @ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s @ stub _snprintf_s_l @@ -1031,8 +1031,8 @@ @ cdecl _strxfrm_l(ptr str long ptr) MSVCRT__strxfrm_l @ cdecl _swab(str str long) MSVCRT__swab @ varargs _swprintf(ptr wstr) MSVCRT_swprintf -@ stub _swprintf_c -@ stub _swprintf_c_l +@ varargs _swprintf_c(ptr long str) MSVCRT_swprintf_c +@ varargs _swprintf_c_l(ptr long str ptr) MSVCRT_swprintf_c_l @ stub _swprintf_p @ varargs _swprintf_p_l(ptr long wstr ptr) MSVCRT_swprintf_p_l @ varargs _swprintf_s_l(ptr long wstr ptr) MSVCRT__swprintf_s_l diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index e7be7d6982..6710c14245 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -909,8 +909,8 @@ @ stub _setsystime(ptr long) @ cdecl _sleep(long) MSVCRT__sleep @ varargs _snprintf(ptr long str) MSVCRT__snprintf -# stub _snprintf_c(ptr long str) -# stub _snprintf_c_l(ptr long str ptr) +@ varargs _snprintf_c(ptr long str) MSVCRT_snprintf_c +@ varargs _snprintf_c_l(ptr long str ptr) MSVCRT_snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) MSVCRT__snprintf_l @ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s # stub _snprintf_s_l(ptr long long str ptr) @@ -990,8 +990,8 @@ @ cdecl _strxfrm_l(ptr str long ptr) MSVCRT__strxfrm_l @ cdecl _swab(str str long) MSVCRT__swab @ varargs _swprintf(ptr wstr) MSVCRT_swprintf -# stub _swprintf_c(ptr long str) -# stub _swprintf_c_l(ptr long str ptr) +@ varargs _swprintf_c(ptr long str) MSVCRT_swprintf_c +@ varargs _swprintf_c_l(ptr long str ptr) MSVCRT_swprintf_c_l @ varargs _swprintf_p_l(ptr long wstr ptr) MSVCRT_swprintf_p_l @ varargs _swprintf_s_l(ptr long wstr ptr) MSVCRT__swprintf_s_l @ varargs _swscanf_l(wstr wstr ptr) MSVCRT__swscanf_l diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 7ceaa5c741..1932022c23 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -1176,6 +1176,33 @@ int WINAPIV MSVCRT__snprintf_l(char *str, unsigned int count, MSVCRT__locale_t l return retval; }
+/********************************************************************* + * _snprintf_c_l (MSVCRT.@) + */ +int WINAPIV MSVCRT_snprintf_c_l(char *str, unsigned int count, const char *format, + MSVCRT__locale_t locale, ...) +{ + int retval; + __ms_va_list valist; + __ms_va_start(valist, locale); + retval = MSVCRT_vsnprintf_c_l(str, count, format, locale, valist); + __ms_va_end(valist); + return retval; +} + +/********************************************************************* + * _snprintf_c (MSVCRT.@) + */ +int WINAPIV MSVCRT_snprintf_c(char *str, unsigned int count, const char *format, ...) +{ + int retval; + __ms_va_list valist; + __ms_va_start(valist, format); + retval = MSVCRT_vsnprintf_c(str, count, format, valist); + __ms_va_end(valist); + return retval; +} + /********************************************************************* * _snprintf_s (MSVCRT.@) */ @@ -1533,6 +1560,38 @@ int WINAPIV MSVCRT__swprintf_s_l(MSVCRT_wchar_t *str, MSVCRT_size_t numberOfElem return r; }
+/********************************************************************* + * _swprintf_c_l (MSVCRT.@) + */ +int WINAPIV MSVCRT_swprintf_c_l(MSVCRT_wchar_t *str, MSVCRT_size_t len, + const MSVCRT_wchar_t *format, MSVCRT__locale_t locale, ... ) +{ + __ms_va_list ap; + int r; + + __ms_va_start(ap, locale); + r = MSVCRT_vswprintf_c_l(str, len, format, locale, ap); + __ms_va_end(ap); + + return r; +} + +/********************************************************************* + * _swprintf_c (MSVCRT.@) + */ +int WINAPIV MSVCRT_swprintf_c(MSVCRT_wchar_t *str, MSVCRT_size_t len, + const MSVCRT_wchar_t *format, ... ) +{ + __ms_va_list ap; + int r; + + __ms_va_start(ap, format); + r = MSVCRT_vswprintf_c(str, len, format, ap); + __ms_va_end(ap); + + return r; +} + /********************************************************************* * _vswprintf (MSVCRT.@) */
Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/msvcrt/wcs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 1932022c23..4e73169647 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -1165,12 +1165,12 @@ int WINAPIV MSVCRT__snprintf(char *str, unsigned int len, const char *format, .. /********************************************************************* * _snprintf_l (MSVCRT.@) */ -int WINAPIV MSVCRT__snprintf_l(char *str, unsigned int count, MSVCRT__locale_t locale, - const char *format, ...) +int WINAPIV MSVCRT__snprintf_l(char *str, unsigned int count, const char *format, + MSVCRT__locale_t locale, ...) { int retval; __ms_va_list valist; - __ms_va_start(valist, format); + __ms_va_start(valist, locale); retval = MSVCRT_vsnprintf_l(str, count, format, locale, valist); __ms_va_end(valist); return retval;
Hi Gijs,
Since you're fixing the signature I've also added a patch to change len and count parameter types to size_t.
Thanks for working on it, Piotr
Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr120_app/msvcr120_app.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/msvcrt.spec | 2 +- dlls/msvcrt/wcs.c | 14 ++++++++++++++ 8 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 4e6041e81e..577fb69b5a 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1297,7 +1297,7 @@ @ varargs _snprintf_c_l(ptr long str ptr) MSVCRT_snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) MSVCRT__snprintf_l @ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s -@ stub _snprintf_s_l +@ varargs _snprintf_s_l(ptr long long str ptr) MSVCRT_snprintf_s_l @ varargs _snscanf(str long str) MSVCRT__snscanf @ varargs _snscanf_l(str long str ptr) MSVCRT__snscanf_l @ varargs _snscanf_s(str long str) MSVCRT__snscanf_s diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index d8e6ffac2c..97edbec6a7 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1654,7 +1654,7 @@ @ varargs _snprintf_c_l(ptr long str ptr) MSVCRT_snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) MSVCRT__snprintf_l @ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s -@ stub _snprintf_s_l +@ varargs _snprintf_s_l(ptr long long str ptr) MSVCRT_snprintf_s_l @ varargs _snscanf(str long str) MSVCRT__snscanf @ varargs _snscanf_l(str long str ptr) MSVCRT__snscanf_l @ varargs _snscanf_s(str long str) MSVCRT__snscanf_s diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 168ac8b332..1aa63de64a 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1665,7 +1665,7 @@ @ varargs _snprintf_c_l(ptr long str ptr) MSVCRT_snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) MSVCRT__snprintf_l @ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s -@ stub _snprintf_s_l +@ varargs _snprintf_s_l(ptr long long str ptr) MSVCRT_snprintf_s_l @ varargs _snscanf(str long str) MSVCRT__snscanf @ varargs _snscanf_l(str long str ptr) MSVCRT__snscanf_l @ varargs _snscanf_s(str long str) MSVCRT__snscanf_s diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index be0d87776d..2013b06cc7 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1384,7 +1384,7 @@ @ varargs _snprintf_c_l(ptr long str ptr) msvcr120._snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) msvcr120._snprintf_l @ varargs _snprintf_s(ptr long long str) msvcr120._snprintf_s -@ stub _snprintf_s_l +@ varargs _snprintf_s_l(ptr long long str ptr) msvcr120._snprintf_s_l @ varargs _snscanf(str long str) msvcr120._snscanf @ varargs _snscanf_l(str long str ptr) msvcr120._snscanf_l @ varargs _snscanf_s(str long str) msvcr120._snscanf_s diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 539c548aff..a31943e4d7 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -977,7 +977,7 @@ @ varargs _snprintf_c_l(ptr long str ptr) MSVCRT_snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) MSVCRT__snprintf_l @ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s -@ stub _snprintf_s_l +@ varargs _snprintf_s_l(ptr long long str ptr) MSVCRT_snprintf_s_l @ varargs _snscanf(str long str) MSVCRT__snscanf @ varargs _snscanf_l(str long str ptr) MSVCRT__snscanf_l @ varargs _snscanf_s(str long str) MSVCRT__snscanf_s diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 1a7964a415..ff58757cb8 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -952,7 +952,7 @@ @ varargs _snprintf_c_l(ptr long str ptr) MSVCRT_snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) MSVCRT__snprintf_l @ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s -@ stub _snprintf_s_l +@ varargs _snprintf_s_l(ptr long long str ptr) MSVCRT_snprintf_s_l @ varargs _snscanf(str long str) MSVCRT__snscanf @ varargs _snscanf_l(str long str ptr) MSVCRT__snscanf_l @ varargs _snscanf_s(str long str) MSVCRT__snscanf_s diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 6710c14245..6da32d025d 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -913,7 +913,7 @@ @ varargs _snprintf_c_l(ptr long str ptr) MSVCRT_snprintf_c_l @ varargs _snprintf_l(ptr long str ptr) MSVCRT__snprintf_l @ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s -# stub _snprintf_s_l(ptr long long str ptr) +@ varargs _snprintf_s_l(ptr long long str ptr) MSVCRT_snprintf_s_l @ varargs _snscanf(str long str) MSVCRT__snscanf @ varargs _snscanf_l(str long str ptr) MSVCRT__snscanf_l @ varargs _snscanf_s(str long str) MSVCRT__snscanf_s diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 4e73169647..12de48b194 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -1203,6 +1203,20 @@ int WINAPIV MSVCRT_snprintf_c(char *str, unsigned int count, const char *format, return retval; }
+/********************************************************************* + * _snprintf_s_l (MSVCRT.@) + */ +int WINAPIV MSVCRT_snprintf_s_l(char *str, unsigned int len, unsigned int count, + const char *format, MSVCRT__locale_t locale, ...) +{ + int retval; + __ms_va_list valist; + __ms_va_start(valist, locale); + retval = MSVCRT_vsnprintf_s_l(str, len, count, format, locale, valist); + __ms_va_end(valist); + return retval; +} + /********************************************************************* * _snprintf_s (MSVCRT.@) */