From 26933a0965aad1473684d71634ff6ed6bbbde695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Tue, 17 Jul 2018 01:47:59 +0200 Subject: [PATCH] [WIN32K:NTUSER] Similarly to what was done in USERSRV for harderrors, introduce the _scwprintf() helper function based on the imported _vscwprintf(). --- win32ss/user/ntuser/misc.c | 24 ++++++++++++++++++++++++ win32ss/user/ntuser/userfuncs.h | 6 ++++++ 2 files changed, 30 insertions(+) diff --git a/win32ss/user/ntuser/misc.c b/win32ss/user/ntuser/misc.c index fee2e91388f..83d0ad1fe58 100644 --- a/win32ss/user/ntuser/misc.c +++ b/win32ss/user/ntuser/misc.c @@ -9,6 +9,30 @@ #include DBG_DEFAULT_CHANNEL(UserMisc); + +/* + * NOTE: _scwprintf() is NOT exported by ntoskrnl.exe, + * only _vscwprintf() is, so we need to implement it here. + * Code comes from sdk/lib/crt/printf/_scwprintf.c . + * See also win32ss/user/winsrv/usersrv/harderror.c . + */ +int +__cdecl +_scwprintf( + const wchar_t *format, + ...) +{ + int len; + va_list args; + + va_start(args, format); + len = _vscwprintf(format, args); + va_end(args); + + return len; +} + + /* * Test the Thread to verify and validate it. Hard to the core tests are required. */ diff --git a/win32ss/user/ntuser/userfuncs.h b/win32ss/user/ntuser/userfuncs.h index efa89aec13f..29ae2394dd8 100644 --- a/win32ss/user/ntuser/userfuncs.h +++ b/win32ss/user/ntuser/userfuncs.h @@ -92,6 +92,12 @@ HKL FASTCALL UserGetKeyboardLayout(DWORD dwThreadId); /*************** MISC.C ***************/ +int +__cdecl +_scwprintf( + const wchar_t *format, + ...); + BOOL FASTCALL UserSystemParametersInfo( UINT uiAction,