WoW64

Last updated
WoW64
Other namesWindows 32-bit on Windows 64-bit
Developer(s) Microsoft
Initial releaseOctober 25, 2001;22 years ago (2001-10-25)
Operating system Microsoft Windows
Platform IA-64, x86-64, ARM64
Type Compatibility layer
License Proprietary commercial software
Website docs.microsoft.com/en-us/windows/desktop/WinProg64/running-32-bit-applications

In computing on Microsoft platforms, WoW64 (Windows 32-bit on Windows 64-bit) is a subsystem of the Windows operating system capable of running 32-bit applications on 64-bit Windows. [1] It is included in all 64-bit versions of Windows, except in Windows Server Server Core where it is an optional component, and Windows Nano Server where it is not included. [lower-alpha 1] WoW64 aims to take care of many of the differences between 32-bit Windows and 64-bit Windows, particularly involving structural changes to Windows itself.

Contents

Translation libraries

The WoW64 subsystem comprises a lightweight compatibility layer that has similar interfaces on all 64-bit versions of Windows. It aims to create a 32-bit environment that provides the interfaces required to run unmodified 32-bit Windows applications on a 64-bit system. WOW64 is implemented using several DLLs, some of which include: [3]

  1. Wow64.dll, the core interface to the Windows NT kernel that translates (thunks) between 32-bit and 64-bit calls, including pointer and call stack manipulations
  2. Wow64win.dll, which provides the appropriate entry-points for 32-bit applications (win32k thunks)
  3. A dll that allows 32-bit x86 instructions to be executed, which varies by instruction set architecture.
    • On x86-64, Wow64cpu.dll takes care of switching the processor from 32-bit to 64-bit mode. This is computationally cheap, as x86-64 machines have a native mode for running 32-bit x86 code. [4]
    • On IA-64 (Itanium 2), three files are needed for a slower [5] software emulation: Wow64cpu.dll, a "CPU abstraction layer"; IA32Exec.bin, the x86 software emulator; and Wowia32x.dll, the bridge between the emulator and the WOW64 system. [6]
    • On ARMv8 64-bit, xtajit.dll for x86 emulation, and wowarmhw.dll for switching to ARM32 mode. [3]

Registry and file system

The WoW64 subsystem also handles other key aspects of running 32-bit applications. It is involved in managing the interaction of 32-bit applications with the Windows components such as the Registry, which has distinct keys for 64-bit and 32-bit applications. For example, HKEY_LOCAL_MACHINE\Software\Wow6432Node is the 32-bit equivalent of HKEY_LOCAL_MACHINE\Software (although 32-bit applications are not aware of this redirection). Some Registry keys are mapped from 64-bit to their 32-bit equivalents, while others have their contents mirrored, depending on the edition of Windows.

The operating system uses the %SystemRoot%\system32 directory for its 64-bit library and executable files. This is done for backward compatibility reasons, as many legacy applications are hardcoded to use that path. When executing 32-bit applications, WoW64 transparently redirects access to "system32" (e.g. DLL loads) to %SystemRoot%\SysWoW64, which contains 32-bit libraries and executables. Exceptions from these redirects are: [7]

The redirection helps to keep 32-bit applications working without them needing to be aware of the WoW64 status. [7] If a 32-bit application wants to access the real %SystemRoot%\System32, it can do so through the pseudo-directory %SystemRoot%\sysnative since Windows Vista. [7] Detection of Wow64 status is possible via IsWow64Process().

There are two Program Files directories each visible to both 32-bit and 64-bit applications. The directory that stores the 32 bit files is called Program Files (x86) to differentiate between the two, while the 64 bit maintains the traditional Program Files name without any additional qualifier. File system redirection is not used to maintain the separation; instead, WoW64 changes FOLDERID_ProgramFiles and similar query results to point installer programs to the correct directory. [8]

A few new directories are also found on ARM64, where WOW64 handles not only the running of 32-bit x86 programs, but also 32-bit ARM programs, which uses SysArm32 instead. ARM64 also supports the so-called CHPE "compiled-hybrid-PE", which has ARM64 code in a x86 dll container (for more efficient, emulation-free compatibility); these dlls are found in SyCHPE32. [9]

Application compatibility

32-bit applications that include only 32-bit kernel-mode device drivers, or that plug into the process space of components that are implemented purely as 64-bit processes (e.g. Windows Explorer) cannot be executed on a 64-bit platform.

32-bit service applications are supported. The SysWOW64 folder located in the Windows folder on the OS drive contains several applications to support 32-bit applications (e.g. cmd.exe, odbcad32.exe, to register ODBC connections for 32-bit applications). 16-bit legacy applications for MS-DOS and early versions of Windows are usually incompatible with 64-bit versions of Windows Vista, 7, 8, and 10, but can be run on a 64-bit Windows OS via virtualization software. 32-bit versions of Windows XP, Vista, 7, 8, and 10 on the other hand, can usually run 16-bit applications with few to no problems. 16-bit applications cannot be directly run under x64 editions of Windows, because the CPU does not support VM86 mode when running in x64.

Internet Explorer is implemented as both a 32-bit and a 64-bit application because of the large number of 32-bit ActiveX components on the Internet that would not be able to plug into the 64-bit version.

Previously, the 32-bit version was used by-default and it was difficult to set the 64-bit version to be the default browser. This changed in Internet Explorer 10, which ran 32-bit add-ons inside a 64-bit session, eliminating the need to switch between the two versions. If a user was to go into the 32-bit folder (typically C:\Program Files (x86)\Internet Explorer) and double-click the iexplore.exe file there, the 64-bit version will still load. In Internet Explorer 9 and previous, this would load only the 32-bit version.

As of 2010, a bug in the translation layer of the x64 version of WoW64 [10] [11] also renders all 32-bit applications that rely on the Windows API function GetThreadContext incompatible. Such applications include application debuggers, call stack tracers (e.g. IDEs displaying call stack) and applications that use garbage collection (GC) engines. One of the more widely used but affected [12] GC engines is the Boehm GC. It is also used as the default garbage collector of the equally popular Mono. While Mono has introduced a new (but optional) GC as of October 2010 called SGen-GC, it performs stack scanning in the same manner as Boehm GC, thus also making it incompatible under WoW64. No fix has been provided as of July 2016, although workarounds have been suggested. [13]

Performance

According to Microsoft, 32-bit software running under WOW64 (x64) has similar performance to executing under 32-bit Windows, but with fewer threads possible. On a non-x64 system, WOW64 incurs a performance overhead due to the software emulation involved. [5]

A 32-bit application can be given a full 4 gigabytes of virtual memory on a 64-bit system, whereas on a 32-bit system, some of this addressable memory is lost because it is used by the kernel and memory-mapped peripherals such as the display adaptor, typically resulting in apps being able to use either 2GB or 3GB of RAM at most.

See also

Notes

  1. Specifically: Wine, which is not a Microsoft product, also offers experimental WoW64 in its x64 version. [2] Wine also has wow64.dll, wow64win.dll, and wow64cpu.dll.

Related Research Articles

<span class="mw-page-title-main">Cygwin</span> Unix-like environment for Windows

Cygwin is a Unix-like environment and command-line interface for Microsoft Windows.

The Portable Executable (PE) format is a file format for executables, object code, DLLs and others used in 32-bit and 64-bit versions of Windows operating systems, and in UEFI environments. The PE format is a data structure that encapsulates the information necessary for the Windows OS loader to manage the wrapped executable code. This includes dynamic library references for linking, API export and import tables, resource management data and thread-local storage (TLS) data. On NT operating systems, the PE format is used for EXE, DLL, SYS, MUI and other file types. The Unified Extensible Firmware Interface (UEFI) specification states that PE is the standard executable format in EFI environments.

<span class="mw-page-title-main">Windows API</span> Microsofts core set of application programming interfaces on Windows

The Windows API, informally WinAPI, is the foundational application programming interface (API) that allows a computer program to access the features of the Microsoft Windows operating system in which the program is running.

In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit central processing units (CPU) and arithmetic logic units (ALU) are those that are based on processor registers, address buses, or data buses of that size. A computer that uses such a processor is a 64-bit computer.

x86-64 64-bit version of x86 architecture

x86-64 is a 64-bit version of the x86 instruction set, first announced in 1999. It introduced two new modes of operation, 64-bit mode and compatibility mode, along with a new 4-level paging mode.

<span class="mw-page-title-main">Windows XP Professional x64 Edition</span> Windows XP edition for x86-64 computers released in 2005

Microsoft Windows XP Professional x64 Edition, released on April 25, 2005, is an edition of Windows XP for x86-64 personal computers. It is designed to use the expanded 64-bit memory address space provided by the x86-64 architecture.

<span class="mw-page-title-main">Windows Registry</span> Database for Microsoft Windows

The Windows Registry is a hierarchical database that stores low-level settings for the Microsoft Windows operating system and for applications that opt to use the registry. The kernel, device drivers, services, Security Accounts Manager, and user interfaces can all use the registry. The registry also allows access to counters for profiling system performance.

Virtual DOS machines (VDM) refer to a technology that allows running 16-bit/32-bit DOS and 16-bit Windows programs when there is already another operating system running and controlling the hardware.

In computing, Windows on Windows was a compatibility layer of 32-bit versions of the Windows NT family of operating systems since 1993 with the release of Windows NT 3.1, which extends NTVDM to provide limited support for running legacy 16-bit programs written for Windows 3.x or earlier. There is a similar subsystem, known as WoW64, on 64-bit Windows versions that runs 32-bit programs.

Windows USER is a component of the Microsoft Windows operating system that provides core functionality for building simple user interfaces. The component has existed in all versions of Windows, and includes functionality for window management, message passing, input processing and standard controls.

WinDbg is a multipurpose debugger for the Microsoft Windows computer operating system, distributed by Microsoft. Debugging is the process of finding and resolving errors in a system; in computing it also includes exploring the internal operation of software as a help to development. It can be used to debug user mode applications, device drivers, and the operating system itself in kernel mode.

<span class="mw-page-title-main">DirectX Diagnostic Tool</span> Computer diagnostics tool

DirectX Diagnostic Tool (DxDiag) is a diagnostics tool used to test DirectX functionality and troubleshoot video- or sound-related hardware problems. DirectX Diagnostic can save text files with the scan results. These files are often posted in tech forums or attached to support emails in order to give support personnel a better idea of the PC the requester is using in case the error is due to a hardware failure or incompatibility. It has been bundled with Windows since Windows 98 Second Edition.

On Microsoft Windows, a special folder is a folder that is presented to the user through an interface as an abstract concept instead of an absolute folder path. Special folders make it possible for any application to ask the operating system where an appropriate location for certain kinds of files can be found; independently of which version or user language of Windows is being used.

The Microsoft Windows family of operating systems employ some specific exception handling mechanisms.

Microsoft Windows is the name of several families of computer software operating systems created by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces (GUIs).

Program Files is the directory name of a standard folder in Microsoft Windows operating systems in which applications that are not part of the operating system are conventionally installed. Typically, each application installed under the 'Program Files' directory will have a subdirectory for its application-specific resources. Shared resources, for example resources used by multiple applications from one company, are typically stored in the 'Common Files' directory.

Windows XP, which is the next version of Windows NT after Windows 2000 and the successor to the consumer-oriented Windows Me, has been released in several editions since its original release in 2001.

Windows NT is a proprietary graphical operating system produced by Microsoft as part of its Windows product line, the first version of which was released on July 27, 1993, and it lives on today since the latest version of Windows, 11, includes its technology.

Side-by-side assembly technology is a standard for executable files in Windows 98 Second Edition, Windows 2000, and later versions of Windows that attempts to alleviate problems that arise from the use of dynamic-link libraries (DLLs) in Microsoft Windows. Such problems include version conflicts, missing DLLs, duplicate DLLs, and incorrect or missing registration. In side-by-side, Windows stores multiple versions of a DLL in the %systemroot%\WinSxS directory, and loads them on demand. This reduces dependency problems for applications that include a side-by-side manifest.

Mingw-w64 is a free and open source software development environment to create (cross-compile) Microsoft Windows PE applications. It was forked in 2005–2010 from MinGW.

References

  1. QuinnRadich; DCtheGeek; msatranjr (2020-08-19). "WOW64 Implementation Details". learn.microsoft.com. Archived from the original on 2023-04-16. Retrieved 2023-04-16.
  2. Conway, Adam (2023-01-25). "Wine 8.0 released with better controller compatibility, experimental WoW64 support, and more". XDA Developers. Archived from the original on 2023-04-16. Retrieved 2023-04-16.
  3. 1 2 "WOW64 Implementation Details". Microsoft. Retrieved 2018-04-21.
  4. Eckels, Stephen (November 9, 2020). "WOW64!Hooks: WOW64 Subsystem Internals and Hooking Techniques". Mandiant.
  5. 1 2 "Performance and Memory Consumption Under WOW64". Microsoft. Retrieved 2013-05-06.
  6. "WOW64 Implementation Details (Windows)". 26 April 2010. Archived from the original on 2010-04-26. Earlier version of article, which shows Wow64cpu.dll as part of the IA-64 implementation.
  7. 1 2 3 "File System Redirector (Windows)". msdn.microsoft.com. 2 February 2023.
  8. "winapi - SHGetFolderPath() 32 bit vs 64 bit". Stack Overflow.
  9. Beneš, Petr (November 4, 2018). "WoW64 internals: re-discovering Heaven's Gate on ARM". mindless-area (wbenny.github.io).
  10. Saw, Zach (November 13, 2010). "WOW64 bug: GetThreadContext() may return stale contents". Zach Saw's Blog. Retrieved 2010-11-15.
  11. "WOW64 OS bug: Old 32-bit XP apps failing under Win7 WOW64". Microsoft Developer Network . November 11, 2010. Retrieved 2010-11-15.
  12. "Discussions about the Boehm Garbage Collector (Boehm GC)" . Retrieved 2010-11-25.
  13. "GetThreadContext returns stale register values on WOW64". Microsoft= 2016-07-23. Retrieved 2016-07-23.