From a56f3816a1126c61571e74ec33d962a70a9afdfe Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Tue, 28 Sep 2021 23:24:26 +0200 Subject: [PATCH] util/library: Force specific search directories --- source/util/util-library.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/util/util-library.cpp b/source/util/util-library.cpp index 6c32302c..c7311512 100644 --- a/source/util/util-library.cpp +++ b/source/util/util-library.cpp @@ -39,7 +39,8 @@ streamfx::util::library::library(std::filesystem::path file) : _library(nullptr) #if defined(ST_WINDOWS) SetLastError(ERROR_SUCCESS); file = ::streamfx::util::platform::utf8_to_native(file); - _library = reinterpret_cast(LoadLibraryW(file.wstring().c_str())); + _library = reinterpret_cast(LoadLibraryExW( + file.wstring().c_str(), nullptr, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS)); if (!_library) { DWORD error = GetLastError(); if (error != ERROR_PROC_NOT_FOUND) {