How to prevent the Win32 process starting on WOW64

winapiwow64

I've got a Win32 process that is compiled and packaged in both 32-bit (x86) and 64-bit (x64) variants. I'd like the x86 variant to refuse to run on a 64-bit version of Windows (i.e. WOW64).

Is there any way to do this by setting linker flags? If not, what do I need to do?

Best Answer

You can check whether you're running under emulation by calling IsWow64Process. Note, that you may need to load the function dynamically if you want to support older versions the OS.

Related Topic