■ IsProcessorFeaturePresent API 함수를 선언하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
using System.Runtime.InteropServices; #region 프로세서 특징 존재 여부 구하기 - IsProcessorFeaturePresent(processorFeature) /// <summary> /// 프로세서 특징 존재 여부 구하기 /// </summary> /// <param name="processorFeature">프로세서 특징</param> /// <returns>프로세서 특징 존재 여부</returns> [DllImport("kernel32")] [return: MarshalAs(UnmanagedType.Bool)] private static extern bool IsProcessorFeaturePresent(ProcessorFeature processorFeature); #endregion /// <summary> /// 프로세서 특징 /// </summary> public enum ProcessorFeature : uint { /// <summary> /// On a Pentium, a floating-point precision error can occur in rare circumstances /// </summary> FloatingPointPrecisionErrata = 0, /// <summary> /// Floating-point operations are emulated using a software emulator. /// This function returns a nonzero value if floating-point operations are emulated; otherwise, it returns zero. /// </summary> FloatingPointEmulated = 1, /// <summary> /// The atomic compare and exchange operation (cmpxchg) is available /// </summary> CompareExchangeDouble = 2, /// <summary> /// The MMX instruction set is available /// </summary> InstructionsMMXAvailable = 3, /// <summary> /// The SSE instruction set is available /// </summary> InstructionsXMMIAvailable = 6, /// <summary> /// The 3D-Now instruction set is available. /// </summary> Instruction3DNowAvailable = 7, /// <summary> /// The RDTSC instruction is available /// </summary> InstructionRDTSCAvailable = 8, /// <summary> /// The processor is PAE-enabled /// </summary> PAEEnabled = 9, /// <summary> /// The SSE2 instruction set is available /// </summary> InstructionsXMMI64Available = 10, /// <summary> /// Data execution prevention is enabled. /// (This feature is not supported until Windows XP SP2 and Windows Server 2003 SP1) /// </summary> NXEnabled = 12, /// <summary> /// The SSE3 instruction set is available. /// (This feature is not supported until Windows Vista) /// </summary> InstructionsSSE3Available = 13, /// <summary> /// The atomic compare and exchange 128-bit operation (cmpxchg16b) is available. /// (This feature is not supported until Windows Vista) /// </summary> CompareExchange128 = 14, /// <summary> /// The atomic compare 64 and exchange 128-bit operation (cmp8xchg16) is available. /// (This feature is not supported until Windows Vista.) /// </summary> Compare64Exchange128 = 15, /// <summary> /// TBD /// </summary> ChannelsEnabled = 16 } |