?
Solved

CPU type code

Posted on 2005-03-11
16
Medium Priority
?
815 Views
Last Modified: 2012-06-27
Hi.
I need a code sample that will show if the current Cpu supports 64bit or 32.
Thanks in advance.
0
Comment
Question by:CodedK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 2
  • +1
16 Comments
 
LVL 16

Author Comment

by:CodedK
ID: 13536421
Thanks for ur reply ...
Can u give me a working example of this code mentioned in the link above?
Im not very familiar with this.
0
 
LVL 3

Assisted Solution

by:BJThomsen
BJThomsen earned 600 total points
ID: 13557653
procedure TForm1.Button1Click(Sender: TObject);
var
  MyInfo: TSystemInfo;
const
PROCESSOR_ARCHITECTURE_INTEL   = 0;
PROCESSOR_ARCHITECTURE_IA64    = 6;
PROCESSOR_ARCHITECTURE_AMD64   = 9;
PROCESSOR_ARCHITECTURE_UNKNOWN = $FFFF;
begin
  GetSystemInfo(MyInfo);
  case MyInfo.wProcessorArchitecture of
    PROCESSOR_ARCHITECTURE_INTEL: ShowMessage('PROCESSOR_ARCHITECTURE_INTEL');
    PROCESSOR_ARCHITECTURE_IA64: ShowMessage('PROCESSOR_ARCHITECTURE_IA64');
    PROCESSOR_ARCHITECTURE_AMD64: ShowMessage('PROCESSOR_ARCHITECTURE_AMD64');
    PROCESSOR_ARCHITECTURE_UNKNOWN: ShowMessage('PROCESSOR_ARCHITECTURE_UNKNOWN');
  else
    ShowMessage('?');
  end;
end;
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Author Comment

by:CodedK
ID: 13559822
Hi BJThomsen.

Thank u for ur code.
It didnt work ... it gave me PROCESSOR_ARCHITECTURE_INTEL result.
I have AMD64.

Any suggestions? :/

Thanks in andance.
0
 
LVL 3

Expert Comment

by:BJThomsen
ID: 13561168
Sorry try this:

procedure GetNativeSystemInfo(var lpSystemInfo: TSystemInfo); stdcall;
{$EXTERNALSYM GetNativeSystemInfo}

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure GetNativeSystemInfo; external kernel32 name 'GetNativeSystemInfo';

procedure TForm1.Button1Click(Sender: TObject);
var
  MyInfo: TSystemInfo;
const
  PROCESSOR_ARCHITECTURE_INTEL   = 0;
  PROCESSOR_ARCHITECTURE_IA64    = 6;
  PROCESSOR_ARCHITECTURE_AMD64   = 9;
  PROCESSOR_ARCHITECTURE_UNKNOWN = $FFFF;

begin
  GetNativeSystemInfo(MyInfo);
  case MyInfo.wProcessorArchitecture of
    PROCESSOR_ARCHITECTURE_INTEL: ShowMessage('PROCESSOR_ARCHITECTURE_INTEL');
    PROCESSOR_ARCHITECTURE_IA64: ShowMessage('PROCESSOR_ARCHITECTURE_IA64');
    PROCESSOR_ARCHITECTURE_AMD64: ShowMessage('PROCESSOR_ARCHITECTURE_AMD64');
    PROCESSOR_ARCHITECTURE_UNKNOWN: ShowMessage('PROCESSOR_ARCHITECTURE_UNKNOWN');
  else
    ShowMessage('?');
  end;
end;
0
 
LVL 16

Author Comment

by:CodedK
ID: 13567287
Nop...
Doesnt work...
Did everything right...
But still the same result...

PROCESSOR_ARCHITECTURE_INTEL


Thank u. :)
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 13569146
This may help narrow the CPU down some more, as it executes a CPUID function on the processor. While the processor type may not be correct (from windows) the vendor string, family, and stepping model should be

Regards,
Russell

unit CPUIdentify;

interface

uses
  Windows;

type
  TCPUProcessor     =  record
     szClass:       String;
     szVendor:      String;
     dwType:        Integer;
     dwFamily:      Integer;
     dwModel:       Integer;
     dwStepping:    Integer;
  end;

const
  PROCESSOR_INTEL_386              =  386;
  PROCESSOR_INTEL_486              =  486;
  PROCESSOR_INTEL_PENTIUM          =  586;
  PROCESSOR_INTEL_860              =  860;
  PROCESSOR_MIPS_R2000             =  2000;
  PROCESSOR_MIPS_R3000             =  3000;
  PROCESSOR_MIPS_R4000             =  4000;
  PROCESSOR_ALPHA_21064            =  21064;
  PROCESSOR_PPC_601                =  601;
  PROCESSOR_PPC_603                =  603;
  PROCESSOR_PPC_604                =  604;
  PROCESSOR_PPC_620                =  620;

function   GetProcessor: TCPUProcessor;

implementation

function GetProcessor: TCPUProcessor;
var  lpSI:       TSystemInfo;
     lpCPU:      TCPUProcessor;
     _EAX:       Integer;
     _EBX:       Array [0..3] of Char;
     _ECX:       Array [0..3] of Char;
     _EDX:       Array [0..3] of Char;
begin

  try
     asm
        MOV   EAX,  $01      // Setup for version info
        DB    $0F,  $A2      // CPUID opcode
        AND   EAX,  $3FFF            // Type, family, model, stepping returned in eax
        MOV   _EAX, EAX      // Copy to dwtype so we can check
        MOV   EAX,  $00      // Setup for vendor string
               DB    $0F,  $A2      // CPUID opcode
        MOV   _EBX, EBX      // Get vendor id string
        MOV   _EDX, EDX      //
        MOV   _ECX, ECX      //
     end;                            
     GetSystemInfo(lpSI);
     case lpSI.dwProcessorType of
        PROCESSOR_INTEL_386     :  lpCPU.szClass:='80386';
        PROCESSOR_INTEL_486     :  lpCPU.szClass:='80486';
        PROCESSOR_INTEL_PENTIUM :  lpCPU.szClass:='Pentium';
        PROCESSOR_INTEL_860     :  lpCPU.szClass:='Intel 860';
        PROCESSOR_MIPS_R2000    :  lpCPU.szClass:='Mips R2000';
        PROCESSOR_MIPS_R3000    :  lpCPU.szClass:='Mips R3000';
        PROCESSOR_MIPS_R4000    :  lpCPU.szClass:='Mips R4000';
        PROCESSOR_ALPHA_21064   :  lpCPU.szClass:='Alpha 21064';
        PROCESSOR_PPC_601       :  lpCPU.szClass:='Power PC 601';
        PROCESSOR_PPC_603       :  lpCPU.szClass:='Power PC 603';
        PROCESSOR_PPC_604       :  lpCPU.szClass:='Power PC 604';
        PROCESSOR_PPC_620       :  lpCPU.szClass:='Power PC 620';
     else
        lpCPU.szClass:='Unknown';
     end;
     lpCPU.dwType:=  (_EAX shr 12)and $03;
     lpCPU.dwFamily:=(_EAX shr 8) and $0F;
     lpCPU.dwModel:= (_EAX shr 4) and $0F;
     lpCPU.dwStepping:=_EAX and $0F;
     lpCPU.szVendor:=_EBX+_EDX+_ECX;
  except
     ZeroMemory(@lpCPU, SizeOf(lpCPU));
  end;
  result:=lpCPU;

end;

end.

0
 
LVL 16

Author Comment

by:CodedK
ID: 13570647
:?

How do i use this?

Button on click :

Begin
GetProcessor
End;

does not do nothing.

Thanks very much...
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 13570988
???
Sorry, I assumed that you knew how functions worked. You write code to call them, they return a value, then you evaluate the return value and do whatever logic you need to do.

If you check the return type, you will see that it returns a record of TCPUProcessor which is defined as follows:

type
  TCPUProcessor     =  record
     szClass:       String;
     szVendor:      String;
     dwType:        Integer;
     dwFamily:      Integer;
     dwModel:       Integer;
     dwStepping:    Integer;
  end;

szClass is the CPU class
szVendor is the vendor string, like "GenuineIntel",  etc
dwType is the processor type
dwFamily is the family class of processor, which varies depending on manufacturer
dwModel is the model number, again manufacturer dependent
dwStepping is the stepping number of the cpu, again manufacturer dependent


var lpCPU: TCPUProcessor;
begin

 lpCPU:=GetProcessor;
 ShowMessage(lpCPU.szVendor);

end;




0
 
LVL 16

Author Comment

by:CodedK
ID: 13571162
:)
More or less i know how functions work.

Your code works. The resulet is: AuthenticAMD.
But there is no reference if the cpu supports 64bit or not.
Mine is AMD64.

Thank u for ur time and effort...
Can u please give feedback on that?
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 13571213
The reference to 32/64 bit is implied by the following fields:

 dwFamily:      Integer;
 dwModel:       Integer;
 dwStepping:    Integer;

(please post the results so I don't have to ask for them later). The catch is that they tend to be specific to the manufacturer, for example on an Intel Pentium 4 you might expect to see the following:

('Pentium', 'GenuineIntel', 0, 15, 2, 7)

 dwFamily = 15;
 dwModel  = 2;
 dwStepping = 7;

This will identify the CPU; but without the technical specs on the CPU, I can't tell you what they mean. I can look these up for you, but it would help for you to provide me with the AMD model number. The AMD site *should* contain the specs for what the CPUID ASM function returns for the different models, and if you provide the asked for info I can look tomorrow morning.

Regards,
Russell
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 13571244
You can start here, or like I said, I will look more in the am:

http://www.amd.com/us-en/Processors/TechnicalResources/0,,30_182_871_9706,00.html
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 13576858
Here is a link with the family/model numbers for intel, amd and others.

http://www.paradicesoftware.com/specs/cpuid/index.htm

Section 7 lists the codes. For an AMD-64 bit processor, you should find that the family returns 15, and that the model is one of the following:

AMD CPU signatures (Family Model)
4 = Athlon 64
5  = Athlon 64 FX Opteron


Russell
0
 
LVL 16

Author Comment

by:CodedK
ID: 13577759
Thanks Russell... :)

The results are:

Authentic AMD, 15, 12, 0.

:)
0
 
LVL 26

Accepted Solution

by:
Russell Libby earned 1400 total points
ID: 13578954
Ok, here is the *final* code that satisfies the original question. In short, the key to determining a 64 bit intel/amd processor is done using the following logic. This is based off the information made availaible from the CPU tables at  http://www.paradicesoftware.com/specs/cpuid/index.htm

If intel, and family is 7 then  = 64 bit
If intel, and family is 15 and extended family is > 0 = 64 bit
If amd and family is 15 = 64 bit

The code:

unit CPUIdentify;
////////////////////////////////////////////////////////////////////////////////
//
//   Unit        :  CPUIDENTIFY
//   Date        :  03.18.2005
//   Author      :  rllibby
//
////////////////////////////////////////////////////////////////////////////////
interface

uses
  SysUtils;

////////////////////////////////////////////////////////////////////////////////
//   Processor bit count (32 or 64 bit)
////////////////////////////////////////////////////////////////////////////////
type
  TCpuBitType       =  (cbt32, cbt64);

////////////////////////////////////////////////////////////////////////////////
//   Processor information struct
////////////////////////////////////////////////////////////////////////////////
type
  TCPUProcessor     =  record
     szModel:       Array [0..31] of Char;
     szVendor:      Array [0..15] of Char;
     cbtBitType:    TCpuBitType;
     dwType:        Integer;
     dwFamily:      Integer;
     dwExtFamily:   Integer;
     dwModel:       Integer;
     dwExtModel:    Integer;
     dwStepping:    Integer;
  end;

////////////////////////////////////////////////////////////////////////////////
//   Known vendor names (only care about the big 2)
////////////////////////////////////////////////////////////////////////////////
const
  CPU_VENDORS:      Array [0..2] of PChar = ('Unknown', 'GenuineIntel', 'AuthenticAMD');

////////////////////////////////////////////////////////////////////////////////
//   Processor model struct
////////////////////////////////////////////////////////////////////////////////
type
  TCpuModel         =  packed record
     dwVendor:      Integer;
     dwFamily:      Integer;
     dwExtFamily:   Integer;
     dwModel:       Integer;
     lpszModel:     PChar;
  end;

////////////////////////////////////////////////////////////////////////////////
//   Known vendor models
////////////////////////////////////////////////////////////////////////////////
const
  CPU_MODELS:       Array [0..57] of TCpuModel =
                    (
                       (dwVendor: 1; dwFamily: 4; dwExtFamily: 0; dwModel: 0; lpszModel: '486 DX-25/33'),
                       (dwVendor: 1; dwFamily: 4; dwExtFamily: 0; dwModel: 1; lpszModel: '486 DX-50'),
                       (dwVendor: 1; dwFamily: 4; dwExtFamily: 0; dwModel: 2; lpszModel: '486 SX'),
                       (dwVendor: 1; dwFamily: 4; dwExtFamily: 0; dwModel: 3; lpszModel: '486 DX/2'),
                       (dwVendor: 1; dwFamily: 4; dwExtFamily: 0; dwModel: 4; lpszModel: '486 SL'),
                       (dwVendor: 1; dwFamily: 4; dwExtFamily: 0; dwModel: 5; lpszModel: '486 SX/2'),
                       (dwVendor: 1; dwFamily: 4; dwExtFamily: 0; dwModel: 7; lpszModel: '486 DX/2-WB'),
                       (dwVendor: 1; dwFamily: 4; dwExtFamily: 0; dwModel: 8; lpszModel: '486 DX/4'),
                       (dwVendor: 1; dwFamily: 4; dwExtFamily: 0; dwModel: 9; lpszModel: '486 DX/4-WB'),
                       (dwVendor: 1; dwFamily: 5; dwExtFamily: 0; dwModel: 0; lpszModel: 'Pentium 60/66 A-Step'),
                       (dwVendor: 1; dwFamily: 5; dwExtFamily: 0; dwModel: 1; lpszModel: 'Pentium 60/66'),
                       (dwVendor: 1; dwFamily: 5; dwExtFamily: 0; dwModel: 2; lpszModel: 'Pentium 75 - 200'),
                       (dwVendor: 1; dwFamily: 5; dwExtFamily: 0; dwModel: 3; lpszModel: 'OverDrive PODP5V83'),
                       (dwVendor: 1; dwFamily: 5; dwExtFamily: 0; dwModel: 4; lpszModel: 'Pentium MMX'),
                       (dwVendor: 1; dwFamily: 5; dwExtFamily: 0; dwModel: 7; lpszModel: 'Mobile Pentium 75 - 200'),
                       (dwVendor: 1; dwFamily: 5; dwExtFamily: 0; dwModel: 8; lpszModel: 'Mobile Pentium MMX'),
                       (dwVendor: 1; dwFamily: 6; dwExtFamily: 0; dwModel: 0; lpszModel: 'Pentium Pro A-step'),
                       (dwVendor: 1; dwFamily: 6; dwExtFamily: 0; dwModel: 1; lpszModel: 'Pentium Pro'),
                       (dwVendor: 1; dwFamily: 6; dwExtFamily: 0; dwModel: 3; lpszModel: 'Pentium II (Klamath)'),
                       (dwVendor: 1; dwFamily: 6; dwExtFamily: 0; dwModel: 5; lpszModel: 'Pentium II'),
                       (dwVendor: 1; dwFamily: 6; dwExtFamily: 0; dwModel: 6; lpszModel: 'Mobile Pentium II'),
                       (dwVendor: 1; dwFamily: 6; dwExtFamily: 0; dwModel: 7; lpszModel: 'Pentium III (Katmai)'),
                       (dwVendor: 1; dwFamily: 6; dwExtFamily: 0; dwModel: 8; lpszModel: 'Pentium III (Coppermine)'),
                       (dwVendor: 1; dwFamily: 6; dwExtFamily: 0; dwModel: 9; lpszModel: 'Mobile Pentium III'),
                       (dwVendor: 1; dwFamily: 6; dwExtFamily: 0; dwModel: 10; lpszModel: 'Pentium III (0.18 µm)'),
                       (dwVendor: 1; dwFamily: 6; dwExtFamily: 0; dwModel: 11; lpszModel: 'Pentium III (0.13 µm)'),
                       (dwVendor: 1; dwFamily: 7; dwExtFamily: 0; dwModel: (-1); lpszModel: 'Itanium (IA-64)'),
                       (dwVendor: 1; dwFamily: 15; dwExtFamily: 0; dwModel: 0; lpszModel: 'Pentium IV (0.18 µm)'),
                       (dwVendor: 1; dwFamily: 15; dwExtFamily: 0; dwModel: 1; lpszModel: 'Pentium IV (0.18 µm)'),
                       (dwVendor: 1; dwFamily: 15; dwExtFamily: 0; dwModel: 2; lpszModel: 'Pentium IV (0.13 µm)'),
                       (dwVendor: 1; dwFamily: 15; dwExtFamily: 1; dwModel: (-1); lpszModel: 'Itanium 2 (IA-64)'),
                       (dwVendor: 2; dwFamily: 4; dwExtFamily: 0; dwModel: 3; lpszModel: '486 DX/2'),
                       (dwVendor: 2; dwFamily: 4; dwExtFamily: 0; dwModel: 7; lpszModel: '486 DX/2-WB'),
                       (dwVendor: 2; dwFamily: 4; dwExtFamily: 0; dwModel: 8; lpszModel: '486 DX/4'),
                       (dwVendor: 2; dwFamily: 4; dwExtFamily: 0; dwModel: 9; lpszModel: '486 DX/4-WB'),
                       (dwVendor: 2; dwFamily: 4; dwExtFamily: 0; dwModel: 15; lpszModel: 'Am5x86-WT'),
                       (dwVendor: 2; dwFamily: 4; dwExtFamily: 0; dwModel: 15; lpszModel: 'Am5x86-WB'),
                       (dwVendor: 2; dwFamily: 5; dwExtFamily: 0; dwModel: 0; lpszModel: 'K5/SSA5'),
                       (dwVendor: 2; dwFamily: 5; dwExtFamily: 0; dwModel: 1; lpszModel: 'K5'),
                       (dwVendor: 2; dwFamily: 5; dwExtFamily: 0; dwModel: 2; lpszModel: 'K5'),
                       (dwVendor: 2; dwFamily: 5; dwExtFamily: 0; dwModel: 3; lpszModel: 'K5'),
                       (dwVendor: 2; dwFamily: 5; dwExtFamily: 0; dwModel: 6; lpszModel: 'K6'),
                       (dwVendor: 2; dwFamily: 5; dwExtFamily: 0; dwModel: 7; lpszModel: 'K6'),
                       (dwVendor: 2; dwFamily: 5; dwExtFamily: 0; dwModel: 8; lpszModel: 'K6-2'),
                       (dwVendor: 2; dwFamily: 5; dwExtFamily: 0; dwModel: 9; lpszModel: 'K6-3'),
                       (dwVendor: 2; dwFamily: 5; dwExtFamily: 0; dwModel: 13; lpszModel: 'K6-2+/K6-III+'),
                       (dwVendor: 2; dwFamily: 6; dwExtFamily: 0; dwModel: 0; lpszModel: 'Athlon (25 µm)'),
                       (dwVendor: 2; dwFamily: 6; dwExtFamily: 0; dwModel: 1; lpszModel: 'Athlon (25 µm)'),
                       (dwVendor: 2; dwFamily: 6; dwExtFamily: 0; dwModel: 2; lpszModel: 'Athlon (18 µm)'),
                       (dwVendor: 2; dwFamily: 6; dwExtFamily: 0; dwModel: 3; lpszModel: 'Duron'),
                       (dwVendor: 2; dwFamily: 6; dwExtFamily: 0; dwModel: 4; lpszModel: 'Athlon (Thunderbird)'),
                       (dwVendor: 2; dwFamily: 6; dwExtFamily: 0; dwModel: 6; lpszModel: 'Athlon (Palamino)'),
                       (dwVendor: 2; dwFamily: 6; dwExtFamily: 0; dwModel: 7; lpszModel: 'Duron (Morgan)'),
                       (dwVendor: 2; dwFamily: 6; dwExtFamily: 0; dwModel: 8; lpszModel: 'Athlon (Thoroughbred)'),
                       (dwVendor: 2; dwFamily: 6; dwExtFamily: 0; dwModel: 10; lpszModel: 'Athlon (Barton)'),
                       (dwVendor: 2; dwFamily: 15; dwExtFamily: 0; dwModel: 4; lpszModel: 'Athlon 64'),
                       (dwVendor: 2; dwFamily: 15; dwExtFamily: 0; dwModel: 5; lpszModel: 'Athlon 64 FX Opteron'),
                       (dwVendor: 2; dwFamily: 15; dwExtFamily: 0; dwModel: (-1); lpszModel: 'Athlon 64 Unknown Model')
                    );

////////////////////////////////////////////////////////////////////////////////
//   Function to get processor information
////////////////////////////////////////////////////////////////////////////////
function   GetProcessor: TCPUProcessor;

implementation

function GetProcessor: TCPUProcessor;
var  lpCPU:      TCPUProcessor;
     dwIndex:    Integer;
     dwVendor:   Integer;
     _EAX:       Integer;
     _EBX:       Array [0..3] of Char;
     _ECX:       Array [0..3] of Char;
     _EDX:       Array [0..3] of Char;
begin

  // Clear structure
  FillChar(lpCPU, SizeOf(lpCPU), #0);

  // Resource protection in case the CPU (very unlikely) does not support the
  // cpuid instruction.
  try
     // Inline assembler to execute the cpuid signature function
     asm
        MOV   EAX,  $01      // Setup for version / signature info
        DB    $0F,  $A2      // CPUID opcode
        AND   EAX,  $3FFF            // Type, family, model, stepping returned in eax
        MOV   _EAX, EAX      // Copy so we can check
        MOV   EAX,  $00      // Setup for vendor string
               DB    $0F,  $A2      // CPUID opcode
        MOV   _EBX, EBX      // Get vendor id string
        MOV   _EDX, EDX      //
        MOV   _ECX, ECX      //
     end;
     // Get the type, (ext) model, (ext) family, stepping, and vendor
     lpCPU.dwType:=(_EAX shr 12)and $03;
     lpCPU.dwFamily:=(_EAX shr 8) and $0F;
     lpCPU.dwExtFamily:=(_EAX shr 20) and $FF;
     lpCPU.dwModel:=(_EAX shr 4) and $0F;
     lpCPU.dwExtModel:=(_EAX shr 16) and $0F;
     lpCPU.dwStepping:=_EAX and $0F;
     Move(_EBX, lpCPU.szVendor[0], 4);
     Move(_EDX, lpCPU.szVendor[4], 4);
     Move(_ECX, lpCPU.szVendor[8], 4);
     lpCPU.szVendor[12]:=#0;
     // Set default vendor
     dwVendor:=0;
     // Determine the CPU class based on vendor
     for dwIndex:=0 to High(CPU_VENDORS) do
     begin
        // Compare text
        if (StrIComp(@lpCPU.szVendor, CPU_VENDORS[dwIndex]) = 0) then
        begin
           // Found the vendor
           dwVendor:=dwIndex;
           // Done
           break;
        end;
     end;
     // Set bit count
     if (dwVendor = 1) and ((lpCPU.dwFamily = 7) or ((lpCPU.dwFamily = 15) and (lpCPU.dwExtFamily > 0))) then
        // 64 bit intel
        lpCPU.cbtBitType:=cbt64
     else if (dwVendor = 2) and (lpCPU.dwFamily = 15) then
        // 64 bit amd
        lpCPU.cbtBitType:=cbt64
     else
        // 32 bit processor
        lpCPU.cbtBitType:=cbt32;
     // Set default model
     StrCopy(@lpCPU.szModel, 'Unknown');
     // Dig out the cpu model name
     for dwIndex:=0 to High(CPU_MODELS) do
     begin
        // Check against vendor
        if (dwVendor = CPU_MODELS[dwIndex].dwVendor) then
        begin
           // Check against family
           if (lpCPU.dwFamily = CPU_MODELS[dwIndex].dwFamily) then
           begin
              // Check against extended family
              if (lpCPU.dwExtFamily = CPU_MODELS[dwIndex].dwExtFamily) then
              begin
                 // Model must match, or table model must be (-1)
                 if (lpCPU.dwModel = CPU_MODELS[dwIndex].dwModel) or (CPU_MODELS[dwIndex].dwModel = (-1)) then
                 begin
                    // Copy the model name
                    StrCopy(@lpCPU.szModel, CPU_MODELS[dwIndex].lpszModel);
                 end;
              end;
           end;
        end;
     end;
  except
     // Raised an exception (most likely on the CPUID instruction)
     FillChar(lpCPU, SizeOf(lpCPU), #0);
  end;

  // Return structure
  result:=lpCPU;

end;

end.
0
 
LVL 16

Author Comment

by:CodedK
ID: 13579588
I'd like to thank all of u guys :)
Russell works fine... :) :)
I'll increase the points to 500 coz i want to split between u and
BJThomsen for his effort. :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question