MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / runShell

Method runShell

src/processrunner.cpp:731–754  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

729}
730
731std::optional<ProcessRunner::Results> ProcessRunner::runShell()
732{
733 const auto file = m_shellOpen.absoluteFilePath();
734
735 log::debug("executing from shell: '{}'", file);
736
737 auto r = shell::Open(file);
738 if (!r.success()) {
739 return Error;
740 }
741
742 m_handle.reset(r.stealProcessHandle());
743
744 // not all files will return a valid handle even if opening them was
745 // successful, such as inproc handlers (like the photo viewer); in this
746 // case it's impossible to determine the status, so just say it's still
747 // running
748 if (m_handle.get() == INVALID_HANDLE_VALUE) {
749 log::debug("shell didn't report an error, but no handle is available");
750 return Running;
751 }
752
753 return {};
754}
755
756std::optional<ProcessRunner::Results> ProcessRunner::runBinary()
757{

Callers

nothing calls this directly

Calls 3

stealProcessHandleMethod · 0.80
resetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected