From 0e854af70f6f330e63aa36fde125fbb0ca4ff8ef Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 18 Dec 2018 15:40:58 +0300 Subject: C++ exceptions are disabled in all cases where they just prevent warnings --- plugins/Clist_nicer/clist_nicer.vcxproj | 5 ----- plugins/Clist_nicer/src/config.cpp | 35 +++++++++++++++++---------------- plugins/Clist_nicer/src/stdafx.h | 1 + 3 files changed, 19 insertions(+), 22 deletions(-) (limited to 'plugins/Clist_nicer') diff --git a/plugins/Clist_nicer/clist_nicer.vcxproj b/plugins/Clist_nicer/clist_nicer.vcxproj index 530b4c9922..5ce4a6fb8b 100644 --- a/plugins/Clist_nicer/clist_nicer.vcxproj +++ b/plugins/Clist_nicer/clist_nicer.vcxproj @@ -25,9 +25,4 @@ - - - Sync - - \ No newline at end of file diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 5a78cdb154..39d230a500 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -233,26 +233,27 @@ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename, bool useGetHandle) wchar_t sysPathName[MAX_PATH + 2]; HMODULE _h = nullptr; - try { - if (0 == ::GetSystemDirectory(sysPathName, MAX_PATH)) - throw(CRTException("Error while loading system library", szFilename)); - - sysPathName[MAX_PATH - 1] = 0; - if (mir_wstrlen(sysPathName) + mir_wstrlen(szFilename) >= MAX_PATH) - throw(CRTException("Error while loading system library", szFilename)); - - mir_wstrcat(sysPathName, szFilename); - if (useGetHandle) - _h = ::GetModuleHandle(sysPathName); - else - _h = LoadLibrary(sysPathName); - if (nullptr == _h) - throw(CRTException("Error while loading system library", szFilename)); + if (0 == ::GetSystemDirectory(sysPathName, MAX_PATH)) { + CRTException("Error while loading system library", szFilename).display(); + return nullptr; } - catch (CRTException& ex) { - ex.display(); + + sysPathName[MAX_PATH - 1] = 0; + if (mir_wstrlen(sysPathName) + mir_wstrlen(szFilename) >= MAX_PATH) { + CRTException("Error while loading system library", szFilename).display(); + return nullptr; + } + + mir_wstrcat(sysPathName, szFilename); + if (useGetHandle) + _h = ::GetModuleHandle(sysPathName); + else + _h = LoadLibrary(sysPathName); + if (nullptr == _h) { + CRTException("Error while loading system library", szFilename).display(); return nullptr; } + return (_h); } diff --git a/plugins/Clist_nicer/src/stdafx.h b/plugins/Clist_nicer/src/stdafx.h index bab2bf55c3..5053044be6 100644 --- a/plugins/Clist_nicer/src/stdafx.h +++ b/plugins/Clist_nicer/src/stdafx.h @@ -34,6 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include +#include #include #include #include -- cgit v1.2.3