From 7e6731be9a96d614633c6ed5edb74d84f2d07023 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sat, 14 Sep 2024 16:12:48 +0200 Subject: [PATCH] GDI progress --- src/windows_emulator/std_include.hpp | 1 + src/windows_emulator/syscalls.cpp | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/windows_emulator/std_include.hpp b/src/windows_emulator/std_include.hpp index f28d5cde..05e56c34 100644 --- a/src/windows_emulator/std_include.hpp +++ b/src/windows_emulator/std_include.hpp @@ -61,6 +61,7 @@ #define PHNT_VERSION PHNT_WIN11 #include #include +#include #ifdef _WIN32 #pragma warning(pop) diff --git a/src/windows_emulator/syscalls.cpp b/src/windows_emulator/syscalls.cpp index 64e73074..b38d7f60 100644 --- a/src/windows_emulator/syscalls.cpp +++ b/src/windows_emulator/syscalls.cpp @@ -1337,9 +1337,22 @@ namespace return STATUS_NOT_SUPPORTED; } - NTSTATUS handle_NtGdiInit2() + NTSTATUS handle_NtGdiInit2(const syscall_context& c) { - puts("NtGdiInit2 not supported"); + c.proc.peb.access([&](PEB& peb) + { + if (!peb.GdiSharedHandleTable) + { + peb.GdiSharedHandleTable = c.proc.gs_segment.reserve().ptr(); + } + }); + + return STATUS_SUCCESS; + } + + NTSTATUS handle_NtUserGetThreadState() + { + puts("NtUserGetThreadState not supported"); return STATUS_NOT_SUPPORTED; } @@ -1681,6 +1694,7 @@ void syscall_dispatcher::add_handlers() add_handler(NtQueryWnfStateNameInformation); add_handler(NtAlpcSendWaitReceivePort); add_handler(NtGdiInit2); + add_handler(NtUserGetThreadState); #undef add_handler