mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-20 20:23:57 +00:00
Add NtRaiseHardError error message logging
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
|
||||
namespace syscalls
|
||||
{
|
||||
NTSTATUS handle_NtRaiseHardError(const syscall_context& c, const NTSTATUS error_status, const ULONG /*number_of_parameters*/,
|
||||
NTSTATUS handle_NtRaiseHardError(const syscall_context& c, const NTSTATUS error_status, const ULONG number_of_parameters,
|
||||
const emulator_object<UNICODE_STRING<EmulatorTraits<Emu64>>>
|
||||
/*unicode_string_parameter_mask*/,
|
||||
const emulator_object<DWORD> /*parameters*/, const HARDERROR_RESPONSE_OPTION /*valid_response_option*/,
|
||||
/*unicode_string_parameter_mask*/,
|
||||
const uint64_t parameters, const HARDERROR_RESPONSE_OPTION /*valid_response_option*/,
|
||||
const emulator_object<HARDERROR_RESPONSE> response)
|
||||
{
|
||||
if (response)
|
||||
@@ -15,6 +15,18 @@ namespace syscalls
|
||||
response.write(ResponseAbort);
|
||||
}
|
||||
|
||||
if (error_status & STATUS_SERVICE_NOTIFICATION && number_of_parameters >= 3)
|
||||
{
|
||||
ULONG_PTR params[3] = {0, 0, 0};
|
||||
|
||||
if (c.emu.try_read_memory(parameters, ¶ms, sizeof(params)))
|
||||
{
|
||||
std::u16string message =
|
||||
read_unicode_string(c.emu, emulator_object<UNICODE_STRING<EmulatorTraits<Emu64>>>{c.emu, params[0]});
|
||||
c.win_emu.log.error("Error Message: %s\n", u16_to_u8(message).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
c.proc.exit_status = error_status;
|
||||
c.win_emu.callbacks.on_exception();
|
||||
c.emu.stop();
|
||||
|
||||
Reference in New Issue
Block a user