How Windows 64-bit Supports 32-bit Applications

Introduction

This article provides an overview of the Windows on Windows 64 (WOW64) sub-system and associated techniques that support 32-bit applications under Windows 64-bit.

 
Discussion

Windows 32-bit on Windows 64 (WOW64)

WOW64 emulates 32-bit Windows

Under Windows 64-bit, 32-bit applications run on top of an emulation of a 32-bit operating system that is called Windows 32-bit on Windows 64-bit, or WOW64 for short.  WOW64 intercepts all operating system calls made by a 32-bit application.

For each operating system call made, WOW64 generates native 64-bit system calls, converting 32-bit data structures into 64-bit aligned structures. The appropriate native 64-bit system call is passed to the operating system kernel, and any output data from the 64-bit system call is converted into a format appropriate for the calling application before being passed back.

Like 32-bit applications, WOW64 runs in user mode so any errors that occur in translating an operating system call will only occur at that level. The 64-bit operating system kernel cannot be affected.

Since WOW64 runs in user mode, all 32-bit application code must also run in user mode. This explains why 32-bit kernel mode device drivers and applications that rely on them, will not work under Windows 64-bit.

The WOW64 emulator consists of the following DLLs, the only 64-bit DLLS that can be loaded into a 32-bit process:

Wow64.dll – the core emulation infrastructure and the links to the Ntoskrnl.exe entry-point functions.
Wow64Win.dll – the links to the Win32k.sys entry-point functions.
Wow64Cpu.dll – switches the processor from 32-bit to 64-bit mode.
Ntdll.dll – 64-bit version.

Wow64.dll loads the 32-bit version (x86) of Ntdll.dll and all necessary 32-bit DLLs which are mostly unmodified 32-bit binaries..However, some of these DLLs have been modified to behave differently on WOW64 than they do on 32-bit Windows. This is usually because they share memory with 64-bit system components.

WOW64 manages file and registry settings

In addition to handling operating system calls, the WOW64 interface needs to ensure that files and registry settings for 32-bit applications are kept apart from those for 64-bit applications. To achieve this two mechanisms are used, File and Registry Redirection and Key Reflection. Redirection maintains logical views of the data as if it were in 32-bit Windows and maps it to the correct physical location. Reflection ensures that 32-bit and 64-bit settings will be consistent where that is required.

File Redirection

File redirection ensures that there are separate folders for program and operating system files for 32- and 64-bit applications.

32-bit applications files are installed into

C:\Program Files(x86)

32-bit system files are installed into

C:\WINDOWS\SysWOW64

For 64-bit applications, files are installed to:

C:\Program Files
C:\WINDOWS\SYSTEM32

The WOW64 file redirector ensures that requests from 32-bit applications to open files in C:\Program Files or C:\WINDOWS\SYSTEM32 are redirected to the appropriate 32-bit directories.

There is one issue with file redirection that users and developers should be aware of.

Many 64 bit applications still use 32 bit installation routines. To ensure that an application is installed correctly, i.e. to C:\Program Files, the installation routine should make an operating system call to temporarily suspend the WOW64 file redirector. After installation another operating system call needs to be made to re-enable the redirector. If this approach isn't followed then the application will be installed to C:\Program Files (x86). A classic example of this is the 64 bit development version of Firefox 3.5, codenamed Shiretoko, which is installed to C:\Program Files(x86)\Shiretoko. Firefox still functions correctly, the only thing you can't do is change the icon for the application.

Registry Redirection

Registry keys specific to 32-bit applications are redirected from:

HKEY_LOCAL_MACHINE\Software

to:

HKEY_LOCAL_MACHINE\Software\WOW6432Node

You may also occasionally see Registry entries elsewhere although this is unusual

HKEY_CURRENT_USER\Software\WOW6432Node

This approach allows both the 32-bit and 64-bit versions of an application to be installed side-by-side without overwriting each other’s settings.

Registry reflection

Some redirected keys and/or values are also reflected. This means that if a 32-bit application makes a change to the redirected section of the registry, that change is also made to the 64 bit part of the registry, and vice-versa. Key reflection uses a policy of last writer wins. For example, if I install three applications with the same file extension then the last one to be installed will be associated with that extension.

  1. Install a 32-bit application that associates itself with the file extension XYZ.

  2. Install the 64-bit version of this application that associates itself with the file extension XYZ.

  3. Install another 32-bit application that associates itself with the file extension XYZ.

Double-clicking on a file with the extension XYZ in Explorer would load the application installed in step 3, as it was the last one to associate itself with this extension.

All of this is done transparently for 32-bit applications by WOW64, which, in intercepting calls to the operating system, detects references to file paths and registry keys and maps them accordingly.

WOW64 has several limitations

Some but not all 64-bit features are available to 32-bit applications

WOW64 provides 32-bit applications with access to some features of 64-bit systems. For example, applications can have more memory up to 4GB with the correct setting.. Other features are more limited due to overheads and restrictions. For example, 64-bit Windows will support logical 64 processors but 32-bit applications are restricted to the usual 32 logical processors.

Code Injection cannot mix between 32-bit and 64-bit

Under 64-bit Windows it is not possible to inject 32-bit code into a 64-bit process, nor is it possible to inject 64-bit code into a 32-bit process. Applications that rely on code injection to add functionality to existing applications will usually not work.

This explains why most 32-bit shell extensions do not work under Windows 64-bit. The majority of shell extensions rely on code injection to add themselves to Windows Explorer.

WOW64 does not support 16-bit installers

WOW64 provides support for Microsoft's 16-bit installer - by substituting a compatible 32-bit installer - but does not extend this support to third-party products.

 

Further options for running 32-bit applications with Windows 64-bit

Windows Virtual PC

Windows Virtual PC is free software that provides an environment that will support legacy hardware and software that will not work under Windows 7. Guest operating systems (OS) can run in a virtual machine which means they are not aware that they are running under another operating system.

The system requirements and features vary significantly between versions of Virtual PC and versions of Windows so check before you try Virtual PC. The latest version is, perhaps, the most limited with no support for operating systems before the current supported version of Windows XP which is Service Pack 3.

Windows XP Mode (XPM)

Windows XP Mode  is a specific implementation of Windows Virtual PC that comes with a pre-installed, licensed copy of Windows XP Professional with Service Pack 3. It is only available with the Enterprise, Ultimate and Professional editions of Windows 7 64-bit so you are expected to upgrade to these versions if you want it.

Many who have used XPM advise that it should be used as a last resort. It will provide legacy support if you have no other options but, compared to other virtualization products, performance is disappointing and the default configuration raises a number of security issues.

Dual boot Windows

You can install more than one version of Windows on the same computer by dual booting.For the purposes of this article, you would install a 32-bit version and a 64-bit version alongside each other. Each operating system is installed into its own disk partition and a boot manager is installed on the default partition to ensure that you can choose which operating system you want to use at startup.

Although you cannot use both operating systems at the same time it is a useful option because the entire computer is dedicated to the running operating system. Compared with virtual machines, there are no issues of compatibility and much less complexity in both installation and operation. You can also retain the ability to run 16-bit applications under the 32-bit version of Windows.

Summary

Most 32 bit applications will run quite happily under Windows 64. The main exceptions are:

  1. 32-bit device drivers.
  2. Applications that cannot function without the 32-bit device drivers that they use. Prime examples are antivirus, antimalware and firewall applications.
  3. Application extensions that rely on code injection into, for example, Explorer.

Some applications may work with reduced functionality. These include uninstallers, registry cleaners and tweaking programs, amongst others, since they only have access to that part of the Registry made visible to them by WOW64.

If you cannot run your 32-bit applications then consider virtualization or dual-booting with the old and new operating systems both installed.

 
Related Links
 
Editor

This software category is maintained by volunteer editor Remah.

  "I've used TechSupportAlert and the older Support Alert Newsletter for almost a decade so I have saved hundreds of hours of work and many more dollars by following Gizmo's Freeware recommendations. Thanks for the opportunity to give something back."  

If you have had a similar experience then you should consider becoming a reviewer too.

Tags

Windows on Windows 64, WOW64, 32 Applications under 64 bit Windows, 64 bit Windows Vista, 64 bit Windows 7, Windows Virtual PC, virtualization, dual boot, Securable

Back to the top of the article.

 

Share this
4.25108
Average: 4.3 (231 votes)
Your rating: None

Comments

by Anonymous on 1. July 2009 - 21:27  (24555)

Another shining example of the Microsoft logic :


"32 bit system files are installed into
C:\WINDOWS\SysWOW64
[...]
For 64 bit applications, files are installed to
C:\WINDOWS\SYSTEM32"

...just like the idea of clicking on the start button to stop windows.

by rikmayell (not verified) on 3. July 2009 - 8:39  (24590)

I've read many articles, forum and blog posts about this issue yet never come across anything that really sold the idea to me. Piecing together some common bits, I've arrived at an explanation that I'm happy to live with, but I'm not assuming it's correct.

Despite requests from Microsoft, many independent software vendors have hard coded \WINDOWS\SYSTEM32 into their applications despite the fact that there is no need to. I assume Microsoft felt that this was likely to still be the case for applications ported to 64 bit. I've checked, and one of the commercial 64 bit applications I use still contains this hard coded path.

In an ideal world we would have had 32 bit operating system code stored in

C:\WINDOWS\SYSTEM32

and 64 bit code in, say,

C:\WINDOWS\SYSTEM64

If this were the case, to handle 64 bit applications with references to SYSTEM32, some sort of file redirector would have been required. Unlike the WOW64 file redirector, which runs in user mode, the 64 bit redirector would have needed to be kernel based to handle references in drivers, etc. Naturally, if a fault were to occur in this hypothetical 64 bit file redirector, a security hole or BSOD could result.

Presumably Microsoft decided that the strange naming convention was preferable to exposing the kernel to any additional risk.

Who knows?

If anyone does know the correct reason, please post a comment, along with your name and I'll add the details to the article citing you as the source.

Rik Mayell - Article Editor

by choicefresh on 3. July 2009 - 22:49  (24617)

Are there any disadvantages to 64bit other than price?

by Jojo Yee on 4. July 2009 - 0:29  (24619)

In my opinion, the most typical disadvantage is the compatibility or ability to run 32 bit applications, until such time that most applications are developed to fully support 64 bits.

Even with the support of hardware virtualisation, some applications are still not working well on a 64-bit machine, as noted by the editor.

by choicefresh on 4. July 2009 - 3:16  (24621)

Well, I think most major reputable software has a 64bit version, doesn't it?

Avira AntiVir, Comodo firewall, Firefox...

by peter on 4. July 2009 - 8:56  (24623)

Although much reputable sware has versions that run in 64-bit mode, very few are true 64-bit versions. There's also the problem of legacy hardware support, & "signed" drivers.

by rikmayell (not verified) on 4. July 2009 - 14:31  (24635)

Comodo Internet Security is available as a native 64 bit application. Avira is a hybrid application, most of the code is still 32 bit, only the kernel mode device driver has been ported to 64 bit and, as required by Windows 7 / Vista, is digitally signed (as mentioned by Peter.) 64 bit Firefox is still under development and, for a number of reasons beyond the control of the developers, is not suitable for day to day use. The same applies to Thunderbird.

Some applications, such as SuperAntiSpyware, are still completely 32 bit, although a hybrid version may be made available later this year.

For details of 64 bit freeware refer to our review Best Free Windows 7 / Vista 64 bit Software.

Rik Mayell - Article Editor

by Anonymous on 5. July 2009 - 22:17  (24680)

Just one error in the otherwise fantastic article - the windows XP virtual machine is available to Professional also, not just Enterprise/Ultimate.

I say "Enterprise/Ultimate" since they have the exact same feature set, Enterprise is just able to be activated from an in-house activation server instead of Microsoft's, and is only available in volume license form.

by rikmayell (not verified) on 6. July 2009 - 8:40  (24697)

Many thanks for pointing out the error which has been corrected.

Rik Mayell - Article Editor

by Anonymous on 25. September 2009 - 9:24  (33275)

In the Sun world 32 bit goes into unlabled directories (/usr/lib) and 64bit into specific directories (/usr/lib64). There are exceptions, thanks Oracle, that for the 64 bit version reverse this ($ORACLE_HOME/lib and $ORACLE_HOME/lib32).

To my mind the Sun method is the one to use since most apps are still 32 bit so they don't need to change anything between 32 bit and 64 bit operating systems. If you want to build 64 bit version it's upto you to drop your files in the right place and use the correct versions of libraries.

The general model in UNIX land also seems better. The 64 bit OS installs both 64 and 32 bit libraries and so can run both 32 and 64 bit apps. You still need some matching though (64 bit Firefox needs 64 bit Java). Why can't MS do the same?

by rikmayell (not verified) on 26. September 2009 - 5:41  (33341)

Further to my previous answer, I to find it bizarre that Microsoft did not lay down firm rules when they released the Software Development Kit for 64 bit XP. It would have been easy to specify that 64 bit system binaries 'live' in \WINDOWS\SYSTEM64 and 32 bit in \WINDOWS\SYSTEM32. If as a result your 64 bit application didn't work, tough.

Some might argue that they didn't want to annoy ISVs. Frankly, that didn't bother them when they made huge changes between the XP and Vista kernels, so why should this?

Unfortunately, nothing has changed with the arrival of Windows 7 so this appears to have been a missed opportunity that we will have to learn to live with.

Rik Mayell -Article Editor

by Anonymous on 16. February 2010 - 6:48  (43720)

If a 32-bit application were to be made to install in the C drive and not in the Program Files x86 folder, would it give rise to problems? I am not able to run an application which I have installed in C drive. Will installing the same in Program files x86 folder solve the problem?

by rikmayell (not verified) on 16. February 2010 - 14:18  (43749)

In theory the application should work regardless of where it is installed. It would help if you could specify which particular application you are having problems with.

Rik

by Anonymous on 11. March 2010 - 13:59  (45380)

Hi, I am currently trying to run an Application on Windows Vista 64 environment. This comes back with the error message"OCIW32.dll not found",
This application works well on Vista 32. Can you please advice how I may run this application on vISTA 64?

by rikmayell (not verified) on 17. March 2010 - 11:17  (45709)

Please accept my apologies for not replying sooner, it's turning out to be one of those months, not weeks!

OCIW32.DLL is part of 32 bit Oracle for Windows. Presumably you either have the development tools installed or, more likely, are using an application that is Oracle runtime based. If you haven't installed Oracle runtime that would explain the error message. Alternatively, if it is installed then this particular DLL, and possibly others, aren't in a directory that is the PATH environment variable.

I'm sorry if this is all rather vague but I don't have Oracle runtime installed. Sorry.

Rik Mayell - Category Editor

by Anonymous on 2. April 2010 - 13:48  (46763)

Hi, after googling for a couple of hours i could not find an answer, maybe you could help me:i have go a new w7 64 bit. i think that a few weeks ago while struggling with some program installtions, i ran some cmd line (i can't remeber which), to switch to some 32 bitcompatability mode .now when i look in the proccess manager many of the proccesses run in 32 bit mode, including visual studio and sql studio (64 bit versions installed). any idea how to get back to the previous 64 bit mode? Thanks..EE

by Anonymous on 3. April 2010 - 21:23  (46890)

The statement "Your PC must support hardware level virtualisation to use this facility." is no longer correct. XP Mode no longer requires virtualization hardware - see http://lifehacker.com/5497316/windows-xp-mode-no-longer-requires-virtual....

by rik on 10. April 2010 - 7:38  (47351)

Thanks for that I will update the article.

Rik

by rik on 10. April 2010 - 7:41  (47352)

Processes running in 32 bit mode contain fully 32 bit code, 64 bit processes by definition can only run in 64 bit mode. I suggest you make sure that your program icons are pointing to the correct 64 bit application installations.

Rik

by Anonymous on 17. April 2010 - 15:52  (47846)

Many thanks for your comments.

1) Can 32-bit programs be installed in any Directory I create to better organize my programs or must they be installed in the Programs(86)Directory?

2) How do tell if a program is running as a 32-bit program or a 64-bit program?

3) When I upgrade a program, is there a usual way of selecting a 64-bit version?

by Anonymous on 24. April 2010 - 9:06  (48336)

one Problem with using 32 bit application on 64 bit machine , in My Application which is created on 32 bit machine i have a Functionality that import the data from excel file and save it to my database , in 32 bit environment it run fine but this functionality giving problem in 64 bit machine , when i choose the excel file and click on Import then My Application Closed automatically on 64 it machine , i am using office 2007, is there any problem with compatibility of office dlls on 64 bit environment.

by rik on 24. April 2010 - 9:28  (48340)

To answer your questions:

1. You can install 32 bit applications in any location other than C:\Program Files and C:\WINDOWS\SYSTEM32.

2. The easiest way is to use a tool like Process Explorer available here. This marks each process to indicate whether it is 32 or 64 bit.

3. Most often, if an application is available in both 32 and 64 bit versions they will be available as separate downloads. In a few cases a single installation routine is used and the 64 bit version will be installed under a 64 bit version of Windows.

Hope that helps.

Rik

by rik on 24. April 2010 - 9:32  (48341)

I can't say I've ever interfaced to Office 2007 DLLs from any of my applications, but as Office 2007 itself works fine I can't see why there should be a problem. All I can really suggest is that you add debug code to determine exactly where the application termination is happening and try and figure things out from that. You might also find Microsoft's Process Monitor, available here, to be useful.

Rik

by Anonymous on 27. April 2010 - 5:15  (48538)

Great, informative article.

I have a very good 32-bit Windows program (Dyno 2000) which I can't get to even install from CD in my 64-bit Vista Ultimate environment.
(I have an older version of the Dyno software, the 16-bit DOS -type version, which I easily run without issues using the DOSBox emulator utility in 64-bit Vista.) I have tried to run the 32-bit setup.exe file from the Dyno 2000 installation CD in various forms of Compatibility Mode in 64-bit Vista, but none has worked.

How do you get a 32-bit installation program to run from within 64-bit Vista, so that the things you describe in this article do their things (i.e., install their 32-bit dll's & other stuff into the redirected locations, and write their 32-bit registry entries in their redirected locations, to make the older, 32-bit Windows program think it's in its correct world) ?

Can 64-bit Vista Ultimate even do this (effectively), or must I find a third-party 32-bit-in-64-bit emulator in order to use my older program ?

Many thanks in advance for your help.

by Anonymous on 27. April 2010 - 5:20  (48540)

If you have a collection of 32bit games you'd like to continue to play, going 64bit Windows 7 will be a disaster. Being told by Win7 that you need a 64bit version of a game now out of print is laughable. Clever backwards compatible OS that repeatedly fails to deliver the goods.

by rik on 27. April 2010 - 5:35  (48541)

If the installation routine won't run as you describe then virtualisation, as you describe, would seem to be your only option. Normally I would expect 32 bit applications to work without too much of a problem. What do the applications you are trying to install actually do?

Rik

by rik on 27. April 2010 - 5:38  (48542)

I don't have much experience with games, I've never had the hand to eye co-ordination needed. If you have the right version of Windows 7, XP mode could resolve your problem. Failing that setting up a virtual XP environment should do the trick.

Rik

by Anonymous on 27. April 2010 - 6:05  (48544)

Dyno 2000 is a very advanced (although now outdated) engine simulator which is capable of graphing torque & horsepower curves for MANY different types of engines. Simply put, you can virtually build an engine on a PC and hone in on specifically what you want the engine to do, know what to expect from it, etc., before you ever buy the first part. It's very powerful, with an "Iterative" testing system that will allow you to run hundreds, or thousands, or hundreds of thousands, of variations to engine parts, then show you which ones worked best. It's a fantastic program.

I downloaded the Bochs emulator, but have zero clue how to use it. Can you recommend something that will head-fake this 32-bit installation program for Dyno 2000 into thinking it is in a 32-bit Windows environment ?

(Thanks for the superfast reply, by the way !)

by rik on 27. April 2010 - 6:21  (48545)

Well you need to setup a virtual XP environment to handle this. I can't give you the full details right now but will get back to you.

Rik

by HeWhoRocks on 27. April 2010 - 16:11  (48572)

I know that some older games will not run but i have played Elder Scrolls Oblivion, FEAR and Bioshock (all 32 bit games) on 64 bit Win7 with no problems and without using XP mode. Also, these are the only three games i've tried running on Win7 so three for three isn't bad. I think it just depends on which games you want to play.

Gizmos Needs You

Gizmo's Freeware is Recruiting

 We are looking for people with skills or interest in the following areas:
 -  Mobile Platform App Reviews for Android and iOS
 -  Windows, Mac and Linux software reviews       Interested? Click here