diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index e21da6cbe5..938f61014c 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -342,8 +342,8 @@ @ stub _crt_debugger_hook @ varargs _cscanf(str) msvcrt._cscanf @ varargs _cscanf_l(str ptr) msvcrt._cscanf_l -@ stub _cscanf_s -@ stub _cscanf_s_l +@ varargs _cscanf_s(str) msvcrt._cscanf_s +@ varargs _cscanf_s_l(str ptr) msvcrt._cscanf_s_l @ cdecl _ctime32(ptr) msvcrt._ctime32 @ stub _ctime32_s @ cdecl _ctime64(ptr) msvcrt._ctime64 diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index ad8537866e..3f9de550b4 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -334,8 +334,8 @@ @ stub _crt_debugger_hook @ varargs _cscanf(str) msvcrt._cscanf @ varargs _cscanf_l(str ptr) msvcrt._cscanf_l -@ stub _cscanf_s -@ stub _cscanf_s_l +@ varargs _cscanf_s(str) msvcrt._cscanf_s +@ varargs _cscanf_s_l(str ptr) msvcrt._cscanf_s_l @ cdecl _ctime32(ptr) msvcrt._ctime32 @ stub _ctime32_s @ cdecl _ctime64(ptr) msvcrt._ctime64 diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 9b6689857d..e9b898afeb 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -315,8 +315,8 @@ # stub _crtDbgFlag @ varargs _cscanf(str) @ varargs _cscanf_l(str ptr) -# stub _cscanf_s -# stub _cscanf_s_l +@ varargs _cscanf_s(str) +@ varargs _cscanf_s_l(str ptr) @ cdecl _ctime32(ptr) MSVCRT__ctime32 # stub _ctime32_s @ cdecl _ctime64(ptr) MSVCRT__ctime64 diff --git a/dlls/msvcrt/scanf.c b/dlls/msvcrt/scanf.c index cfb4aa0e89..298d4c979b 100644 --- a/dlls/msvcrt/scanf.c +++ b/dlls/msvcrt/scanf.c @@ -109,6 +109,10 @@ static int wchar2digit(MSVCRT_wchar_t c, int base) { #undef SECURE #include "scanf.h" +/* vcscanf_s_l */ +#define SECURE 1 +#include "scanf.h" + /********************************************************************* * fscanf (MSVCRT.@) @@ -483,3 +487,31 @@ int CDECL _cscanf_l(const char *format, MSVCRT__locale_t locale, ...) __ms_va_end(valist); return res; } + +/********************************************************************* + * _cscanf_s (MSVCRT.@) + */ +int CDECL _cscanf_s(const char *format, ...) +{ + __ms_va_list valist; + int res; + + __ms_va_start(valist, format); + res = MSVCRT_vcscanf_s_l(format, NULL, valist); + __ms_va_end(valist); + return res; +} + +/********************************************************************* + * _cscanf_s_l (MSVCRT.@) + */ +int CDECL _cscanf_s_l(const char *format, MSVCRT__locale_t locale, ...) +{ + __ms_va_list valist; + int res; + + __ms_va_start(valist, locale); + res = MSVCRT_vcscanf_s_l(format, locale, valist); + __ms_va_end(valist); + return res; +}