75 lines
1.9 KiB
Plaintext
75 lines
1.9 KiB
Plaintext
unit DWscProdMain;
|
|
|
|
interface
|
|
|
|
uses
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
|
|
|
|
type
|
|
TDlgWscProdMain = class(TForm)
|
|
Button1: TButton;
|
|
mmInfo: TMemo;
|
|
procedure Button1Click(Sender: TObject);
|
|
private
|
|
{ Private declarations }
|
|
public
|
|
{ Public declarations }
|
|
end;
|
|
|
|
var
|
|
DlgWscProdMain: TDlgWscProdMain;
|
|
|
|
implementation
|
|
|
|
uses
|
|
Tocsg.WscApi, Winapi.ActiveX, Tocsg.Safe, Tocsg.Convert, AbUnzper, AbArcTyp;
|
|
|
|
{$R *.dfm}
|
|
|
|
procedure TDlgWscProdMain.Button1Click(Sender: TObject);
|
|
const
|
|
WSC_SECURITY_LIST: array [0..2] of Integer = (
|
|
WSC_SECURITY_PROVIDER_FIREWALL,
|
|
WSC_SECURITY_PROVIDER_ANTIVIRUS,
|
|
WSC_SECURITY_PROVIDER_ANTISPYWARE);
|
|
var
|
|
i, c: Integer;
|
|
PdList: TWSCProductEntList;
|
|
begin
|
|
Guard(PdList, TWSCProductEntList.Create);
|
|
|
|
mmInfo.Clear;
|
|
CoInitialize(nil);
|
|
try
|
|
for i := Low(WSC_SECURITY_LIST) to High(WSC_SECURITY_LIST) do
|
|
begin
|
|
mmInfo.Lines.Add(IntToStr(WSC_SECURITY_LIST[i]));
|
|
mmInfo.Lines.Add('');
|
|
|
|
if GetWscSecurityInfo(WSC_SECURITY_LIST[i], PdList) > 0 then
|
|
begin
|
|
for c := 0 to PdList.Count - 1 do
|
|
begin
|
|
with PdList[c]^ do
|
|
begin
|
|
mmInfo.Lines.Add(Format('Name : %s', [sName]));
|
|
mmInfo.Lines.Add(Format('Guid : %s', [sGuid]));
|
|
mmInfo.Lines.Add(Format('StateTimestamp : %s', [sStateTimestamp]));
|
|
mmInfo.Lines.Add(Format('State : %d', [nState]));
|
|
mmInfo.Lines.Add(Format('Status : %d', [nStatus]));
|
|
mmInfo.Lines.Add(Format('RemediationPath : %s', [sRemediationPath]));
|
|
mmInfo.Lines.Add(Format('IsDefault : %s', [BooleanToStr(bIsDefault, 'O', 'X')]));
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
mmInfo.Lines.Add('');
|
|
end;
|
|
finally
|
|
CoUninitialize;
|
|
end;
|
|
end;
|
|
|
|
end.
|