Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
File Services
File Systems
File Management
 Wow64EnableWow64FsRedirection Funct...

  Switch on low bandwidth view
Wow64EnableWow64FsRedirection Function

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

C++
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 clientWindows Vista
Minimum supported serverWindows Server 2003
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll

See Also

File Management Functions
File System Redirector
GetSystemWow64Directory
Wow64DisableWow64FsRedirection
Wow64RevertWow64FsRedirection

Send comments about this topic to Microsoft

Build date: 7/9/2009

Tags What's this?: 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