From 681347cf5239e0bd7cb47d6fce142909e503c38d Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sat, 14 Oct 2023 11:45:30 +0300 Subject: [PATCH] Windows: improve dependency lookup when loading module library. --- core/module.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/module.cpp b/core/module.cpp index 14ac5909..2cdebc9f 100644 --- a/core/module.cpp +++ b/core/module.cpp @@ -50,7 +50,7 @@ OIDN_NAMESPACE_BEGIN // Prevent the system from displaying a message box when the module fails to load UINT prevErrorMode = GetErrorMode(); SetErrorMode(prevErrorMode | SEM_FAILCRITICALERRORS); - void* module = LoadLibraryW(path.c_str()); + void* module = LoadLibraryExW(path.c_str(), nullptr, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR); SetErrorMode(prevErrorMode); #else void* module = dlopen(path.c_str(), RTLD_NOW | RTLD_LOCAL);