Why Is There a system32 Folder in a 64-bit Operating System?

Reason: To Ensure Backward Compatibility

What is Backward Compatibility?
Backward compatibility is a term used to describe software or hardware that is compatible with previous versions of software or operating systems. Without backward compatibility, a program that works with one computer processor or operating system would stop working with the new version. A 32-bit version of VLC media player can run seamlessly on a 64-bit Windows operating system, or a PC game designed for Windows XP can run without problems on Windows 10, all thanks to backward compatibility.

But How Does a 64-Bit Windows OS Ensure Backward Compatibility?
Microsoft ensures that both 32-bit(x86) and 64-bit(x64) applications are able to run on a 64-bit Windows operating systems. When a 32-bit program run on a 64-bit Windows, a 32-bit emulator will be invoked to handle the 32-bit program. The emulator will make the 32-bit application to think it is running on a 32-bit Windows and the same functionality that is accessible on a 32-bit Windows will also be accessible for the program on the 64-bit Windows.

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, are shown in the table below:

Folder Bitness Description
System32 64 Windows system folder (system directory) for 64-bit files
SysWow64 32 Widows system folder (system directory) for 32-bit files
Program Files 64 Folder for 64-but program files
Program Files (x86) 32 Folder for 32-bit program files

Now, the question arises, why is the folder that stores binaries required by 64-bit applications named System32 and why did Microsoft choose to name the folder that contains files required by 32-bit applications ‘SysWOW64’ (Windows on Windows 64)?

Well, this certainly seems illogical but it does have an explanation. It has to do with compatibility. Initially, Microsoft intended to rename the folder but choose not to because 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.

Summing it up, Microsoft wanted to do away with the name ‘System32’ for that folder but did not, otherwise all the Windows 64-bit versions (since Windows 7) would not be able to run a huge chunk of applications and video games.



My Personal Notes arrow_drop_up

Intern Technical Content Writing at GeeksforGeeks

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

1


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.