From dd039f8f4bf55ca766cbb11579f882309c167a73 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sat, 21 Sep 2024 20:26:20 +0200 Subject: [PATCH] Support stdout buffering --- src/sample/main.cpp | 2 +- src/windows_emulator/syscalls.cpp | 2 +- src/windows_emulator/windows_emulator.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sample/main.cpp b/src/sample/main.cpp index a327d4f..e2bb9c0 100644 --- a/src/sample/main.cpp +++ b/src/sample/main.cpp @@ -67,7 +67,7 @@ namespace }; //watch_system_objects(win_emu); - + win_emu.buffer_stdout = true; const auto& exe = *win_emu.process().executable; diff --git a/src/windows_emulator/syscalls.cpp b/src/windows_emulator/syscalls.cpp index bcfda83..bdaf28d 100644 --- a/src/windows_emulator/syscalls.cpp +++ b/src/windows_emulator/syscalls.cpp @@ -367,7 +367,7 @@ namespace const emulator_object info_obj{c.emu, fs_information}; info_obj.access([&](FILE_FS_DEVICE_INFORMATION& info) { - if (file_handle == STDOUT_HANDLE.bits) + if (file_handle == STDOUT_HANDLE.bits && !c.win_emu.buffer_stdout) { info.DeviceType = FILE_DEVICE_CONSOLE; info.Characteristics = 0x20000; diff --git a/src/windows_emulator/windows_emulator.cpp b/src/windows_emulator/windows_emulator.cpp index 9771d50..c48d529 100644 --- a/src/windows_emulator/windows_emulator.cpp +++ b/src/windows_emulator/windows_emulator.cpp @@ -602,7 +602,7 @@ void windows_emulator::setup_hooks() printf("!!! DLL init: %s\n", name); }*/ - if (!this->verbose_ && !this->verbose_calls_ && !is_interesting_call) + if (!this->verbose && !this->verbose_calls && !is_interesting_call) { return; } @@ -628,7 +628,7 @@ void windows_emulator::setup_hooks() } } - if (!this->verbose_) + if (!this->verbose) { return; }