30 enum class ProcessState
67 void mainLoop(
void *);
72 void outputLoop(
void *);
83 HANDLE duplicateProcessToken(HANDLE process, LPSECURITY_ATTRIBUTES security);
92 HANDLE getUserToken(LPSECURITY_ATTRIBUTES security,
bool elevatedToken);
102 ProcessState handleStartError(
const std::string_view &message =
"");
107 void initOutputReadPipe();
119 void sasLoop(
void *);
124 static std::string processStateToString(ProcessState state);
129 static void shutdownExistingProcesses();
132 bool m_running =
true;
133 std::unique_ptr<Thread> m_mainThread;
134 std::unique_ptr<Thread> m_outputThread;
135 std::unique_ptr<Thread> m_sasThread;
136 HANDLE m_outputWritePipe =
nullptr;
137 HANDLE m_outputReadPipe =
nullptr;
138 bool m_elevateProcess =
false;
140 int m_startFailures = 0;
142 bool m_foreground =
false;
143 std::string m_activeDesktop =
"";
144 std::unique_ptr<deskflow::platform::MSWindowsProcess> m_process;
145 std::optional<double> m_nextStartTime = std::nullopt;
146 ProcessState m_processState = ProcessState::Idle;
147 std::string m_command =
"";
148 SendSas m_sendSasFunc =
nullptr;
149 std::mutex m_processStateMutex;
void setProcessConfig(const std::string_view &command, bool elevate)
Set the command to run and whether to elevate the process.
Definition MSWindowsWatchdog.cpp:327