示例#1
0
        internal unsafe OtherCpuInfo(CPU_INFORMATION cpuInfo)
        {
            _cpuInfo = cpuInfo;

            _processorFeatures    = new UInt64[2];
            _processorFeatures[0] = cpuInfo.ProcessorFeatures[0];
            _processorFeatures[1] = cpuInfo.ProcessorFeatures[1];
        }
示例#2
0
        internal unsafe X86CpuInfo(CPU_INFORMATION cpuInfo)
        {
            _cpuInfo = cpuInfo;

            _vendorIdRaw    = new uint[3];
            _vendorIdRaw[0] = cpuInfo.VendorId[0];
            _vendorIdRaw[1] = cpuInfo.VendorId[1];
            _vendorIdRaw[2] = cpuInfo.VendorId[2];

            char[] vendorId = new char[12];

            GCHandle handle = GCHandle.Alloc(vendorId, GCHandleType.Pinned);

            try
            {
                ASCIIEncoding.ASCII.GetChars(cpuInfo.VendorId, 12, (char *)handle.AddrOfPinnedObject(), 12);

                _vendorId = new String(vendorId);
            }
            finally
            {
                handle.Free();
            }
        }