https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6f559e9c548b19cb06f1f…
commit 6f559e9c548b19cb06f1fc388716a78885614f98
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Mon Mar 21 01:14:28 2022 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Apr 3 20:41:11 2022 +0200
[RTL][NTOS_VISTA] Move the RTL UTF8 functions to the main RTL library, to be linked in
the rtl_vista target instead.
The reason is that both RtlUTF8ToUnicodeN() and RtlUnicodeToUTF8N() are
exported in both kernel and user-mode (ntdll) in Windows 7+.
Conversion from and to UTF8 are fundamental enough that they indeed
deserve to be in a separate file.
---
sdk/lib/drivers/ntoskrnl_vista/CMakeLists.txt | 6 +++---
sdk/lib/rtl/CMakeLists.txt | 2 +-
sdk/lib/rtl/runonce.c | 2 +-
sdk/lib/{drivers/ntoskrnl_vista/rtl.c => rtl/utf8.c} | 19 +++++++++++--------
4 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/sdk/lib/drivers/ntoskrnl_vista/CMakeLists.txt
b/sdk/lib/drivers/ntoskrnl_vista/CMakeLists.txt
index 78658c54bd0..9cb2838f2a0 100644
--- a/sdk/lib/drivers/ntoskrnl_vista/CMakeLists.txt
+++ b/sdk/lib/drivers/ntoskrnl_vista/CMakeLists.txt
@@ -4,14 +4,14 @@ add_definitions(-D_WIN32_WINNT=0x600)
add_definitions(-DUNICODE -D_UNICODE -D__NTOSKRNL__ -D_NTOSKRNL_ -D_NTSYSTEM_)
list(APPEND SOURCE
- etw.c
+ etw.c
fsrtl.c
io.c
po.c
- ke.c
- rtl.c)
+ ke.c)
add_library(ntoskrnl_vista ${SOURCE})
+target_link_libraries(ntoskrnl_vista PRIVATE rtl_vista)
add_dependencies(ntoskrnl_vista bugcodes xdk)
target_compile_definitions(ntoskrnl_vista PUBLIC NTKRNLVISTA)
diff --git a/sdk/lib/rtl/CMakeLists.txt b/sdk/lib/rtl/CMakeLists.txt
index 5a0158675d5..042e51e4e4a 100644
--- a/sdk/lib/rtl/CMakeLists.txt
+++ b/sdk/lib/rtl/CMakeLists.txt
@@ -116,7 +116,7 @@ list(APPEND SOURCE_VISTA
condvar.c
runonce.c
srw.c
-)
+ utf8.c)
add_library(rtl_vista ${SOURCE_VISTA})
add_pch(rtl_vista rtl_vista.h SOURCE_VISTA)
diff --git a/sdk/lib/rtl/runonce.c b/sdk/lib/rtl/runonce.c
index 10401287983..0ffa49b9fa4 100644
--- a/sdk/lib/rtl/runonce.c
+++ b/sdk/lib/rtl/runonce.c
@@ -1,7 +1,7 @@
/* Taken from Wine ntdll/sync.c */
-#include "rtl_vista.h"
+#include <rtl_vista.h>
#include <wine/config.h>
#include <wine/port.h>
diff --git a/sdk/lib/drivers/ntoskrnl_vista/rtl.c b/sdk/lib/rtl/utf8.c
similarity index 93%
rename from sdk/lib/drivers/ntoskrnl_vista/rtl.c
rename to sdk/lib/rtl/utf8.c
index 5adfc97943a..1de9d5fe249 100644
--- a/sdk/lib/drivers/ntoskrnl_vista/rtl.c
+++ b/sdk/lib/rtl/utf8.c
@@ -1,15 +1,18 @@
/*
- * PROJECT: ReactOS Kernel - Vista+ APIs
- * LICENSE: GPL v2 - See COPYING in the top level directory
- * FILE: lib/drivers/ntoskrnl_vista/rtl.c
- * PURPOSE: Rtl functions of Vista+
- * PROGRAMMERS: Thomas Faber <thomas.faber(a)reactos.org>
+ * PROJECT: ReactOS Kernel - Vista+ APIs
+ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Rtl functions of Vista+
+ * COPYRIGHT: 2016 Thomas Faber <thomas.faber(a)reactos.org>
*/
-#include <ntdef.h>
-#include <ntifs.h>
+/* INCLUDES ******************************************************************/
-typedef UCHAR BYTE;
+#include <rtl_vista.h>
+
+#define NDEBUG
+#include <debug.h>
+
+/* FUNCTIONS *****************************************************************/
/******************************************************************************
* RtlUnicodeToUTF8N [NTDLL.@]