chore: arch: Remove XArch exception class

XArch no longer contains any extra functionality in addition to what
std::runtime_error nor it signifies a particular type of error.
based-on: 5b991692af
ported-by: sithlord48
This commit is contained in:
Povilas Kanapickas
2025-05-25 02:13:57 -04:00
committed by Nick Bolton
parent cab1eb9cee
commit 5ee3fc41bd
8 changed files with 41 additions and 51 deletions

View File

@ -23,7 +23,7 @@ bool MSWindowsSession::isProcessInSession(const char *name, PHANDLE process = nu
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (snapshot == INVALID_HANDLE_VALUE) {
LOG((CLOG_ERR "could not get process snapshot"));
throw XArch(windowsErrorToString(GetLastError()));
throw std::runtime_error(windowsErrorToString(GetLastError()));
}
PROCESSENTRY32 entry;
@ -34,7 +34,7 @@ bool MSWindowsSession::isProcessInSession(const char *name, PHANDLE process = nu
BOOL gotEntry = Process32First(snapshot, &entry);
if (!gotEntry) {
LOG((CLOG_ERR "could not get first process entry"));
throw XArch(windowsErrorToString(GetLastError()));
throw std::runtime_error(windowsErrorToString(GetLastError()));
}
// used to record process names for debug info
@ -106,7 +106,7 @@ MSWindowsSession::getUserToken(LPSECURITY_ATTRIBUTES security)
HANDLE sourceToken;
if (!WTSQueryUserToken(m_activeSessionId, &sourceToken)) {
LOG((CLOG_ERR "could not get token from session %d", m_activeSessionId));
throw XArch(windowsErrorToString(GetLastError()));
throw std::runtime_error(windowsErrorToString(GetLastError()));
}
HANDLE newToken;
@ -115,7 +115,7 @@ MSWindowsSession::getUserToken(LPSECURITY_ATTRIBUTES security)
)) {
LOG((CLOG_ERR "could not duplicate token"));
throw XArch(windowsErrorToString(GetLastError()));
throw std::runtime_error(windowsErrorToString(GetLastError()));
}
LOG((CLOG_DEBUG "duplicated, new token: %i", newToken));
@ -149,7 +149,7 @@ BOOL MSWindowsSession::nextProcessEntry(HANDLE snapshot, LPPROCESSENTRY32 entry)
// files' error then it's probably something serious.
if (err != ERROR_NO_MORE_FILES) {
LOG((CLOG_ERR "could not get next process entry"));
throw XArch(windowsErrorToString(GetLastError()));
throw std::runtime_error(windowsErrorToString(GetLastError()));
}
}