gpt4 book ai didi

c++ - 在 Windows 中获取已安装的 Mini Filter 驱动程序列表

转载 作者:行者123 更新时间:2023-11-30 01:57:00 25 4
gpt4 key购买 nike

我想获得在 MS Windows 中安装的 Mini-Filter 驱动程序的列表,但我不知道该怎么做。

我的编程语言是 Delphi(我也可以使用 C 或 C++)谁能帮我做这个?

最佳答案

以下代码使用注册表枚举项目:

implementation

{$R *.dfm}

uses Registry;

procedure TForm17.Button1Click(Sender: TObject);
var
Reg: TRegistry;
count: integer;
i: integer;
Item: string;
AllOK: boolean;
begin
Reg:= TRegistry.Create(KEY_READ);
try
Reg.RootKey:= HKEY_LOCAL_MACHINE; //Note must set the base first.
//Then open rest of the subtree underneigh.
AllOK:= Reg.OpenKeyReadOnly('SYSTEM\CurrentControlSet\services\FltMgr\Enum');
if (AllOK) then begin
count:= Reg.ReadInteger('Count');
for i:= 0 to count - 1 do begin
Item:= Reg.ReadString(IntToStr(i));
Memo1.Lines.Add(Item);
end; {for}
end else {not(AllOK)} begin
Memo1.Lines.Add('SYSTEM\CurrentControlSet\services\FltMgr\Enum does not exist');
exit;
end;
finally
Reg.Free;
end;
end;

返回的条目如下所示:Root\LEGACY_FLTMGR\0000
Root 是对 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root 的引用。对于上述条目,您可以从以下位置获取所有信息:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_FLTMGR\0000

这个条目看起来像这样:

enter image description here

关于c++ - 在 Windows 中获取已安装的 Mini Filter 驱动程序列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19246058/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com