aboutsummaryrefslogtreecommitdiffstats
path: root/win/rfb_win32/DeviceFrameBuffer.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-09-02 22:58:35 +0200
committerPierre Ossman <ossman@cendio.se>2024-11-06 21:06:27 +0100
commit1d9b2f9984fefbc050c8e3295397ffd280e41788 (patch)
treec6fa8a4f5e0e6fbc0e165c2bd80b2c81a48bf6bc /win/rfb_win32/DeviceFrameBuffer.cxx
parent5c3588c464520a4757bfc20974090e21af220cdc (diff)
downloadtigervnc-1d9b2f9984fefbc050c8e3295397ffd280e41788.tar.gz
tigervnc-1d9b2f9984fefbc050c8e3295397ffd280e41788.zip
Use standard exception classes
Use the more specific already included exception classes for common errors to keep things more understandable.
Diffstat (limited to 'win/rfb_win32/DeviceFrameBuffer.cxx')
-rw-r--r--win/rfb_win32/DeviceFrameBuffer.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/win/rfb_win32/DeviceFrameBuffer.cxx b/win/rfb_win32/DeviceFrameBuffer.cxx
index 752aeb4c..4da4d814 100644
--- a/win/rfb_win32/DeviceFrameBuffer.cxx
+++ b/win/rfb_win32/DeviceFrameBuffer.cxx
@@ -54,14 +54,14 @@ DeviceFrameBuffer::DeviceFrameBuffer(HDC deviceContext, const Rect& wRect)
int capabilities = GetDeviceCaps(device, RASTERCAPS);
if (!(capabilities & RC_BITBLT)) {
- throw Exception("device does not support BitBlt");
+ throw std::invalid_argument("device does not support BitBlt");
}
if (!(capabilities & RC_DI_BITMAP)) {
- throw Exception("device does not support GetDIBits");
+ throw std::invalid_argument("device does not support GetDIBits");
}
/*
if (GetDeviceCaps(device, PLANES) != 1) {
- throw Exception("device does not support planar displays");
+ throw std::invalid_argument("device does not support planar displays");
}
*/
@@ -140,9 +140,9 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server)
if (!GetObject(iconInfo.hbmMask, sizeof(BITMAP), &maskInfo))
throw rdr::Win32Exception("GetObject() failed", GetLastError());
if (maskInfo.bmPlanes != 1)
- throw rdr::Exception("unsupported multi-plane cursor");
+ throw std::invalid_argument("unsupported multi-plane cursor");
if (maskInfo.bmBitsPixel != 1)
- throw rdr::Exception("unsupported cursor mask format");
+ throw std::invalid_argument("unsupported cursor mask format");
width = maskInfo.bmWidth;
height = maskInfo.bmHeight;
@@ -188,7 +188,7 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server)
if ((bi.bV5RedMask != ((unsigned)0xff << ridx*8)) ||
(bi.bV5GreenMask != ((unsigned)0xff << gidx*8)) ||
(bi.bV5BlueMask != ((unsigned)0xff << bidx*8)))
- throw rdr::Exception("unsupported cursor colour format");
+ throw std::invalid_argument("unsupported cursor colour format");
uint8_t* rwbuffer = buffer.data();
for (int y = 0; y < height; y++) {