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