LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to determine if an application is 32-bit or 64-bit?

Solved!
Go to solution

Is there a way to determine if an application is 32-bit or 64-bit? To be more specific, I want to be able to determine if a 32-bit application is being emulated under WOW64. I'm trying to use the Call Library Function and selecting IsWOW64Process from the Kernel32.dll, but I can't seem to get it to work. I think I may be setting it up wrong. I'm using a constructor node and invoke node for Process and after calling GetProcesses in the invoke node I'm sending that into a For Loop to inspect each process seperately. Inside the For Loop is where I'm trying to use the Call Library Function. From what I've read IsWOW64Process has a Handle as an input and a pointer to a boolean as an output. I may be incorrect in this as I've seen multiple varieties of this call on the internet. I've tried setting this up but I can't seem to get it to work. I'm looking for help on how to correctly use the Call Library Function or if anyone knows a better way to do this I'm open to suggestions. Thank you for any help. 

0 Kudos
Message 1 of 16
(5,527 Views)

The examples you saw were probable .NET examples that used the kernel32 DLL as an unmanaged call. I'm not quite sure if the same thing will work in LabVIEW. What does your code look like? Can you post it.

 

Also, be aware that IsWOW64 will not tell you if an application is 32-bit or 64-bit. It only tells you if it's running in emulation mode. A 32-bit app running on a 32-bit OS will tell you False, just like a 64-bit app running on a 64-bit OS.

0 Kudos
Message 2 of 16
(5,517 Views)

Yes, I'm aware. That's all I really need to know. I should have phrased the question better. All I need is to determine is if the application is being emulated on a 64-bit OS. This code will only ever be run on a 64-bit machine. I only need the True or False output for a Case Structure that will determine what to do next in the software. I'll try and get the code posted, but its just a simple .NET setup with a constructor node, invoke node, and property nodes. You are also correct smercurio_fc, I have been looking at the .NET examples. I've run out of ideas on where to look so I went to the source, the MSDN Library.

0 Kudos
Message 3 of 16
(5,513 Views)

Code

0 Kudos
Message 4 of 16
(5,495 Views)

Hi klynn,

 

I've got a link you might want to check out to make sure that your call function is correct.

 

http://msdn.microsoft.com/en-us/library/ms684139%28v=vs.85%29.aspx

 

I would also recommend that you check out DLL.VI example in example finder.

 

Example Finder > Communicating with External Applications > Using External Code> Integrating DLLs > Call DLL.vi

 

Hope this helps,

 

Josh L.

 

 

Applications Engineer
National Instruments
0 Kudos
Message 5 of 16
(5,457 Views)
Solution
Accepted by topic author klynn

Thank you for the advice Josh. The link you sent me was actually where I got the idea for what I'm trying to do. I figured out how to determine if an application is being emulated this morning after some more research and trial and error. I ended up figuring it out on my own, but I do appreciate everyone that tried to help.

0 Kudos
Message 6 of 16
(5,454 Views)

Is there a Way to use it in Labview 2014?

 

I still can't get it done.

0 Kudos
Message 7 of 16
(4,719 Views)

Hey NoName,

 

Are you just trying to determine if the application is running 32 bit or 64 bit LabVIEW? If so, see this link. 

 

How to Programmatically Determine if a VI is Running on 32-bit or 64-bit LabVIEW

http://digital.ni.com/public.nsf/allkb/F9770A64A5D5EF4A862576E8005985A8

 

If not, could you give me some information on what it is you're trying to do?

Eden K
Applications Engineer
Message 8 of 16
(4,664 Views)

Not really,

 

I don't want to check if a VI is 32 or 64 Bit. I want to check if a process on the PC is 32 or 64 Bit.

 

I use the "GetProcessByName" to get (for example) "firefox.exe" and now I want to know if Firefox is a 32 or 64 Bit program.

0 Kudos
Message 9 of 16
(4,633 Views)

 Hey NoName1771,

 

Can you give a little more information about what isn't working in LabVIEW 2014? Are you gettitng a specific error code? Have you tried running the above snippet, or some version of a VI that calls the IsWOW64Process function?

 

I assume you are trying to do this all programmatically. If you aren't trying to determine it at runtime, you can look in tehe Process explorer, referenced here:

http://superuser.com/questions/85054/how-do-i-check-if-a-process-is-running-in-64-bit-or-32-bit-mode

 

Hope this helps!

 

Austin H.
Applications Engineering
National Instruments
0 Kudos
Message 10 of 16
(4,578 Views)