Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ensuring a Program Written for 32-bit Windows is Compatible with 64-bit Windows

While it's my understanding that there's no fundamental reason a program written for 32-bit hardware / OSs not to run on 64-bit hardware / OSs, in practice, I've found many programs intended for 32-bit versions of Windows that will not work on 64-bit versions of Windows. Examples include a number of popular security utilities (most products from Norton and Check Point's Zone Alarm) and several games (I've been trying to get Grand Theft Auto 4 to run for a few weeks now, but to no avail - of course, that might be related to any number of other problems related to GTA4, but that's neither here nor there).

I've heard that a program's incompatibility might result from something as simple as not wanting to run from the "Program Files (x86)" folder, but what are some of the other reasons? Why would a virus scanner or firewall written for a 32-bit system not run on a 64-bit system? Why would a game not run when everything is theoretically backwards-compatible?

like image 965
Chance Avatar asked Dec 27 '08 00:12

Chance


People also ask

Can you run a 32-bit program on a 64bit system?

Can I run 32-bit programs on a 64-bit computer? Most programs made for the 32-bit version of Windows will work on the 64-bit version of Windows except for most Antivirus programs. Device drivers that are made for the 32-bit version of Windows will not work correctly on a computer running a 64-bit version of Windows.

How can I run 32-bit programs on 64-bit Windows?

Right-click on the app and choose Properties. In the Properties window, select the Compatibility tab. Then, under the Compatibility mode, check Run this program in compatibility mode for and select the target Windows system.


1 Answers

There is a lot of misinformation on this thread.

When a 32-bit application is run on 64-bit windows:

  • Most of the compatibility problems come when the application tries to install a kernel-mode driver. A 32-bit driver can't be installed on the 64-bit OS. This is amost certainly the problem with a firewall. It's trying to hook into the TCP/IP driver stack.
  • THERE IS NO EMULATOR! The 32-bit object code is executed by the cpu completely natively at full speed.
  • There is no support for old 16-bit code. This broke a lot of installers.
  • Accessing the right folders is generally not a problem. When a 32-bit program opens a file in, say %windir%\system32\, the OS automagically redirects it to %windir%\syswow64. The same for certain parts of the registry. There are a few potential gotchas here, but they're generally along the lines of assuming that various WINAPI Get...Directory() functions return the same strings that they did in Windows 95.
  • Whether it was compiled 10 years ago or just yesterday, then C/C++ pointers are still 32-bits (4 bytes) and all of the code that just assumed that -- including SendMessage()! -- still works. The 8-byte pointer issue doesn't come into the picture until you start converting to 64-bit compilers.
like image 52
Die in Sente Avatar answered Sep 21 '22 15:09

Die in Sente