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

The best explanation I've found is offered here which basically says 32-bit programs are run on an layer of emulation which doesn't allow the system access you'd get from native programs run in a 64-bit environment: blogs.msdn.com/oldnewthing/archive/2008/... I would assume this means that problems with programs like GTA4 come from the layer of emulation not producing the expected results found on a 32-bit native system. This is why you keep seeing Microsoft release compatibility updates all the time Here's what the MSDN has to say about the matter: msdn.microsoft.com/en-us/library/bb42743...).aspx.

The best explanation I've found is offered here which basically says 32-bit programs are run on an layer of emulation which doesn't allow the system access you'd get from native programs run in a 64-bit environment: blogs.msdn.com/oldnewthing/archive/2008/... I would assume this means that problems with programs like GTA4 come from the layer of emulation not producing the expected results found on a 32-bit native system. This is why you keep seeing Microsoft release compatibility updates all the time. Here's what the MSDN has to say about the matter: msdn.microsoft.com/en-us/library/bb42743...).aspx.

1 NO! 32-bit Windows programs DO NOT run in an emulator on 64-bit Windows! There is a Wow64 layer which re-interprets system calls, handles the transitions between 32-bit mode and 64-bit mode, redirects some file accesses, but there is no emulator.

The problems come when the app installs a driver. – Die in Sente Dec 27 '08 at 15:35 I've adjusted my answer a tiny bit, but in the MSDN it says "WOW64 is the x86 emulator that allows 32-bit Windows-based applications to run seamlessly on 64-bit Windows. " I can see what you are saying though.

Simulation would probably fit better but the way emulation is used these days fits too. – Joseph Dec 28 '08 at 1:05 @Die in Sente WoW does do emulation on IA-64 processors. Just not on x64.So this answer is technically correct, but on x64 machines WoW is more of a redirection layer than an emulation layer.

– Eric Haskins Dec 28 '08 at 1:24.

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.

– biozinc Dec 27 '08 at 23:22 1 MSDN says: On the x64 processor, instructions are executed natively by the micro-architecture. Therefore, execution speed under WOW64 on x64 is similar to its speed under 32-bit Windows. On the Intel Itanium processor, more software is involved in the emulation, and performance suffers as a result.

– Joseph Dec 28 '08 at 1:17 1 @biozinc on x64 processors WoW does NO emulation. X64 processors are capable of running x86 and x64 code simultaneously.It provides 32 to 64 bit windows API call translation, and manages when the processor is in 32 or 64 bit mode. The Wiki article has sources: en.wikipedia.

Org/wiki/WOW64 – Eric Haskins Dec 28 '08 at 1:19 @Joseph beat me to it... – Eric Haskins Dec 28 '08 at 1:20 I'm starting to think virtualization is a better term to describe how WOW64 works on an x64 processor. The idea seems very similar to how Virtuozzo works. – Joseph Dec 28 '08 at 1:36.

Drivers are a different story that programs: support.microsoft.com/kb/896456 Zone Alarm uses a special 32-bit driver created by Check Point to do the monitoring. This is probably what's creating the issue with that application. As for Grand Theft Auto 4?

I have no idea.

GTA4: For most games anti copy protection measures install drivers and even root kits to ensure your game is 'legit'. – Remus Rusanu Aug 12 '09 at 22:07.

There can be any number of reasons. Any application which is programmed ad a low level might be expecting 32 bit register. The Zone Alarm driver posted by novatrust is a good example.

GTA4 might be using assembly to improve performance at several points which might result on anything or even simply assuming 32 bits on C++. For example take the following code: struct GPoint { int x; int y; } // Array of twenty GPoints GPoint myArr = malloc(20 * sizeof(GPoint); GPoint* myPointer = myArr; int index = GetIndexAffectedPoint(); // Invert X and Y for the point myPointer += 8*index; swap(myPointer); I know the example is pretty naive but anyway, in that code you are assuming you're struct is 8 bytes long (4 bytes of the x integer and 4 bytes for the y integer) but in a 64 bit system is actually twice that long so you'll end up swapping the wrong point... things like that happen a lot on low level languages, specially when trying to improve performance...

This type of thing is a problem when you take 32-bit code and recompile it as 64-bit without fixing these assumptions. However, the question was 32-bit apps running on the 64-bit OS. In that case, the legacy code in your example will work just fine.

– Die in Sente Dec 27 '08 at 15:38.

Security applications are a bad example. They all perform unsupported things against undocumented things. Changes between one 32-bit version of Windows to the next are enough to break them, nevermind moving to 64-bit.

That said, there are some compatibility shims that fixup your code on 32-bit that won't when the app is 64-bit. This is because Microsoft assumes you've tested it on 64-bit. One resulting gotcha is with .

NET applications. When running on a 32-bit system, the exe is jitted to 32-bits - where there are compatibility shims to fix your bugs. If your customer happens to be running on a 64-bit system, the executable will be jitted to 64-bits, where those compatibility shims that were protected you from yourself are no longer present.

Chris Jackson had a nice blog entry about this: Shimming Applications on Windows Vista 64-Bit.

The problem is probably drivers. With games, it's probably some kind of slimy DRM scheme. Try getting the no-CD crack for the game so you can run it without DRM.

32-bit to 64-bit Migration Considerations EDIT: Alternative link.

If you are using the file system or the registry, make sure that you access the right folders. As a x86 program you will probably want to access "Program Files (x86)", "System32", "WOW6232Node" and such folders instead of the x64 ones. Products with x86 applications like Norton and Check Point's Zone Alarm fail to run their x86 driver, as the driver needs to x64 to be able to ran by the operating system.

Don't try to access those folders directly. Windows already redirects requests involving normal directories to their appropriate 32-bit counterparts. – Powerlord Dec 29 '08 at 14:47.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions