diff options
Diffstat (limited to 'vncviewer/parameters.cxx')
-rw-r--r-- | vncviewer/parameters.cxx | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/vncviewer/parameters.cxx b/vncviewer/parameters.cxx index b66c7da2..a6229a34 100644 --- a/vncviewer/parameters.cxx +++ b/vncviewer/parameters.cxx @@ -320,7 +320,7 @@ static void setKeyString(const char *_name, const char *_value, HKEY* hKey) { LONG res = RegSetValueExW(*hKey, name, 0, REG_SZ, (BYTE*)&value, (wcslen(value)+1)*2); if (res != ERROR_SUCCESS) - throw rdr::Win32Exception("RegSetValueExW", res); + throw rdr::win32_error("RegSetValueExW", res); } @@ -336,7 +336,7 @@ static void setKeyInt(const char *_name, const int _value, HKEY* hKey) { LONG res = RegSetValueExW(*hKey, name, 0, REG_DWORD, (BYTE*)&value, sizeof(DWORD)); if (res != ERROR_SUCCESS) - throw rdr::Win32Exception("RegSetValueExW", res); + throw rdr::win32_error("RegSetValueExW", res); } @@ -357,7 +357,7 @@ static bool getKeyString(const char* _name, char* dest, size_t destSize, HKEY* h if (res != ERROR_SUCCESS){ delete [] value; if (res != ERROR_FILE_NOT_FOUND) - throw rdr::Win32Exception("RegQueryValueExW", res); + throw rdr::win32_error("RegQueryValueExW", res); // The value does not exist, defaults will be used. return false; } @@ -394,7 +394,7 @@ static bool getKeyInt(const char* _name, int* dest, HKEY* hKey) { LONG res = RegQueryValueExW(*hKey, name, nullptr, nullptr, (LPBYTE)&value, &dwordsize); if (res != ERROR_SUCCESS){ if (res != ERROR_FILE_NOT_FOUND) - throw rdr::Win32Exception("RegQueryValueExW", res); + throw rdr::win32_error("RegQueryValueExW", res); // The value does not exist, defaults will be used. return false; } @@ -414,7 +414,7 @@ static void removeValue(const char* _name, HKEY* hKey) { LONG res = RegDeleteValueW(*hKey, name); if (res != ERROR_SUCCESS) { if (res != ERROR_FILE_NOT_FOUND) - throw rdr::Win32Exception("RegDeleteValueW", res); + throw rdr::win32_error("RegDeleteValueW", res); // The value does not exist, no need to remove it. return; } @@ -428,7 +428,7 @@ void saveHistoryToRegKey(const list<string>& serverHistory) { &hKey, nullptr); if (res != ERROR_SUCCESS) - throw rdr::Win32Exception(_("Failed to create registry key"), res); + throw rdr::win32_error(_("Failed to create registry key"), res); unsigned index = 0; assert(SERVER_HISTORY_SIZE < 100); @@ -449,7 +449,7 @@ void saveHistoryToRegKey(const list<string>& serverHistory) { res = RegCloseKey(hKey); if (res != ERROR_SUCCESS) - throw rdr::Win32Exception(_("Failed to close registry key"), res); + throw rdr::win32_error(_("Failed to close registry key"), res); } static void saveToReg(const char* servername) { @@ -461,7 +461,7 @@ static void saveToReg(const char* servername) { REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &hKey, nullptr); if (res != ERROR_SUCCESS) - throw rdr::Win32Exception(_("Failed to create registry key"), res); + throw rdr::win32_error(_("Failed to create registry key"), res); try { setKeyString("ServerName", servername, &hKey); @@ -506,7 +506,7 @@ static void saveToReg(const char* servername) { res = RegCloseKey(hKey); if (res != ERROR_SUCCESS) - throw rdr::Win32Exception(_("Failed to close registry key"), res); + throw rdr::win32_error(_("Failed to close registry key"), res); } list<string> loadHistoryFromRegKey() { @@ -522,7 +522,7 @@ list<string> loadHistoryFromRegKey() { return serverHistory; } - throw rdr::Win32Exception(_("Failed to open registry key"), res); + throw rdr::win32_error(_("Failed to open registry key"), res); } unsigned index; @@ -549,7 +549,7 @@ list<string> loadHistoryFromRegKey() { res = RegCloseKey(hKey); if (res != ERROR_SUCCESS) - throw rdr::Win32Exception(_("Failed to close registry key"), res); + throw rdr::win32_error(_("Failed to close registry key"), res); return serverHistory; } @@ -596,7 +596,7 @@ static char* loadFromReg() { return nullptr; } - throw rdr::Win32Exception(_("Failed to open registry key"), res); + throw rdr::win32_error(_("Failed to open registry key"), res); } const size_t buffersize = 256; @@ -618,7 +618,7 @@ static char* loadFromReg() { res = RegCloseKey(hKey); if (res != ERROR_SUCCESS) - throw rdr::Win32Exception(_("Failed to close registry key"), res); + throw rdr::win32_error(_("Failed to close registry key"), res); return servername; } @@ -652,7 +652,7 @@ void saveViewerParameters(const char *filename, const char *servername) { FILE* f = fopen(filepath, "w+"); if (!f) { std::string msg = format(_("Could not open \"%s\""), filepath); - throw rdr::PosixException(msg.c_str(), errno); + throw rdr::posix_error(msg.c_str(), errno); } fprintf(f, "%s\n", IDENTIFIER_STRING); @@ -760,7 +760,7 @@ char* loadViewerParameters(const char *filename) { if (!filename) return nullptr; // Use defaults. std::string msg = format(_("Could not open \"%s\""), filepath); - throw rdr::PosixException(msg.c_str(), errno); + throw rdr::posix_error(msg.c_str(), errno); } int lineNr = 0; @@ -775,7 +775,7 @@ char* loadViewerParameters(const char *filename) { fclose(f); std::string msg = format(_("Failed to read line %d in " "file \"%s\""), lineNr, filepath); - throw rdr::PosixException(msg.c_str(), errno); + throw rdr::posix_error(msg.c_str(), errno); } if (strlen(line) == (sizeof(line) - 1)) { |