https://git.reactos.org/?p=reactos.git;a=commitdiff;h=315765ed8b0334fb3a3f2…
commit 315765ed8b0334fb3a3f26b458a5acee2583c8f3
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sun Mar 15 01:03:14 2020 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 15 13:12:20 2020 +0100
[MSVCRT] Add _snwscanf
---
dll/win32/msvcrt/msvcrt.spec | 2 +-
sdk/lib/crt/string/scanf.c | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+), 1 deletion(-)
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.@)
*/