Fix reading unicode strings

This commit is contained in:
Maurice Heumann
2025-04-14 15:03:16 +02:00
parent f3caea91de
commit 91c7ce43a1
6 changed files with 13 additions and 22 deletions

View File

@@ -29,8 +29,7 @@ namespace syscalls
const auto attributes = object_attributes.read();
if (attributes.ObjectName)
{
auto name = read_unicode_string(
c.emu, reinterpret_cast<UNICODE_STRING<EmulatorTraits<Emu64>>*>(attributes.ObjectName));
auto name = read_unicode_string(c.emu, attributes.ObjectName);
c.win_emu.log.print(color::dark_gray, "--> Section with name %s\n", u16_to_u8(name).c_str());
s.name = std::move(name);
}
@@ -60,8 +59,7 @@ namespace syscalls
{
const auto attributes = object_attributes.read();
auto filename =
read_unicode_string(c.emu, reinterpret_cast<UNICODE_STRING<EmulatorTraits<Emu64>>*>(attributes.ObjectName));
auto filename = read_unicode_string(c.emu, attributes.ObjectName);
c.win_emu.log.print(color::dark_gray, "--> Opening section: %s\n", u16_to_u8(filename).c_str());
if (filename == u"\\Windows\\SharedSection")