diff --git a/dll/win32/msvcrt/msvcrt.spec b/dll/win32/msvcrt/msvcrt.spec index 4e0c07aa950..ba302857bc1 100644 --- a/dll/win32/msvcrt/msvcrt.spec +++ b/dll/win32/msvcrt/msvcrt.spec @@ -622,7 +622,7 @@ @ varargs _snprintf(ptr long str) @ varargs _snscanf(str long str) @ varargs _snwprintf(ptr long wstr) -# stub _snwscanf +@ varargs _snwscanf(wstr long wstr) @ varargs _sopen(str long long) @ varargs _spawnl(long str str) @ varargs _spawnle(long str str) diff --git a/sdk/lib/crt/string/scanf.c b/sdk/lib/crt/string/scanf.c index bb6f098967e..aa2f2d34795 100644 --- a/sdk/lib/crt/string/scanf.c +++ b/sdk/lib/crt/string/scanf.c @@ -95,6 +95,14 @@ static int wchar2digit(wchar_t c, int base) { #undef SECURE #include "scanf.h" +/* vsnwscanf_l */ +#define WIDE_SCANF 1 +#undef CONSOLE +#define STRING 1 +#define STRING_LEN 1 +#undef SECURE +#include "scanf.h" + #ifndef _LIBCNT_ /* vcscanf_l */ #undef WIDE_SCANF @@ -208,6 +216,21 @@ int CDECL _cscanf(const char *format, ...) } #endif +/********************************************************************* + * _snwscanf (MSVCRT.@) + */ +int WINAPIV _snwscanf(const wchar_t *input, size_t length, + const wchar_t *format, ...) +{ + __ms_va_list valist; + int res; + + __ms_va_start(valist, format); + res = vsnwscanf_l(input, length, format, NULL, valist); + __ms_va_end(valist); + return res; +} + /********************************************************************* * _snscanf (MSVCRT.@) */