You are limiting players with their windows ver while using old directx on higher windows ver and your limiting approach is very high cpu usage. Consider doing this:
Microsoft::WRL::ComPtr<ID3D11Device> g_pd3dDevice;
Microsoft::WRL::ComPtr<IDXGISwapChain> g_pSwapChain;
UINT64 g_frameCount = 0...