Skip to content

Commit

Permalink
WIN32 - Use W Methods for Aura::sysExec
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Mar 5, 2024
1 parent 91a39f1 commit e595fee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/aura.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ namespace Nickvision::App
HANDLE write;
if(CreatePipe(&read, &write, &sa, 0))
{
STARTUPINFOA si{ 0 };
STARTUPINFOW si{ 0 };
PROCESS_INFORMATION pi{ 0 };
std::string commandCopy{ "cmd.exe /C \"" + command + "\"" };
si.cb = sizeof(STARTUPINFOA);
std::wstring commandCopy{ L"cmd.exe /C \"" + StringHelpers::toWstring(command) + L"\"" };
si.cb = sizeof(STARTUPINFOW);
si.hStdError = write;
si.hStdOutput = write;
si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
si.wShowWindow = SW_HIDE;
if(CreateProcessA(nullptr, LPSTR(commandCopy.c_str()), nullptr, nullptr, TRUE, CREATE_NEW_CONSOLE, nullptr, nullptr, &si, &pi))
if(CreateProcessW(nullptr, LPWSTR(commandCopy.c_str()), nullptr, nullptr, TRUE, CREATE_NEW_CONSOLE, nullptr, nullptr, &si, &pi))
{
bool ended{ false };
while(!ended)
Expand Down

0 comments on commit e595fee

Please sign in to comment.