Thursday, March 26, 2015

syswow64 - Two different versions of the Program Files folder and the Windows System folder

  
A 64-bit Windows has two different versions of the program files folder and the Windows system folder (system directory). One version is intended for 32-bit files and other version is intended for 64-bit files. The name of these folders, and the bitness they are intended for, is shown in the table below:
  

Folder nameBitnessDescription
System3264Windows System folder (system directory) for 64-bit files
SysWOW6432Windows System folder (system directory) for 32-bit files
Program Files64Folder for 64-bit program files
Program Files (x86)32Folder for 32-bit program files

Below you can see the full path to the folders.
 

Folder nameFolder pathDescription
System32C:\Windows\System32Windows System folder (system directory) for 64-bit files
SysWOW64C:\Windows\SysWOW64Windows System folder (system directory) for 32-bit files
Program FilesC:\Program FilesFolder for 64-bit program files
Program Files (x86)C:\Program Files (x86)Folder for 32-bit program files

The 'System32' folder is for 64-bit files and the 'SysWOW64' folder is for 32-bit files
  
This can be somewhat confusing, but the System32 folder is intended for 64-bit files and the SysWOW64 folder is intended for 32-bit files. This may seem a bit illogical if you look at the folder names, but there is an explanation to this. It has to do with compatibility. Many developers have hard coded the path to the system folder in their applications source code. They have included "System32" in the folder path. And to preserve compatibility, if the application is converted to 64-bit code, the 64-bit system folder is still named System32. But what about 32-bit applications that have the system path hard coded and is running in a 64-bit Windows? How can they find the new SysWOW64 folder without changes in the program code, you might think. The answer is that the emulator redirects calls to System32 folder to the SysWOW64 folder transparently so even if the folder is hard coded to the System32 folder (like C:\Windows\System32), the emulator will make sure that the SysWOW64 folder is used instead. So same source code, that contains a path with the System32 folder included, can be compiled to both 32-bit and 64-bit program code without any changes. So remember:  the SysWOW64 folder is intended for 32-bit files only the System32 folder is intended for 64-bit files only It is very important that a binary file compiled to a specific bitness (32 or 64) is installed to the correct system folder. Otherwise the program that needs the file will not be able to load the file and will probably not work as expected. 
A 32-bit application can access files in the 64-bit system folder if it is really necessary. Although it is quite unusual, it is technical possible. We explain more in this article that we have publiced on our website. 

The 'Program Files' and 'Program Files (x86)' folders
  
If you have a 64-bit Windows installed on your computer you have probably already noticed that there exist two folders for program files: the Program Files folder and the Program Files (x86) folder. The Program Files folder is intended for 64-bit programs and the Program Files (x86) folder is intended for 32-bit programs. In many cases the program will start and run as expected even if you place the program in wrong folder, but if the program asks Windows for the path to the Program Files folder and want to access installed files in the folder, the wrong folder will be used and the program will likely fail to function. So to be sure that everything always works as expected, you should always install files with a specific bitness to the correct Program Files folder. So on a 64-bit computer with a 64-bit Windows, remember this:  always install a 32-bit program into the Program Files (x86) folder always install a 64-bit program into the Program Files folder

  
Supported by all Windows versions
  
This method of naming 32 and 64 bit folders is supported by all 64-bit Windows that have been released on the market. Both client versions and server versions of Windows support this. The following Windows versions support this naming system:  Client operating systems:  Windows XP, Windows Vista, Windows 7 and Windows 8
Server operating systems: Windows Server 2003, Windows Server 2008 and Windows Server 2012

 


'WOW64' and 'x86', what do they mean?
 SysWOW64 and Program Files (x86) are special folders that only exists on 64-bit Windows and they are intended to store 32-bit binary files. In the folder names there are the "strange" character combinations WOW64 and x86 included. These character combinations have a meaning and we will explain it below:  WOW64 is a shortening for ”Windows on Windows 64-bit” (can be read as "Windows 32-bit on Windows 64-bit"). It's a emulator that allows 32-bit Windows-based applications to run seamlessly on 64-bit Windows. A compatibility layer is used as an interface between the 32-bit program and the 64-bit operating system.  x86 is the name of a processor architecture from Intel that handles 32 bit instruction sets. The x86 term have been used for a very long time and in the beginning it was used as a general term to refer to Intel 16/32 bit processors with names such 8086, 80186, 80286, 80386 etc. But since the release of the 80386 processor, the first real 32 bit processor, the term x86 have been used to refer to 32-bit processors that have an instruction set that is compatible with the old 80386 processor. 

No comments:

Post a Comment