From 5f69a25d60cdd4f99d48ea54893972b227ddf583 Mon Sep 17 00:00:00 2001 From: Michael Robles <40410952+dashdogy@users.noreply.github.com> Date: Thu, 12 Nov 2026 02:08:48 +1100 Subject: [PATCH] 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. --- OptiScaler/misc/CustomProviders.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OptiScaler/misc/CustomProviders.h b/OptiScaler/misc/CustomProviders.h index aaaed6b9..a1521d8b 100644 --- a/OptiScaler/misc/CustomProviders.h +++ b/OptiScaler/misc/CustomProviders.h @@ -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 {}; }