mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-11-22 13:47:11 +00:00
Log the path and error when a custom dll fails to load
The log named only the folder. It now names the dll and the load error, or says the folder has no dll.
This commit is contained in:
1 parent
2683a00dfa
commit
5f69a25d60
1 file changed
+11
-1
@@ -184,7 +184,17 @@ inline Exports Load(const std::string& name, Kind kind)
|
||||
|
||||
if (dll == nullptr)
|
||||
{
|
||||
LOG_ERROR("Can't load custom {} from {}", name, wstring_to_string(Folder(name).wstring()));
|
||||
if (path.empty())
|
||||
{
|
||||
LOG_ERROR("Can't load custom {}: no dll in {}", name, wstring_to_string(Folder(name).wstring()));
|
||||
return {};
|
||||
}
|
||||
|
||||
// ERROR_DLL_INIT_FAILED: the dll refused to load, e.g. a provider that needs another module loaded first
|
||||
const DWORD error = GetLastError();
|
||||
LOG_ERROR("Can't load custom {} from {}, error {}{}", name, wstring_to_string(path.wstring()), error,
|
||||
error == ERROR_DLL_INIT_FAILED ? " (the dll refused to load; it needs something this process lacks)"
|
||||
: "");
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user