Made DLL loading also search the DLL's path for dependency resolution (#63)

This commit is contained in:
Wiseguy 2024-09-27 00:50:07 -04:00 committed by GitHub
parent b80bb216b2
commit 46797d6cad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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;