diff --git a/src/windows-emulator/syscalls.cpp b/src/windows-emulator/syscalls.cpp index 30f177bd..7aa165dd 100644 --- a/src/windows-emulator/syscalls.cpp +++ b/src/windows-emulator/syscalls.cpp @@ -58,7 +58,18 @@ namespace const emulator_object object_attributes) { const auto attributes = object_attributes.read(); - const auto key = read_unicode_string(c.emu, attributes.ObjectName); + auto key = read_unicode_string(c.emu, attributes.ObjectName); + + if (attributes.RootDirectory) + { + const auto* parent_handle = c.proc.registry_keys.get(reinterpret_cast(attributes.RootDirectory)); + if (!parent_handle) + { + return STATUS_INVALID_HANDLE; + } + + key = parent_handle->hive / parent_handle->path / key; + } c.win_emu.logger.print(color::dark_gray, "--> Registry key: %S\n", key.c_str());