From db1aad37a8664f463b8409d45ce615cd4cc2db9c Mon Sep 17 00:00:00 2001 From: Tixx <83774803+WiserTixx@users.noreply.github.com> Date: Sun, 21 Sep 2025 21:06:36 +0200 Subject: [PATCH] Change and debug CreateProcessW params --- src/GameStart.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/GameStart.cpp b/src/GameStart.cpp index 0632606..ce29187 100644 --- a/src/GameStart.cpp +++ b/src/GameStart.cpp @@ -148,7 +148,13 @@ void StartGame(std::wstring Dir) { debug(L"BeamNG executable path: " + Dir); - bSuccess = CreateProcessW(nullptr, (wchar_t*)(Dir + gameArgs).c_str(), nullptr, nullptr, TRUE, 0, nullptr, BaseDir.c_str(), &si, &pi); + wchar_t* lpApplicationName = Dir.data(); + wchar_t* lpCommandLine = (Dir + gameArgs).data(); + + debug(L"lpApplicationName: " + std::wstring(lpApplicationName)); + debug(L"lpCommandLine: " + std::wstring(lpCommandLine)); + + bSuccess = CreateProcessW(lpApplicationName, lpCommandLine, nullptr, nullptr, TRUE, 0, nullptr, BaseDir.c_str(), &si, &pi); if (bSuccess) { info("Game Launched!"); GamePID = pi.dwProcessId;