Explicitly use wide version of win API

This commit is contained in:
Exzap 2025-11-21 22:18:14 +01:00
parent c7c7e5c29d
commit 518eca80c3
6 changed files with 22 additions and 42 deletions

View file

@ -590,16 +590,16 @@ void CemuUpdateWindow::OnClose(wxCloseEvent& event)
if (m_restartRequired && !m_restartFile.empty() && fs::exists(m_restartFile))
{
PROCESS_INFORMATION pi{};
STARTUPINFO si{};
STARTUPINFOW si{};
si.cb = sizeof(si);
std::wstring cmdline = GetCommandLineW();
const auto index = cmdline.find('"', 1);
cemu_assert_debug(index != std::wstring::npos);
cmdline = L"\"" + m_restartFile.wstring() + L"\"" + cmdline.substr(index + 1);
cmdline = L"\"" + boost::nowide::widen(_pathToUtf8(m_restartFile)) + L"\"" + cmdline.substr(index + 1);
HANDLE lock = CreateMutex(nullptr, TRUE, L"Global\\cemu_update_lock");
CreateProcess(nullptr, (wchar_t*)cmdline.c_str(), nullptr, nullptr, FALSE, 0, nullptr, nullptr, &si, &pi);
HANDLE lock = CreateMutexW(nullptr, TRUE, L"Global\\cemu_update_lock");
CreateProcessW(nullptr, (wchar_t*)cmdline.c_str(), nullptr, nullptr, FALSE, 0, nullptr, nullptr, &si, &pi);
exit(0);
}