mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-27 08:19:47 -05:00
Make sure Windows doesn't load DLLs from the current working directory.
This commit is contained in:
parent
77b4bfb14e
commit
17ab438c5a
@ -30,7 +30,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h> // for Sleep()
|
||||
#include <windows.h> // for Sleep(), SetDllDirectoryA() and SetSearchPathMode()
|
||||
#endif
|
||||
|
||||
#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
|
||||
|
@ -40,6 +40,7 @@ void sleep(int ms);
|
||||
void wait(int ms);
|
||||
QString platform();
|
||||
void disableCoreDumps();
|
||||
void setupSearchPaths();
|
||||
|
||||
} // namespace Tools
|
||||
|
||||
|
@ -32,6 +32,7 @@ int main(int argc, char** argv)
|
||||
#ifdef QT_NO_DEBUG
|
||||
Tools::disableCoreDumps();
|
||||
#endif
|
||||
Tools::setupSearchPaths();
|
||||
|
||||
Application app(argc, argv);
|
||||
Application::setApplicationName("keepassx");
|
||||
|
Loading…
Reference in New Issue
Block a user