@@ -112,7 +112,7 @@ MSWindowsWatchdog::duplicateProcessToken(HANDLE process, LPSECURITY_ATTRIBUTES s
112112
113113 if (!tokenRet) {
114114 LOG ((CLOG_ERR " could not open token, process handle: %d" , process));
115- throw XArch (error_code_to_string_windows (GetLastError ()));
115+ throw std::runtime_error (error_code_to_string_windows (GetLastError ()));
116116 }
117117
118118 LOG ((CLOG_DEBUG " got token %i, duplicating" , sourceToken));
@@ -124,7 +124,7 @@ MSWindowsWatchdog::duplicateProcessToken(HANDLE process, LPSECURITY_ATTRIBUTES s
124124
125125 if (!duplicateRet) {
126126 LOG ((CLOG_ERR " could not duplicate token %i" , sourceToken));
127- throw XArch (error_code_to_string_windows (GetLastError ()));
127+ throw std::runtime_error (error_code_to_string_windows (GetLastError ()));
128128 }
129129
130130 LOG ((CLOG_DEBUG " duplicated, new token: %i" , newToken));
@@ -171,7 +171,7 @@ void MSWindowsWatchdog::main_loop()
171171 saAttr.lpSecurityDescriptor = nullptr ;
172172
173173 if (!CreatePipe (&m_stdOutRead, &m_stdOutWrite, &saAttr, 0 )) {
174- throw XArch (error_code_to_string_windows (GetLastError ()));
174+ throw std::runtime_error (error_code_to_string_windows (GetLastError ()));
175175 }
176176
177177 ZeroMemory (&m_processInfo, sizeof (PROCESS_INFORMATION ));
@@ -304,7 +304,7 @@ MSWindowsWatchdog::startProcess()
304304 DWORD exitCode = 0 ;
305305 GetExitCodeProcess (m_processInfo.hProcess , &exitCode);
306306 LOG ((CLOG_ERR " exit code: %d" , exitCode));
307- throw XArch (error_code_to_string_windows (GetLastError ());
307+ throw std::runtime_error (error_code_to_string_windows (GetLastError () ));
308308 }
309309 else {
310310 // wait for program to fail.
@@ -360,7 +360,7 @@ BOOL MSWindowsWatchdog::doStartProcessAsUser(std::string& command, HANDLE userTo
360360 BOOL blockRet = CreateEnvironmentBlock (&environment, userToken, FALSE );
361361 if (!blockRet) {
362362 LOG ((CLOG_ERR " could not create environment block" ));
363- throw XArch (error_code_to_string_windows (GetLastError ());
363+ throw std::runtime_error (error_code_to_string_windows (GetLastError () ));
364364 }
365365
366366 DWORD creationFlags =
@@ -488,7 +488,7 @@ MSWindowsWatchdog::shutdownExistingProcesses()
488488 HANDLE snapshot = CreateToolhelp32Snapshot (TH32CS_SNAPPROCESS , 0 );
489489 if (snapshot == INVALID_HANDLE_VALUE ) {
490490 LOG ((CLOG_ERR " could not get process snapshot" ));
491- throw XArch (error_code_to_string_windows (GetLastError ());
491+ throw std::runtime_error (error_code_to_string_windows (GetLastError () ));
492492 }
493493
494494 PROCESSENTRY32 entry;
@@ -499,7 +499,7 @@ MSWindowsWatchdog::shutdownExistingProcesses()
499499 BOOL gotEntry = Process32First (snapshot, &entry);
500500 if (!gotEntry) {
501501 LOG ((CLOG_ERR " could not get first process entry" ));
502- throw XArch (error_code_to_string_windows (GetLastError ());
502+ throw std::runtime_error (error_code_to_string_windows (GetLastError () ));
503503 }
504504
505505 // now just iterate until we can find winlogon.exe pid
@@ -526,7 +526,7 @@ MSWindowsWatchdog::shutdownExistingProcesses()
526526
527527 // only worry about error if it's not the end of the snapshot
528528 LOG ((CLOG_ERR " could not get subsiquent process entry" ));
529- throw XArch (error_code_to_string_windows (GetLastError ());
529+ throw std::runtime_error (error_code_to_string_windows (GetLastError () ));
530530 }
531531 }
532532 }
0 commit comments