66// sl.common.dll loads _nvngx.dll <- we are here
77// _nvngx.dll loads nvngx_dlssg.dll <- intercept this stage
88//
9- std::vector< const wchar_t *> TargetLibrariesToHook = { L" sl.interposer.dll" , L" sl.common.dll" , L" sl.dlss_g.dll" , L" _nvngx.dll" };
9+ std::vector TargetLibrariesToHook = { L" sl.interposer.dll" , L" sl.common.dll" , L" sl.dlss_g.dll" , L" _nvngx.dll" };
1010constinit const wchar_t *TargetImplementationDll = L" nvngx_dlssg.dll" ;
1111constinit const wchar_t *RelplacementImplementationDll = L" dlssg_to_fsr3_amd_is_better.dll" ;
1212
@@ -114,9 +114,8 @@ bool PatchImportsForModule(const wchar_t *Path, HMODULE ModuleHandle)
114114 if (!Path || !ModuleHandle)
115115 return false ;
116116
117- const bool isMatch = std::any_of (
118- TargetLibrariesToHook.begin (),
119- TargetLibrariesToHook.end (),
117+ const bool isMatch = std::ranges::any_of (
118+ TargetLibrariesToHook,
120119 [path = std::wstring_view (Path)](const wchar_t *Target)
121120 {
122121 return path.ends_with (Target);
@@ -159,7 +158,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
159158 // "Returnal\ Returnal\ Binaries\Win64\Returnal-Win64-Shipping.exe"
160159 // "Hogwarts Legacy\ Phoenix\ Binaries\Win64\HogwartsLegacy.exe"
161160 // "SW Jedi Survivor\ SwGame\ Binaries\Win64\JediSurvivor.exe"
162- // "Atomic Heart\ AtomicHeart\ Binaries\Win64\AtomicHeart-Win64-Shipping.exe
161+ // "Atomic Heart\ AtomicHeart\ Binaries\Win64\AtomicHeart-Win64-Shipping.exe"
163162 // "MMS\ MidnightSuns\ Binaries\Win64\MidnightSuns-Win64-Shipping.exe"
164163 //
165164 // "Dying Light 2\ ph\work\bin\x64\sl.interposer.dll"
@@ -177,10 +176,9 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
177176
178177 if (!LoadLibraryW (bruteInterposerPaths[0 ]))
179178 {
180- wchar_t path[2048 ];
181-
182179 for (auto interposer : bruteInterposerPaths)
183180 {
181+ wchar_t path[2048 ];
184182 if (!Util::GetModulePath (path, true , GetModuleHandleW (nullptr )))
185183 break ;
186184
@@ -193,9 +191,8 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
193191 }
194192
195193 // We probably loaded after sl.interposer.dll and sl.common.dll. Try patching them up front.
196- bool anyPatched = std::count_if (
197- TargetLibrariesToHook.begin (),
198- TargetLibrariesToHook.end (),
194+ bool anyPatched = std::ranges::count_if (
195+ TargetLibrariesToHook,
199196 [](const wchar_t *Target)
200197 {
201198 return PatchImportsForModule (Target, GetModuleHandleW (Target)) && _wcsicmp (Target, TargetEGSServicesDll) != 0 ;
0 commit comments