mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-10-15 15:00:58 -04:00
Make sure Windows doesn't load DLLs from the current working directory.
This commit is contained in:
parent
77b4bfb14e
commit
17ab438c5a
3 changed files with 12 additions and 1 deletions
|
@ -30,7 +30,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#include <windows.h> // for Sleep()
|
#include <windows.h> // for Sleep(), SetDllDirectoryA() and SetSearchPathMode()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
|
@ -259,4 +259,13 @@ void disableCoreDumps()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setupSearchPaths()
|
||||||
|
{
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
// Make sure Windows doesn't load DLLs from the current working directory
|
||||||
|
SetDllDirectoryA("");
|
||||||
|
SetSearchPathMode(BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Tools
|
} // namespace Tools
|
||||||
|
|
|
@ -40,6 +40,7 @@ void sleep(int ms);
|
||||||
void wait(int ms);
|
void wait(int ms);
|
||||||
QString platform();
|
QString platform();
|
||||||
void disableCoreDumps();
|
void disableCoreDumps();
|
||||||
|
void setupSearchPaths();
|
||||||
|
|
||||||
} // namespace Tools
|
} // namespace Tools
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ int main(int argc, char** argv)
|
||||||
#ifdef QT_NO_DEBUG
|
#ifdef QT_NO_DEBUG
|
||||||
Tools::disableCoreDumps();
|
Tools::disableCoreDumps();
|
||||||
#endif
|
#endif
|
||||||
|
Tools::setupSearchPaths();
|
||||||
|
|
||||||
Application app(argc, argv);
|
Application app(argc, argv);
|
||||||
Application::setApplicationName("keepassx");
|
Application::setApplicationName("keepassx");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue