/******************************************************************************/ /* SlunkCrypt, by LoRd_MuldeR */ /* This work has been released under the CC0 1.0 Universal license! */ /******************************************************************************/ using System; using com.muldersoft.slunkcrypt.gui.utils.cpu; namespace com.muldersoft.slunkcrypt.gui.process { struct CPUFeatures { public readonly bool x64; public readonly bool sse2; private static readonly Lazy cpuFeatures = new Lazy(DetectFeatures); public static CPUFeatures Features { get { return cpuFeatures.Value; } } public CPUFeatures(bool x64, bool sse2) { this.x64 = x64; this.sse2 = sse2; } private static CPUFeatures DetectFeatures() { try { return new CPUFeatures(CPU.Architecture.Equals(CPUArchitecture.CPU_ARCH_X64), CPU.Capabilities.HasFlag(CPUCapabilities.CPU_SSE2)); } catch { return new CPUFeatures(false, false); /*fallback*/ } } } }