mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-06 07:05:04 -06:00
Case-insensitive path compare for module verifier (#15889)
This commit is contained in:
parent
a1dcf1f717
commit
4030193f31
@ -8,6 +8,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
#include <Shlwapi.h>
|
||||||
|
|
||||||
#include <util/types.hpp>
|
#include <util/types.hpp>
|
||||||
#include <util/logs.hpp>
|
#include <util/logs.hpp>
|
||||||
@ -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);
|
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)
|
for (const auto& module : special_module_infos)
|
||||||
{
|
{
|
||||||
const HMODULE hModule = GetModuleHandle(module.name.data());
|
const HMODULE hModule = GetModuleHandle(module.name.data());
|
||||||
@ -54,8 +53,7 @@ void WIN32_module_verifier::run_module_verification()
|
|||||||
WCHAR wpath[MAX_PATH];
|
WCHAR wpath[MAX_PATH];
|
||||||
if (const auto len = GetModuleFileName(hModule, wpath, MAX_PATH))
|
if (const auto len = GetModuleFileName(hModule, wpath, MAX_PATH))
|
||||||
{
|
{
|
||||||
const std::wstring_view path_wsv = wpath;
|
if (::StrStrI(wpath, windir) != wpath)
|
||||||
if (path_wsv.find(windir_wsv) != 0)
|
|
||||||
{
|
{
|
||||||
const std::string path = wchar_to_utf8(wpath);
|
const std::string path = wchar_to_utf8(wpath);
|
||||||
const std::string win_path = wchar_to_utf8(windir);
|
const std::string win_path = wchar_to_utf8(windir);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user