summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-04-03 15:47:38 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-04-04 06:12:22 +0000
commitdfc34ee575ca7790ec403c6510a9ccc469c07997 (patch)
tree7e744b267bc93448da2b4c6b633389ecfb3f96df
parentd79b396442753f71b8e498a991c7dd85538c7505 (diff)
idc: Suppress error dialogs should LoadLibrary[Ex]() failv5.9.0-beta3v5.9.0-beta2
Task-number: QTBUG-59791 Change-Id: I1b7f6f9ca12f8e42166104512a85ddb55d0b8e28 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--src/tools/idc/main.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tools/idc/main.cpp b/src/tools/idc/main.cpp
index cceae07..19bd874 100644
--- a/src/tools/idc/main.cpp
+++ b/src/tools/idc/main.cpp
@@ -178,11 +178,13 @@ static HMODULE loadLibraryQt(const QString &input)
{
const wchar_t *inputC = reinterpret_cast<const wchar_t *>(input.utf16());
// Load DLL with the folder containing the DLL temporarily added to the search path when loading dependencies
+ const UINT oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
HMODULE result =
LoadLibraryEx(inputC, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
// If that fails, call with flags=0 to get LoadLibrary() behavior (search %PATH%).
if (!result)
result = LoadLibraryEx(inputC, NULL, 0);
+ SetErrorMode(oldErrorMode);
return result;
}