diff --git a/src/common/win32/InlineFunc.cpp b/src/common/win32/InlineFunc.cpp index 9e255c084..ce0d2701e 100644 --- a/src/common/win32/InlineFunc.cpp +++ b/src/common/win32/InlineFunc.cpp @@ -68,6 +68,9 @@ std::optional CxbxExec(bool useDebugger, HANDLE* hProcess, bool req Using ShellExecute has proper implement. Unfortunately, we need created process handle for Debugger monitor. Plus ShellExecute is high level whilst CreateProcess is low level. We want to use official low level functions as possible to reduce cpu load cycles to get the task done. + + Without the DETACHED_PROCESS flag, the default behavior would be for the new process to inherit the console of the parent process, + which is wrong since we want the emulation process to have its own console allocated with AllocConsole instead. */ if (CreateProcess(nullptr, const_cast(szProcArgsBuffer.c_str()), nullptr, nullptr, false, DETACHED_PROCESS, nullptr, nullptr, &startupInfo, &processInfo) == 0) { return std::make_optional("Failed to create the new emulation process. CreateProcess failed because: " + WinError2Str());