2013-10-08 26 views
1

我想在MS Windows中獲得已安裝的迷你過濾器驅動程序的列表,但我不知道如何做到這一點。獲取已安裝的迷你過濾器驅動程序在Windows中的列表

我的編程語言是德爾福(我也可以使用C或C++)任何一個可以幫助我做到這一點?

+1

有一個名爲內核API函數'FltEnumerateFilters' http://msdn.microsoft.com/en-us/library/windows/hardware/ ff542064(v = vs.85).aspx –

+1

在正常的WinAPI中,您可以嘗試註冊表,例如'HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ services \ FltMgr \ Enum' –

+0

@JensMühlenhoff:在用戶登陸應用程序中是否可以使用這個API函數(FltEnumerateFilters)?或者我必須在覈心土地上使用它? – Behrooz

回答

3

下面的代碼枚舉使用註冊表項:

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
RootHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root參考。 對於以上條目,您可以從中獲得所有信息:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_FLTMGR\0000

此項目是這樣的:

enter image description here

+0

+您可以將結果與'fltmc filters'(來自提升的cmd提示符)進行比較。 – ixe013

相關問題