program Project2;
{$APPTYPE CONSOLE}
uses
SysUtils,
ActiveX,
ComObj,
Variants;
procedure GetCIM_ProcessorInfo;
const
WbemUser ='
';
WbemPassword ='
';
WbemComputer ='
localhost';
wbemFlagForwardOnly = $00000020;
var
FSWbemLocator : OLEVariant;
FWMIService : OLEVariant;
FWbemObjectSet: OLEVariant;
FWbemObject : OLEVariant;
oEnum : IEnumvariant;
iValue : LongWord;
begin;
FSWbemLocator := CreateOleObject('
WbemScripting.SWbemLocator');
FWMIService := FSWbemLocator.ConnectServer(WbemComputer, '
root\CIMV2', WbemUser, WbemPassword);
FWbemObjectSet:= FWMIService.ExecQuery('
SELECT * FROM CIM_Processor','
WQL',wbemFlagForwardOnly);
oEnum := IUnknown(FWbemObjectSet._NewEnum)
as IEnumVariant;
while oEnum.Next(1, FWbemObject, iValue) = 0
do
begin
Writeln(Format('
AddressWidth %d',[Integer(FWbemObject.AddressWidth)]));
// Uint16
Writeln(Format('
Availability %d',[Integer(FWbemObject.Availability)]));
// Uint16
Writeln(Format('
Caption %s',[
String(FWbemObject.Caption)]));
// String
// Writeln(Format('ConfigManagerErrorCode %d',[Integer(FWbemObject.ConfigManagerErrorCode)]));// Uint32
// Writeln(Format('ConfigManagerUserConfig %s',[String(FWbemObject.ConfigManagerUserConfig)]));// Boolean
Writeln(Format('
CreationClassName %s',[
String(FWbemObject.CreationClassName)]));
// String
Writeln(Format('
CurrentClockSpeed %d',[Integer(FWbemObject.CurrentClockSpeed)]));
// Uint32
Writeln(Format('
DataWidth %d',[Integer(FWbemObject.DataWidth)]));
// Uint16
Writeln(Format('
Description %s',[
String(FWbemObject.Description)]));
// String
Writeln(Format('
DeviceID %s',[
String(FWbemObject.DeviceID)]));
// String
// Writeln(Format('ErrorCleared %s',[String(FWbemObject.ErrorCleared)]));// Boolean
// Writeln(Format('ErrorDescription %s',[String(FWbemObject.ErrorDescription)]));// String
Writeln(Format('
Family %d',[Integer(FWbemObject.Family)]));
// Uint16
// Writeln(Format('InstallDate %s',[String(FWbemObject.InstallDate)]));// Datetime
// Writeln(Format('LastErrorCode %d',[Integer(FWbemObject.LastErrorCode)]));// Uint32
Writeln(Format('
LoadPercentage %d',[Integer(FWbemObject.LoadPercentage)]));
// Uint16
Writeln(Format('
MaxClockSpeed %d',[Integer(FWbemObject.MaxClockSpeed)]));
// Uint32
Writeln(Format('
Name %s',[
String(FWbemObject.
Name)]));
// String
// Writeln(Format('OtherFamilyDescription %s',[String(FWbemObject.OtherFamilyDescription)]));// String
// Writeln(Format('PNPDeviceID %s',[String(FWbemObject.PNPDeviceID)]));// String
// Writeln(Format('PowerManagementCapabilities %d',[Integer(FWbemObject.PowerManagementCapabilities)]));// Uint16
Writeln(Format('
PowerManagementSupported %s',[
String(FWbemObject.PowerManagementSupported)]));
// Boolean
Writeln(Format('
Role %s',[
String(FWbemObject.Role)]));
// String
Writeln(Format('
Status %s',[
String(FWbemObject.Status)]));
// String
Writeln(Format('
StatusInfo %d',[Integer(FWbemObject.StatusInfo)]));
// Uint16
// Writeln(Format('Stepping %s',[String(FWbemObject.Stepping)]));// String
Writeln(Format('
SystemCreationClassName %s',[
String(FWbemObject.SystemCreationClassName)]));
// String
Writeln(Format('
SystemName %s',[
String(FWbemObject.SystemName)]));
// String
// Writeln(Format('UniqueId %s',[String(FWbemObject.UniqueId)]));// String
Writeln(Format('
UpgradeMethod %d',[Integer(FWbemObject.UpgradeMethod)]));
// Uint16
Writeln('
');
FWbemObject:=Unassigned;
end;
end;
begin
try
{ TODO -oEntwickler -cKonsole Main : Hier Code einfügen }
Coinitialize(
nil);
GetCIM_ProcessorInfo;
CoUninitialize;
Readln;
except
on E:
Exception do
Writeln(E.ClassName, '
: ', E.
Message);
end;
end.