Add option for loading custom amdxc64.dll

This commit is contained in:
FakeMichau
2026-06-19 03:29:14 +02:00
parent 718b65dd4a
commit b70ab35ae0
2 changed files with 23 additions and 4 deletions
+11 -1
View File
@@ -84,7 +84,17 @@ void Amdxc64Hooks::Init()
moduleAmdxc64 = KernelBaseProxy::GetModuleHandleW_()(L"amdxc64.dll");
if (moduleAmdxc64 == nullptr && !Config::Instance()->Fsr4DoNotLoadAmdxc64.value_or_default())
moduleAmdxc64 = NtdllProxy::LoadLibraryExW_Ldr(L"amdxc64.dll", NULL, 0);
{
HMODULE memModule = nullptr;
auto optiPath = Config::Instance()->MainDllPath.value();
Util::LoadProxyLibrary(L"amdxc64.dll", L"", optiPath, &memModule, &moduleAmdxc64);
if (moduleAmdxc64 == nullptr && memModule != nullptr)
moduleAmdxc64 = memModule;
if (moduleAmdxc64 == nullptr)
moduleAmdxc64 = NtdllProxy::LoadLibraryExW_Ldr(L"amdxc64.dll", NULL, 0);
}
if (moduleAmdxc64 != nullptr)
{
+12 -3
View File
@@ -472,12 +472,21 @@ HMODULE LibraryLoadHooks::LoadLibraryCheckW(std::wstring libName, LPCWSTR lpLibF
if (CheckDllNameW(&libName, &amdxc64NamesW))
{
auto module = NtdllProxy::LoadLibraryExW_Ldr(libName.c_str(), NULL, 0);
HMODULE moduleAmdxc64 = nullptr;
HMODULE memModule = nullptr;
auto optiPath = Config::Instance()->MainDllPath.value();
Util::LoadProxyLibrary(L"amdxc64.dll", L"", optiPath, &memModule, &moduleAmdxc64);
if (module != nullptr)
if (moduleAmdxc64 == nullptr && memModule != nullptr)
moduleAmdxc64 = memModule;
if (moduleAmdxc64 == nullptr)
moduleAmdxc64 = NtdllProxy::LoadLibraryExW_Ldr(libName.c_str(), NULL, 0);
if (moduleAmdxc64 != nullptr)
Amdxc64Hooks::Init();
return module;
return moduleAmdxc64;
}
if (CheckDllNameW(&libName, &ffxDx12NamesW))