Referenced by: TMiTeC_SMBIOS


This code fragment demonstrates how to read Processor version string (10h) and Core count (23h) from SMBIOS table Processor Information (Type 4).


Code

var

  SMBIOS: TSMBIOS;

  idx: integer;

  v: Byte;

  s: string;

  r: TSMBIOSTable

begin

  SMBIOS:=TSMBIOS.Create;

  try

    SMBIOS.LoadFromSystem;

    idx:=SMBIOS.FindTableIndex(SMB_CPU);

    if idx>-1 then

      repeat

        r:=SMBIOS.Tables[idx];

        if SMBIOS.ByteValue[r.Offset+$10]>0 then

          s:=SMBIOS.StringValue[r.Offset+r.Header.Length,SMBIOS.ByteValue[r.Offset+$10]];

          v:=SMBIOS.Wordvalue[r.Offset+$23];

          writeln(Format('%s (%d cores)',[s,v]));

        end;

        idx:=SMBIOS.FindTableIndex(SMB_CPU,r.Index+1);

      until idx=-1;

  finally

    SMBIOS.Free;

  end;

end;

Output

Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz (2 cores)



Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's WinHelp HLP to CHM conversion feature