Пример #1
0
        public int ReadTables()
        {
            if( TableList == null )
                TableList = new List<BaseTable>();
            else if( TableList.Count > 0 )
                return TableList.Count;

            if( SMBIOS_Data.NumberOfSMBIOSStructures == 0 )
                return 0;

            BaseTable bsd;

            uint NextAddress = SMBIOS_Data.StructureTableAddress;

            for( int i = 0; i < SMBIOS_Data.NumberOfSMBIOSStructures; i++ )
            {
                bsd = new BaseTable( NextAddress, SMBIOS_Data.SMBIOSMinorVersion );
                if( bsd.ReadData() == false || bsd.TableType == 127)
                {
                    //Something went wrong or we finished
                    break;
                }

                NextAddress = bsd.EndAddress;
                TableList.Add( bsd ); 
            }



            return SMBIOS_Data.NumberOfSMBIOSStructures;

        }
Пример #2
0
        /// <summary>
        /// Creates the table.
        /// </summary>
        /// <param name="bt">The bt.</param>
        /// <returns></returns>
        public static BaseInfo CreateTable( BaseTable bt )
        {
            switch( (TableTypes)(int)bt.TableType )
            {

                //BIOS Information (Type 0) 
                case TableTypes.BIOSInformation:
                    return new BIOSTable( bt ); 
                    
                //Processor Information (Type 4) 
                case TableTypes.ProcessorInformation:
                    return new ProcessorInformation( bt ); 

                default:
                    return null;
            }
        }