[+] Win32Config::bProcessCheckWinLdrForModNameFirst

This commit is contained in:
Reece Wilson 2023-10-28 21:13:19 +01:00
parent 004eba6e09
commit 4f275184d3
2 changed files with 26 additions and 0 deletions

View File

@ -427,6 +427,11 @@ namespace Aurora
AuUInt32 uProtocolStackDefaultBufferSize { 64 * 1024 };
};
struct Win32Config
{
bool bProcessCheckWinLdrForModNameFirst { true };
};
struct RuntimeStartInfo
{
ConsoleConfig console;
@ -437,6 +442,7 @@ namespace Aurora
AuAlignTo<64, DebugConfig> debug;
AuAlignTo<32, ThreadingConfig> threadingConfig;
AuAlignTo<32, LinuxConfig> linuxConfig;
AuAlignTo<32, Win32Config> win32Config;
AuAlignTo<32, ProcessConfig> processConfig;
AuAlignTo<32, IOConfig> ioConfig;
AuAlignTo<32, DummyConfig> padding;

View File

@ -410,6 +410,26 @@ namespace Aurora::Process
AuString b = path + AuString({ AuFS::kPathSplitter }) + genericDll;
#if defined(AURORA_IS_MODERNNT_DERIVED)
#if defined(AURORA_PLATFORM_WIN32)
if (gRuntimeConfig.win32Config.bProcessCheckWinLdrForModNameFirst)
{
auto aW = AuLocale::ConvertFromUTF8(genericDll);
auto bW = AuLocale::ConvertFromUTF8(auDll);
auto pDLL = ::GetModuleHandleW(aW.c_str());
if (!pDLL)
{
pDLL = ::GetModuleHandleW(bW.c_str());
}
if (pDLL)
{
gModuleHandles.insert(AuMakePair(request.mod, (void *)pDLL));
return pDLL;
}
}
#endif
AuString aAbs = path + AuString({ AuFS::kPathSplitter }) + auDll + ".";
AuString bAbs = path + AuString({ AuFS::kPathSplitter }) + genericDll + ".";
#endif