Add support for user_object/user_handle_table

This commit is contained in:
Igor Pissolati
2026-01-02 16:21:43 -03:00
parent 0de53515ed
commit de491ade0e
11 changed files with 628 additions and 13 deletions

View File

@@ -463,7 +463,7 @@ namespace syscalls
return STATUS_INVALID_HANDLE;
}
if (auto* e = c.win_emu.process.events.get(event))
if (auto* e = c.proc.events.get(event))
{
e->signaled = false;
}
@@ -831,7 +831,7 @@ namespace syscalls
const hwnd /*parent*/, const hmenu /*menu*/, const hinstance /*instance*/, const pointer /*l_param*/,
const DWORD /*flags*/, const pointer /*acbi_buffer*/)
{
window win{};
auto [handle, win] = c.proc.windows.create(c.win_emu.memory);
win.x = x;
win.y = y;
win.width = width;
@@ -840,7 +840,7 @@ namespace syscalls
win.class_name = read_large_string(class_name);
win.name = read_large_string(window_name);
return c.proc.windows.store(std::move(win)).bits;
return handle.bits;
}
BOOL handle_NtUserDestroyWindow(const syscall_context& c, const hwnd window)
@@ -1027,6 +1027,19 @@ namespace syscalls
{
return STATUS_NOT_SUPPORTED;
}
BOOL handle_NtUserGetHDevName(const syscall_context& c, handle hdev, emulator_pointer device_name)
{
if (hdev != c.proc.default_monitor_handle)
{
return FALSE;
}
const std::u16string name = u"\\\\.\\DISPLAY1";
c.emu.write_memory(device_name, name.c_str(), (name.size() + 1) * sizeof(char16_t));
return TRUE;
}
}
void syscall_dispatcher::add_handlers(std::map<std::string, syscall_handler>& handler_mapping)
@@ -1239,6 +1252,7 @@ void syscall_dispatcher::add_handlers(std::map<std::string, syscall_handler>& ha
add_handler(NtSetInformationDebugObject);
add_handler(NtRemoveProcessDebug);
add_handler(NtNotifyChangeDirectoryFileEx);
add_handler(NtUserGetHDevName);
#undef add_handler
}