diff options
author | Pierre Ossman <ossman@cendio.se> | 2024-09-10 16:55:32 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2024-10-09 13:37:08 +0200 |
commit | 40df30d258ebfd24a447fababc649867c24513d8 (patch) | |
tree | e29c3abaac640eb1cfe951cae4ce4fe6896c8029 /win/rfb_win32/DeviceFrameBuffer.cxx | |
parent | 56b3460aa318b650f12833ba119fa6decb930148 (diff) | |
download | tigervnc-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/DeviceFrameBuffer.cxx')
-rw-r--r-- | win/rfb_win32/DeviceFrameBuffer.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/win/rfb_win32/DeviceFrameBuffer.cxx b/win/rfb_win32/DeviceFrameBuffer.cxx index bba1dbdb..ca2f57d4 100644 --- a/win/rfb_win32/DeviceFrameBuffer.cxx +++ b/win/rfb_win32/DeviceFrameBuffer.cxx @@ -102,7 +102,7 @@ DeviceFrameBuffer::grabRect(const Rect &rect) { if (ignoreGrabErrors) vlog.error("BitBlt failed:%ld", GetLastError()); else - throw rdr::SystemException("BitBlt failed", GetLastError()); + throw rdr::Win32Exception("BitBlt failed", GetLastError()); } } @@ -138,7 +138,7 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server) BITMAP maskInfo; if (!GetObject(iconInfo.hbmMask, sizeof(BITMAP), &maskInfo)) - throw rdr::SystemException("GetObject() failed", GetLastError()); + throw rdr::Win32Exception("GetObject() failed", GetLastError()); if (maskInfo.bmPlanes != 1) throw rdr::Exception("unsupported multi-plane cursor"); if (maskInfo.bmBitsPixel != 1) @@ -174,7 +174,7 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server) if (!GetDIBits(dc, iconInfo.hbmColor, 0, height, buffer.data(), (LPBITMAPINFO)&bi, DIB_RGB_COLORS)) - throw rdr::SystemException("GetDIBits", GetLastError()); + throw rdr::Win32Exception("GetDIBits", GetLastError()); // We may not get the RGBA order we want, so shuffle things around int ridx, gidx, bidx, aidx; @@ -217,7 +217,7 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server) if (!GetBitmapBits(iconInfo.hbmMask, maskInfo.bmWidthBytes * maskInfo.bmHeight, mask.data())) - throw rdr::SystemException("GetBitmapBits", GetLastError()); + throw rdr::Win32Exception("GetBitmapBits", GetLastError()); bool doOutline = false; uint8_t* rwbuffer = buffer.data(); |