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!

.NET Process object - 32 or 64 bit?

Status
Not open for further replies.

AnonGod

IS-IT--Management
Jun 5, 2000
223
Using Process.getProcesses() i'm pulling in all running processes on a machine. I need a way to determine if each Process is 32 or 64 bit.

Problem is when I'm running a 32 bit host application on a 64 bit machine. When it tries to read Process p.MainModule.ModuleName (or any module access) it only get the ModuleName from 32 bit processes. The 64 bit process errors out.

Now I could wrap a try/catch around it, but it makes sense to me to have a way of telling before hand. I've looked through the Process members, but nothing seems to be telling.

All help is appreciated. Thanks!
:) -Andrew

alien.gif

[Signature modified by admin request]
-TAG
[Contact information removed by another admin request]
 
Solved.
Ended up using My.Computer.Info_OSFullName to see if "x64" was in the name.
Then used IsWow64Process Windows API call to see if each process was a 32 bit running on a 64 machine.

:) -Andrew

alien.gif

[Signature modified by admin request]
-TAG
[Contact information removed by another admin request]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top