{..}
uses {..,} ComObj,
ActiveX;
{..}
procedure TForm1.Button1Click(Sender: TObject);
var
SWbem,
SWbemCon,
SWbemQuery,
objVar : OleVariant;
szWQL :
String;
pFetched : LongInt;
unknown : IUnknown;
enumUnk : IEnumUnknown;
Counter : Integer;
procedure Display(szValue:
String = '
'; szData :
String = '
');
begin
Form1.Canvas.TextOut(20 , Counter, szValue);
Form1.Canvas.TextOut(200, Counter, szData );
inc(Counter, 17);
end;
begin
Canvas.FillRect(Rect(0,0,form1.Width,form1.Height));
Counter := 20;
CoInitialize(
nil);
try
SWbem := CreateOleObject('
WbemScripting.SWbemLocator');
// strServer, strNamespace, strUser, strPassword, strLocale, strAuthority,
// iSecurityFlags, objwbemNamedValueSet
SWbemCon := SWbem.ConnectServer('
', '
root\SecurityCenter', '
', '
', '
');
szWQL := '
Select * from AntiVirusProduct';
SWbemQuery := SWbemCon.ExecQuery(szWQL,'
WQL', 48);
unknown := SWbemQuery._NewEnum;
unknown.QueryInterface(IEnumVariant, enumUnk);
VarClear(objVar);
OleCheck(enumUnk.Next( 1, objVar, @pFetched ));
if (pFetched <> 0)
then begin
Display('
companyName:' , VarToStr(objVar.companyName));
Display('
displayName:' , VarToStr(objVar.displayName));
Display('
enableOnAccessUIMd5Hash:' , VarToStr(objVar.enableOnAccessUIMd5Hash));
Display('
enableOnAccessUIParameters:', VarToStr(objVar.enableOnAccessUIParameters));
Display('
instanceGuid:' , VarToStr(objVar.instanceGuid));
Display('
onAccessScanningEnabled:' , VarToStr(objVar.onAccessScanningEnabled));
Display('
pathToEnableOnAccessUI:' , VarToStr(objVar.pathToEnableOnAccessUI));
Display('
pathToUpdateUI:' , VarToStr(objVar.pathToUpdateUI));
Display('
productUptoDate:' , VarToStr(objVar.productUptoDate));
Display('
updateUIMd5Hash:' , VarToStr(objVar.updateUIMd5Hash));
Display('
updateUIParameters:' , VarToStr(objVar.updateUIParameters));
Display('
versionNumber:' , VarToStr(objVar.versionNumber));
end else
Display('
No supported AV products found...');
Display('
---------------------------------------------');
szWQL := '
Select * from FirewallProduct';
SWbemQuery := SWbemCon.ExecQuery(szWQL,'
WQL', 48);
unknown := SWbemQuery._NewEnum;
unknown.QueryInterface(IEnumVariant, enumUnk);
VarClear(objVar);
OleCheck(enumUnk.Next( 1, objVar, @pFetched ));
if (pFetched <> 0)
then begin
Display('
Company Name:' , VarToStr(objVar.companyName));
Display('
Display Name:' , VarToStr(objVar.displayName));
Display('
Enabled:' , VarToStr(objVar.enabled));
Display('
enableUIParameters:', VarToStr(objVar.enableUIParameters));
Display('
pathToEnableUI:' , VarToStr(objVar.pathToEnableUI));
Display('
versionNumber:' , VarToStr(objVar.versionNumber));
end else
Display('
No supported FW products found...');
finally
CoUnInitialize;
end;
end;
{..}