From d3296528e4d6e39920458cfc581a59b7ee021fe3 Mon Sep 17 00:00:00 2001 From: Maurice Heumann Date: Mon, 13 Feb 2023 11:48:03 +0100 Subject: [PATCH] Test AMD CPU fix Maybe a fix for #147 --- src/client/component/arxan.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/client/component/arxan.cpp b/src/client/component/arxan.cpp index dc43c6e3..8bb06232 100644 --- a/src/client/component/arxan.cpp +++ b/src/client/component/arxan.cpp @@ -755,6 +755,17 @@ namespace arxan { search_and_patch_integrity_checks(); //restore_debug_functions(); + + scheduler::once([] + { + SetProcessAffinityMask(GetCurrentProcess(), 2 << (std::min(std::thread::hardware_concurrency(), 4U))); + + scheduler::once([] { + DWORD_PTR affinity_proc, affinity_sys; + GetProcessAffinityMask(GetCurrentProcess(), &affinity_proc, &affinity_sys); + SetProcessAffinityMask(GetCurrentProcess(), affinity_sys); + }, scheduler::pipeline::main, 1s); + }, scheduler::pipeline::main); } component_priority priority() const override