Click to Rate and Give Feedback
MSDN
MSDN Library
Development Guides
 File System Redirector

  Switch on low bandwidth view
File System Redirector

The %windir%\System32 directory is reserved for 64-bit applications. Most DLL file names were not changed when porting to 64-bit, so 32-bit applications must use a different directory as their System32 directory. WOW64 hides this difference using a file system redirector.

Whenever a 32-bit application attempts to access %windir%\System32, the access is redirected to a new directory, %windir%\SysWOW64. Access to %windir%\lastgood\system32 is redirected to %windir%\lastgood\SysWOW64. Access to %windir%\regedit.exe is redirected to %windir%\SysWOW64\regedit.exe.

To retrieve the name of the 32-bit system directory, 64-bit applications should use the GetSystemWow64Directory function.

Certain subdirectories are exempt from redirection. Access to these subdirectories is not redirected to %windir%\SysWOW64:

%windir%\system32\catroot
%windir%\system32\catroot2
%windir%\system32\driversstore
%windir%\system32\drivers\etc
%windir%\system32\logfiles
%windir%\system32\spool
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP:  %windir%\system32\driversstore is redirected.

Applications should use the SHGetSpecialFolderPath function to determine the %ProgramFiles% directory name.

Applications can control the WOW64 file system redirector using the Wow64DisableWow64FsRedirection, Wow64EnableWow64FsRedirection, and Wow64RevertWow64FsRedirection functions. For best results, if it is necessary to disable file system redirection, you should disable it for a single CreateFile call and enable it again immediately after the function returns. Disabling file system redirection for longer periods can prevent 32-bit applications from loading system DLLs, causing the applications to fail.

32-bit applications can access the native system directory by substituting %windir%\Sysnative for %windir%\System32. WOW64 recognizes Sysnative as a special alias used to indicate that the file system should not redirect the access. This mechanism is flexible and easy to use, therefore, it is the recommended mechanism to bypass file system redirection. Note that 64-bit applications cannot use the Sysnative alias as it is a virtual directory not a real one.

Windows Server 2003 and Windows XP:  The Sysnative alias was added starting with Windows Vista.

Send comments about this topic to Microsoft

Build date: 7/2/2009

Tags What's this?: 32 (x) accessing (x) files (x) from (x) windows (x) x64 (x) Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker