[AntiCheat] Disable protection during unit tests

This commit is contained in:
momo5502 2017-07-12 11:33:30 +02:00
parent 8c4ca6e4da
commit d7c26d6dea
2 changed files with 3 additions and 3 deletions

View File

@ -181,7 +181,7 @@ namespace Components
return result;
}
bool Loader::IsPerformingUnitTests()
bool inline Loader::IsPerformingUnitTests()
{
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
return Flags::HasFlag("tests");

View File

@ -60,7 +60,7 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*l
#ifndef DISABLE_ANTICHEAT
[]()
{
if (!Components::Dedicated::IsEnabled())
if (!Components::Dedicated::IsEnabled() && !Components::Loader::IsPerformingUnitTests())
{
Components::AntiCheat::ProtectProcess();
Components::AntiCheat::PatchThreadCreation();
@ -84,7 +84,7 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*l
#ifndef DISABLE_ANTICHEAT
[]()
{
if (!Components::Dedicated::IsEnabled())
if (!Components::Dedicated::IsEnabled() && !Components::Loader::IsPerformingUnitTests())
{
Components::AntiCheat::VerifyThreadIntegrity();
}