Enables or disables file system redirection for the calling thread.
This function may not work reliably when there are nested calls. Therefore, this function has been replaced by
the Wow64DisableWow64FsRedirection and
Wow64RevertWow64FsRedirection
functions.
Syntax
BOOLEAN WINAPI Wow64EnableWow64FsRedirection(
__in BOOLEAN Wow64FsEnableRedirection
);
Parameters
- Wow64FsEnableRedirection [in]
-
Indicates whether WOW64 system folder redirection is enabled. If
TRUE, it is enabled; if FALSE, it is disabled.
Return Value
Boolean value indicating whether the function succeeded. If TRUE, the function
succeeded; if FALSE, the function failed.
Remarks
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.
File redirection is only enabled for the thread calling this function.
Note that you must enable file system redirection after disabling it. After you have a file handle, re-enable
file system redirection, as in the example code below.
To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0501 or later. For more
information, see Using the Windows
Headers.
Examples
#define _WIN32_WINNT 0x0501
#include <Windows.h>
void main()
{
BOOLEAN bRet = Wow64EnableWow64FsRedirection(FALSE);
if (bRet)
{
// Open the file handle
CreateFile("c:\\windows\\system32\\notepad.exe",
GENERIC_EXECUTE,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
// Enable WOW64 file system redirection.
Wow64EnableWow64FsRedirection(TRUE);
}
}
Requirements
| Minimum supported client | Windows Vista |
| Minimum supported server | Windows Server 2003 |
| Header | WinBase.h (include Windows.h) |
| Library | Kernel32.lib |
| DLL | Kernel32.dll |
See Also
- File Management Functions
- File System Redirector
- GetSystemWow64Directory
- Wow64DisableWow64FsRedirection
- Wow64RevertWow64FsRedirection
Send comments about this topic to Microsoft
Build date: 7/9/2009