| 729 | } |
| 730 | |
| 731 | std::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 | |
| 756 | std::optional<ProcessRunner::Results> ProcessRunner::runBinary() |
| 757 | { |
nothing calls this directly
no test coverage detected