Search code examples
windows-vista64-bit32-bitdetection

Is there a way to detect if another process in vista is running in 32bit or 64bit mode?


I'm writing an application that interacts with other processes on a x64 Vista machine. In order to do this it will need to know if the other process is running in 32bit or 64bit mode. How can I detect this?


Solution

  • You'll need to get a process handle first, then call IsWow64Process(). If it's a 32-bit process, it'll return false.

    Note that you'll also have to call GetProcAddress() to make sure that IsWow64Process() is even available in case you're not even running on a 64-bit Windows.

    Cheers!
    Sean