Process( ).Handles empty in Vista 64-bit
Process( ).Handles empty in Vista 64-bit
It seems this doesn't work at all Vista-64 bit, process handles are empty, itemcount 0.
After further testing, this seems to be working in Windows 7-64 bit, but only if both processes are running with the same user privileges. For example, you run your delphi app normally, and try to get the handles for another (32-bit) app that you ran as admin, it won't work. If both are are under normal privs or both as admin, it works. Think of any workaround for this?
example code
Var a: integer;
b: string;
begin
with Process('whatever.exe').Handles do
for a := 0 to ItemCount - 1 do
with Items[a] do
begin
Application.ProcessMessages;
if not IsValid then Continue;
if not (ObjType in [otFile, otFileMapping]) then Continue;
b := KernelObj.ObjName;
if b = '' then Continue;
memo1.lines.add(b);
end;
example code
Var a: integer;
b: string;
begin
with Process('whatever.exe').Handles do
for a := 0 to ItemCount - 1 do
with Items[a] do
begin
Application.ProcessMessages;
if not IsValid then Continue;
if not (ObjType in [otFile, otFileMapping]) then Continue;
b := KernelObj.ObjName;
if b = '' then Continue;
memo1.lines.add(b);
end;
Re: Process( ).Handles empty in Vista 64-bit
You'd need a 64bit process to get this information. Shame on Microsoft... :
Re: Process( ).Handles empty in Vista 64-bit
It does actually work with a 32-bit process, if both your application and the one retrieving the info about, are running on the same privilege level (user/user or admin/admin).