From 4030193f31d884e45352f49ce7a5caa3be9b834e Mon Sep 17 00:00:00 2001 From: kd-11 <15904127+kd-11@users.noreply.github.com> Date: Sun, 4 Aug 2024 16:46:08 +0300 Subject: [PATCH] Case-insensitive path compare for module verifier (#15889) --- rpcs3/module_verifier.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rpcs3/module_verifier.cpp b/rpcs3/module_verifier.cpp index fd867e080b..39817a09fe 100644 --- a/rpcs3/module_verifier.cpp +++ b/rpcs3/module_verifier.cpp @@ -8,6 +8,7 @@ #endif #include +#include #include #include @@ -41,8 +42,6 @@ void WIN32_module_verifier::run_module_verification() report_fatal_error(fmt::format("WIN32_module_verifier: Failed to query WindowsDirectory"), false, true); } - const std::wstring_view windir_wsv = windir; - for (const auto& module : special_module_infos) { const HMODULE hModule = GetModuleHandle(module.name.data()); @@ -54,8 +53,7 @@ void WIN32_module_verifier::run_module_verification() WCHAR wpath[MAX_PATH]; if (const auto len = GetModuleFileName(hModule, wpath, MAX_PATH)) { - const std::wstring_view path_wsv = wpath; - if (path_wsv.find(windir_wsv) != 0) + if (::StrStrI(wpath, windir) != wpath) { const std::string path = wchar_to_utf8(wpath); const std::string win_path = wchar_to_utf8(windir);