Indicates the type of request for WOW64 system folder redirection. If
TRUE, requests redirection be enabled; if FALSE, requests
redirection be disabled.
Boolean value indicating whether the function succeeded. If TRUE, the function
succeeded; if FALSE, the function failed.
This function is useful for 32-bit applications that want to gain access to the native system32 directory. By
default, WOW64 file system redirection is enabled.
function affects all file operations performed by the current thread, which can have unintended consequences if
file system redirection is disabled for any length of time. For example, DLL loading depends on file system
redirection, so disabling file system redirection will cause DLL loading to fail. Also, many feature
implementations use delayed loading and will fail while redirection is disabled. The failure state of the initial
delay-load operation is persisted, so any subsequent use of the delay-load function will fail even after file
system redirection is re-enabled. To avoid these problems, disable file system redirection immediately before
calls to specific file I/O functions (such as CreateFile)
that must not be redirected, and re-enable file system redirection immediately afterward using
File redirection is enabled or disabled only for the thread calling this function. This affects only
operations made by the current thread. Some functions, such as
CreateProcessAsUser, do their work on another
thread, which is not affected by the state of file system redirection in the calling thread.
In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
// Disable redirection immediately prior to the native API
// function call.
if( Wow64EnableWow64FsRedirection(FALSE) )
// Any function calls in this block of code should be as concise
// and as simple as possible to avoid unintended results.
hFile = CreateFile(TEXT("C:\Windows\System32\Notepad.exe"),
// Immediately re-enable redirection. Note that any resources
// associated with OldValue are cleaned up by this call.
if ( FALSE == Wow64EnableWow64FsRedirection(TRUE) )
// Failure to re-enable redirection should be considered
// a criticial failure and execution aborted.
// The handle, if valid, can be used as usual without
// leaving redirection disabled.
if( INVALID_HANDLE_VALUE != hFile )
// Use the file handle
Windows Vista [desktop apps only] Windows Server 2003 [desktop apps only]
The feedback system for this content will be changing soon. Old comments will not be carried over. If content within a comment thread is important to you, please save a copy. For more information on the upcoming change, we invite you to read our blog post.