// SPDX-License-Identifier: MIT #pragma once #include "IntervalList.h" #include #include namespace FEXCore::Core { struct InternalThreadState; } namespace FEXCore::Context { class Context; } namespace FEX::Windows { /** * @brief Handles SMC and regular code invalidation */ class InvalidationTracker { public: InvalidationTracker(FEXCore::Context::Context& CTX, const std::unordered_map& Threads); void HandleMemoryProtectionNotification(uint64_t Address, uint64_t Size, ULONG Prot); void InvalidateContainingSection(uint64_t Address, bool Free); void InvalidateAlignedInterval(uint64_t Address, uint64_t Size, bool Free); void ReprotectRWXIntervals(uint64_t Address, uint64_t Size); bool HandleRWXAccessViolation(uint64_t FaultAddress); private: IntervalList RWXIntervals; std::mutex RWXIntervalsLock; FEXCore::Context::Context& CTX; const std::unordered_map& Threads; }; } // namespace FEX::Windows