File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) {
1717 BOOL res = FreeLibrary (handle);
1818 if (!res) {
1919 logger::error (
20- " Failed to unload the library with the handle at address {}" ,
20+ " Failed to unload the library with the handle at address 0x {}" ,
2121 handle);
2222 } else {
2323 logger::info (" unloaded adapter 0x{}" , handle);
@@ -27,10 +27,14 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) {
2727
2828std::unique_ptr<HMODULE, LibLoader::lib_dtor>
2929LibLoader::loadAdapterLibrary (const char *name) {
30- auto handle = std::unique_ptr<HMODULE, LibLoader::lib_dtor>(
31- LoadLibraryExA (name, nullptr , 0 ));
32- logger::info (" loaded adapter 0x{} ({})" , handle, name);
33- return handle;
30+ if (HMODULE handle = LoadLibraryExA (name, nullptr , 0 )) {
31+ logger::info (" loaded adapter 0x{}: {}" , handle, name);
32+ return std::unique_ptr<HMODULE, LibLoader::lib_dtor>{handle};
33+ } else {
34+ logger::debug (" loading adapter failed with error {}: {}" ,
35+ GetLastError (), name);
36+ }
37+ return nullptr ;
3438}
3539
3640void *LibLoader::getFunctionPtr (HMODULE handle, const char *func_name) {
You can’t perform that action at this time.
0 commit comments