The code below freeze at the same handle as NtQueryObject, when accessing the objname property.
Is there any way arounf, without using a driver to enumerate handles?
Code: Select all
for i:=0 to processes.ItemCount-1 do
begin
p:=processes.items[i];
if extractfiledir(p.ExeFile)='' then continue;
for j:=0 to p.Handles.ItemCount-1 do
begin
with p do
begin
h:=handles.items[j];
if not (h.ObjType in [otFile, otFileMapping]) then continue;
if not h.IsValid then continue;
if h.KernelObj.ObjName='' then continue;
listbox1.items.add(h.KernelObj.ObjName);
ListBox1.TopIndex:=ListBox1.count-1;
application.ProcessMessages;
end;
end;
end;