summaryrefslogtreecommitdiff
path: root/src/spawn.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-12-17 07:47:29 -0500
committerGitHub <noreply@github.com>2019-12-17 07:47:29 -0500
commita4a0e59d8ce7d3f9fbe0806a5621c27932f26314 (patch)
tree37e4a9046a8204cc3b70ae8937aae6dab1d9f167 /src/spawn.cpp
parent2c7e0e7cb4d8bf5c51f22968a5ffd2366d6bcdf2 (diff)
parent05231eab45f86e3d0d342c429e35c8f7c813ea42 (diff)
Merge pull request #942 from isanae/lock-fixes
Lock fixes
Diffstat (limited to 'src/spawn.cpp')
-rw-r--r--src/spawn.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/spawn.cpp b/src/spawn.cpp
index f95846c8..33bdbc05 100644
--- a/src/spawn.cpp
+++ b/src/spawn.cpp
@@ -498,14 +498,16 @@ DWORD spawn(const SpawnParameters& sp, HANDLE& processHandle)
const auto wcommandLine = commandLine.toStdWString();
const auto wcwd = cwd.toStdWString();
+ const DWORD flags = CREATE_BREAKAWAY_FROM_JOB;
+
if (sp.hooked) {
success = ::CreateProcessHooked(
nullptr, const_cast<wchar_t*>(wcommandLine.c_str()), nullptr, nullptr,
- inheritHandles, 0, nullptr, wcwd.c_str(), &si, &pi);
+ inheritHandles, flags, nullptr, wcwd.c_str(), &si, &pi);
} else {
success = ::CreateProcess(
nullptr, const_cast<wchar_t*>(wcommandLine.c_str()), nullptr, nullptr,
- inheritHandles, 0, nullptr, wcwd.c_str(), &si, &pi);
+ inheritHandles, flags, nullptr, wcwd.c_str(), &si, &pi);
}
const auto e = GetLastError();