Made DLL loading also search the DLL's path for dependency resolution

This commit is contained in:
Mr-Wiseguy 2024-09-27 00:27:46 -04:00
parent 356b9f901e
commit 6df53c78d0

View file

@ -43,7 +43,7 @@ public:
static constexpr std::string_view PlatformExtension = ".dll";
DynamicLibrary() = default;
DynamicLibrary(const std::filesystem::path& path) {
native_handle = LoadLibraryW(path.c_str());
native_handle = LoadLibraryExW(std::filesystem::absolute(path).c_str(), nullptr, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
if (good()) {
uint32_t* recomp_api_version;