aboutsummaryrefslogtreecommitdiffstats
path: root/win/rfb_win32/LaunchProcess.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-09-10 16:55:32 +0200
committerPierre Ossman <ossman@cendio.se>2024-10-09 13:37:08 +0200
commit40df30d258ebfd24a447fababc649867c24513d8 (patch)
treee29c3abaac640eb1cfe951cae4ce4fe6896c8029 /win/rfb_win32/LaunchProcess.cxx
parent56b3460aa318b650f12833ba119fa6decb930148 (diff)
downloadtigervnc-40df30d258ebfd24a447fababc649867c24513d8.tar.gz
tigervnc-40df30d258ebfd24a447fababc649867c24513d8.zip
Split SystemException to handle Windows
Windows has (at least) two error namespaces, both errno and GetLastResult(). These overlap, so it is important we keep track of which one we are dealing with. To make things extra problematic, the BSD socket API normally uses errno, but on Windows it has been mapped in to the GetLastResult() namespace. Try to keep better control of this by using separate classes for the namespaces.
Diffstat (limited to 'win/rfb_win32/LaunchProcess.cxx')
-rw-r--r--win/rfb_win32/LaunchProcess.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/win/rfb_win32/LaunchProcess.cxx b/win/rfb_win32/LaunchProcess.cxx
index 92a68273..beb7e6b7 100644
--- a/win/rfb_win32/LaunchProcess.cxx
+++ b/win/rfb_win32/LaunchProcess.cxx
@@ -53,7 +53,7 @@ void LaunchProcess::start(HANDLE userToken, bool createConsole) {
char buf[256];
HDESK desktop = GetThreadDesktop(GetCurrentThreadId());
if (!GetUserObjectInformation(desktop, UOI_NAME, buf, 256, &size))
- throw rdr::SystemException("unable to launch process", GetLastError());
+ throw rdr::Win32Exception("unable to launch process", GetLastError());
snprintf(desktopName, 256, "WinSta0\\%s", buf);
@@ -95,7 +95,7 @@ void LaunchProcess::start(HANDLE userToken, bool createConsole) {
flags, nullptr, nullptr,
&sinfo, &procInfo);
if (!success)
- throw rdr::SystemException("unable to launch process", GetLastError());
+ throw rdr::Win32Exception("unable to launch process", GetLastError());
// Wait for it to finish initialising
WaitForInputIdle(procInfo.hProcess, 15000);
@@ -119,7 +119,7 @@ bool LaunchProcess::await(DWORD timeoutMs) {
detach();
return true;
} else if (result == WAIT_FAILED) {
- throw rdr::SystemException("await() failed", GetLastError());
+ throw rdr::Win32Exception("await() failed", GetLastError());
}
return false;
}