From 4d5b9f01957116f7de1ecc422038ed8fe3fa802e Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 3 Nov 2024 18:52:57 +0100 Subject: [PATCH] Align registry key name casing with microsoft --- src/windows-emulator/syscalls.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/windows-emulator/syscalls.cpp b/src/windows-emulator/syscalls.cpp index 7c23905..4888792 100644 --- a/src/windows-emulator/syscalls.cpp +++ b/src/windows-emulator/syscalls.cpp @@ -5,6 +5,7 @@ #include "syscall_utils.hpp" #include +#include #include namespace @@ -104,7 +105,13 @@ namespace if (key_information_class == KeyNameInformation) { - const auto key_name = (key->hive / key->path).wstring(); + auto key_name = (key->hive / key->path).wstring(); + while (key_name.ends_with('/') || key_name.ends_with('\\')) + { + key_name.pop_back(); + } + + std::ranges::transform(key_name, key_name.begin(), std::towupper); const auto required_size = sizeof(KEY_NAME_INFORMATION) + (key_name.size() * 2) - 1; result_length.write(static_cast(required_size));