mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-20 04:03:57 +00:00
Add partial NtContinueEx support
This commit is contained in:
@@ -361,22 +361,39 @@ namespace syscalls
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS handle_NtContinue(const syscall_context& c, const emulator_object<CONTEXT64> thread_context,
|
||||
const BOOLEAN raise_alert)
|
||||
NTSTATUS handle_NtContinueEx(const syscall_context& c, const emulator_object<CONTEXT64> thread_context,
|
||||
const uint64_t continue_argument)
|
||||
{
|
||||
c.write_status = false;
|
||||
|
||||
if (raise_alert)
|
||||
{
|
||||
c.win_emu.current_thread().apc_alertable = false;
|
||||
}
|
||||
|
||||
const auto context = thread_context.read();
|
||||
cpu_context::restore(c.emu, context);
|
||||
|
||||
KCONTINUE_ARGUMENT argument{};
|
||||
|
||||
if (continue_argument <= 0xFF)
|
||||
{
|
||||
argument.ContinueFlags = KCONTINUE_FLAG_TEST_ALERT;
|
||||
}
|
||||
else
|
||||
{
|
||||
argument = c.emu.read_memory<KCONTINUE_ARGUMENT>(continue_argument);
|
||||
}
|
||||
|
||||
if (argument.ContinueFlags & KCONTINUE_FLAG_TEST_ALERT)
|
||||
{
|
||||
c.win_emu.yield_thread(true);
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS handle_NtContinue(const syscall_context& c, const emulator_object<CONTEXT64> thread_context,
|
||||
const BOOLEAN raise_alert)
|
||||
{
|
||||
return handle_NtContinueEx(c, thread_context, raise_alert ? 1 : 0);
|
||||
}
|
||||
|
||||
NTSTATUS handle_NtGetNextThread(const syscall_context& c, const handle process_handle, const handle thread_handle,
|
||||
const ACCESS_MASK /*desired_access*/, const ULONG /*handle_attributes*/,
|
||||
const ULONG flags, const emulator_object<handle> new_thread_handle)
|
||||
|
||||
Reference in New Issue
Block a user