术语 | wow64enablewow64fsredirection |
释义 | Wow64EnableWow64FsRedirection 语法: C++ BOOLEAN WINAPI Wow64EnableWow64FsRedirection( __in BOOLEAN Wow64FsEnableRedirection ); Wow64EnableWow64FsRedirection功能 启用或禁用文件调用线程的系统重定向。 此功能可能无法可靠地工作时,有嵌套调用。因此,该功能已被取代Wow64DisableWow64FsRedirection和Wow64RevertWow64FsRedirection功能。 注意控制文件系统重定向这两种方法结合起来,不能以任何方式。不要使用Wow64EnableWow64FsRedirection功能,或者是Wow64DisableWow64FsRedirection或Wow64RevertWow64FsRedirection功能。 参数 Wow64FsEnableRedirection [in] 指示是否WOW64的系统文件夹重定向是启用。如果是TRUE,请它被启用,如果假,请求被禁用。 返回值 布尔值指示是否成功的功能。如果是TRUE,该函数成功,如果是FALSE,函数失败。 备注 要编译的应用程序使用此函数,定义为0x0501或更高_WIN32_WINNT宏。有关详细信息,请参阅使用Windows头。 此功能可用于32位应用程序想要进入本地system32目录。默认情况下,WOW64的文件系统启用重定向。 注意Wow64EnableWow64FsRedirection功能影响的所有文件的当前线程,它可以产生意想不到的后果,如果文件系统重定向,任何时间的长短残疾人执行的操作。例如,DLL加载依赖于文件系统重定向,使禁用文件系统重定向将导致DLL加载失败。此外,许多组件实现使用延迟加载和会失败,而被禁用重定向。初始延迟失效状态,是坚持负荷运转,所以任何使用后迅速负荷函数将失败,即使文件系统重定向后重新启用。为了避免这些问题,禁用文件系统重定向之前要求特定的文件I / O功能(如CreateFile),绝不能重定向,并重新启用文件系统重定向随即使用Wow64EnableWow64FsRedirection(真)。 文件重定向启用或只调用这个函数的线程禁用。这会影响到当前线程只操作。如CreateProcessAsUser一些职能,做另一个线程,它不是由文件系统重定向状况的影响在调用线程的工作。 实例 #define _WIN32_WINNT 0x0501 #include void main() { BOOLEAN bRet = FALSE; HANDLE hFile = INVALID_HANDLE_VALUE; // Disable redirection bRet = Wow64EnableWow64FsRedirection(FALSE); if( bRet ) { // Open a file hFile = CreateFile(TEXT("C:\\\\Windows\\\\System32\\\\Notepad.exe"), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); // Immediately re-enable redirection. Wow64EnableWow64FsRedirection(TRUE); } // The handle, if valid, can be used as usual without // leaving redirection disabled. if( INVALID_HANDLE_VALUE != hFile ) { // Use the file handle } } 要求: client最低支持Vista 最低支持serverWindows服务器2003 HeaderWinBase.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll 参见 文件管理函数 文件系统重定向器 GetSystemWow64Directory Wow64DisableWow64FsRedirection Wow64RevertWow64FsRedirection 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年9月3日 ==英文原文==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. Note These two methods of controlling file system redirection cannot be combined in any way. Do not use the Wow64EnableWow64FsRedirection function with either the Wow64DisableWow64FsRedirection or the Wow64RevertWow64FsRedirection function. Syntax C++ BOOLEAN WINAPI Wow64EnableWow64FsRedirection( __in BOOLEAN Wow64FsEnableRedirection ); Parameters Wow64FsEnableRedirection [in] Indicates whether WOW64 system folder redirection is enabled. If TRUE, requests it to be enabled; if FALSE, it is requested to be disabled. Return Value Boolean value indicating whether the function succeeded. If TRUE, the function succeeded; if FALSE, the function failed. Remarks 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 . 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. Note The Wow64EnableWow64FsRedirection 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 component 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 Wow64EnableWow64FsRedirection(TRUE). 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. Examples #define _WIN32_WINNT 0x0501 #include void main() { BOOLEAN bRet = FALSE; HANDLE hFile = INVALID_HANDLE_VALUE; // Disable redirection bRet = Wow64EnableWow64FsRedirection(FALSE); if( bRet ) { // Open a file hFile = CreateFile(TEXT("C:\\\\Windows\\\\System32\\\\Notepad.exe"), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); // Immediately re-enable redirection. Wow64EnableWow64FsRedirection(TRUE); } // The handle, if valid, can be used as usual without // leaving redirection disabled. if( INVALID_HANDLE_VALUE != hFile ) { // Use the file handle } } 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: 9/3/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/aa365744(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。