Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Process.GetProcesses from x86 process on x64 system 1

Status
Not open for further replies.

serializer

Programmer
May 15, 2006
143
SE
I can't seem to get processes from x64 system in my x86 process. My main goal is just to retrieve names and kill processes - I don't need any further control.

Is it possible to accomplish this?
 
Process[] processes = Process.GetProcesses();

This returns only x86 processes when x86 application runs on x64 machine.

thanks.
 
AFAIK, Process.GetProcesses() will return all processes.
to see the difference between x86 and x64 processes you must use the IsWow64Process API.

are you writing a service? this could be an ACL issue.

/daddy


-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
yes, this is running from a windows service - running as SYSTEM. What kind of permission is needed?
 
since your end goal is to kill processes,
your best option is to NOT use the system account, but a local admin account for example. I'm not sure if the "interact with desktop" flag on the service needs to enabled or not for this purpose.

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
The SYSTEM account works for my needs and I use impersonation when needed. However, this came as a surprise.
 
I did test changing the user to a Administrator instead of system. Same problem, user cannot see x64 processes from x86 process on x64 system.
 
duh, didn't read the subject of your thread.
you can't see x64 processes from a x86 process.

rebuild your service for x64 target.

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
So that is the only way? There is no x86 api for this or?
 
32-bit code is unaware of the 64-bit environment it is running in...

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top