Dll loading feature now only tries loading .dll files.

merge-requests/38/merge
Mr_Goldberg 2021-02-06 22:37:59 -05:00
parent 5873398790
commit 6dfe11503b
No known key found for this signature in database
GPG Key ID: 8597D87419DEF278
1 changed files with 7 additions and 0 deletions

View File

@ -649,6 +649,13 @@ static void load_dlls()
std::vector<std::string> paths = Local_Storage::get_filenames_path(path); std::vector<std::string> paths = Local_Storage::get_filenames_path(path);
for (auto & p: paths) { for (auto & p: paths) {
std::string full_path = path + p; std::string full_path = path + p;
size_t length = full_path.length();
if (length < 4) continue;
if (std::toupper(full_path[length - 1]) != 'L') continue;
if (std::toupper(full_path[length - 2]) != 'L') continue;
if (std::toupper(full_path[length - 3]) != 'D') continue;
if (full_path[length - 4] != '.') continue;
PRINT_DEBUG("Trying to load %s\n", full_path.c_str()); PRINT_DEBUG("Trying to load %s\n", full_path.c_str());
if (LoadLibraryA(full_path.c_str())) { if (LoadLibraryA(full_path.c_str())) {
PRINT_DEBUG("LOADED %s\n", full_path.c_str()); PRINT_DEBUG("LOADED %s\n", full_path.c_str());