From 080ac7bd97edf0f9266360bce21c37c4eeb943ed Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 4 Aug 2025 17:40:27 +0300 Subject: [PATCH] [LIBCNTPR] Implement NT version of towupper --- sdk/lib/crt/string/ctype.c | 2 ++ sdk/lib/crt/string/string.cmake | 1 + sdk/lib/crt/string/towupper_nt.c | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 sdk/lib/crt/string/towupper_nt.c diff --git a/sdk/lib/crt/string/ctype.c b/sdk/lib/crt/string/ctype.c index 053bce17a03..7da531f7901 100644 --- a/sdk/lib/crt/string/ctype.c +++ b/sdk/lib/crt/string/ctype.c @@ -895,6 +895,7 @@ wint_t __cdecl towlower(wint_t c) return(c); } +#ifndef _LIBCNT_ /* * @implemented */ @@ -904,5 +905,6 @@ wint_t __cdecl towupper(wint_t c) return (c + upalpha); return(c); } +#endif /* _LIBCNT_ */ /* EOF */ diff --git a/sdk/lib/crt/string/string.cmake b/sdk/lib/crt/string/string.cmake index e7e95c8a1b6..3a80ab7938d 100644 --- a/sdk/lib/crt/string/string.cmake +++ b/sdk/lib/crt/string/string.cmake @@ -112,6 +112,7 @@ list(APPEND CRT_STRING_ASM_SOURCE list(APPEND LIBCNTPR_STRING_SOURCE string/mbstowcs_nt.c + string/towupper_nt.c string/wcstombs_nt.c ) diff --git a/sdk/lib/crt/string/towupper_nt.c b/sdk/lib/crt/string/towupper_nt.c new file mode 100644 index 00000000000..4b85e7a01fc --- /dev/null +++ b/sdk/lib/crt/string/towupper_nt.c @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS NT CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of towupper + * COPYRIGHT: Copyright 2025 Timo Kreuzer + */ + +#define WIN32_NO_STATUS +#include +#include + +_Check_return_ +_CRTIMP +wint_t +__cdecl +towupper( + _In_ wint_t _C) +{ + return RtlUpcaseUnicodeChar((WCHAR)_C); +}