网站首页  词典首页

请输入您要查询的函数:

 

术语 wow64disablewow64fsredirection
释义 Wow64DisableWow64FsRedirection
语法:
C++
BOOL WINAPI Wow64DisableWow64FsRedirection(
__out PVOID *OldValue
);
Wow64DisableWow64FsRedirection功能
禁用文件调用线程的系统重定向。文件系统重定向默认情况下启用。
参数
OldValue [out]
在WOW64文件系统重定向价值。该系统使用此参数来存储信息必须回复(重新启用)文件系统重定向。
注意此值只对系统使用。为了避免不可预知的行为,不要以任何方式修改此值。
返回值
如果函数成功,返回值是一个非零值。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
要编译的应用程序使用此函数,定义为0x0501或更高_WIN32_WINNT宏。有关详细信息,请参阅使用Windows头。
此功能可用于32位应用程序想要进入本地system32目录。默认情况下,WOW64的文件系统启用重定向。
The Wow64DisableWow64FsRedirection/ Wow64RevertWow64FsRedirection function pairing is a replacement for the functionality of the Wow64EnableWow64FsRedirection function.
要还原文件系统重定向,调用Wow64RevertWow64FsRedirection功能。每到Wow64DisableWow64FsRedirection函数调用必须有一个函数的Wow64RevertWow64FsRedirection匹配调用。这将确保重定向被重新启用,并释放相关的系统资源。
注意Wow64DisableWow64FsRedirection功能影响的所有文件的当前线程,它可以产生意想不到的后果,如果文件系统重定向,任何时间的长短残疾人执行的操作。例如,DLL加载依赖于文件系统重定向,使禁用文件系统重定向将导致DLL加载失败。此外,许多组件实现使用延迟加载和会失败,而被禁用重定向。初始延迟失效状态,是坚持负荷运转,所以任何使用后迅速负荷函数将失败,即使文件系统重定向后重新启用。为了避免这些问题,禁用文件系统重定向之前要求特定的文件I / O功能(如CreateFile),绝不能重定向,并重新启用文件系统重定向之后立即使用Wow64RevertWow64FsRedirection。
禁用文件系统重定向影响当前线程只操作。如CreateProcessAsUser一些职能,做另一个线程,它不是由文件系统重定向状况的影响在调用线程的工作。
实例
下面的示例使用Wow64DisableWow64FsRedirection禁用文件系统重定向,使32位应用程序,在WOW64下运行可以打开64位Notepad.exe的版本在%SystemRoot%\\而不是被重定向到32位版本在System32的%SystemRoot%\\ Syswow64资料。
#define _WIN32_WINNT 0x0501
#include
void main()
{
BOOLEAN bRet = FALSE;
HANDLE hFile = INVALID_HANDLE_VALUE;
PVOID OldValue = NULL;
// Disable redirection

bRet = Wow64DisableWow64FsRedirection (&OldValue);
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. Also, any data storage
// associated with OldValue is cleaned up by this call.
Wow64RevertWow64FsRedirection (OldValue);
}

// The handle, if valid, can be used as usual without
// leaving redirection disabled.

if( INVALID_HANDLE_VALUE != hFile )
{
// Use the file handle
}
}

要求:
最低支持clientWindows Vista中,Windows XP Professional x64版本
最低支持serverWindows Server 2008中时,Windows Server 2003 SP1的
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
文件管理函数
文件系统重定向器
Wow64EnableWow64FsRedirection
Wow64RevertWow64FsRedirection
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==Wow64DisableWow64FsRedirection Function
Disables file system redirection for the calling thread. File system redirection is enabled by default.
Syntax
C++
BOOL WINAPI Wow64DisableWow64FsRedirection(
__out PVOID *OldValue
);
Parameters
OldValue [out]
The WOW64 file system redirection value. The system uses this parameter to store information necessary to revert (re-enable) file system redirection.
Note This value is for system use only. To avoid unpredictable behavior, do not modify this value in any way.
Return Value
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
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.
The Wow64DisableWow64FsRedirection/ Wow64RevertWow64FsRedirection function pairing is a replacement for the functionality of the Wow64EnableWow64FsRedirection function.
To restore file system redirection, call the Wow64RevertWow64FsRedirection function. Every call to the Wow64DisableWow64FsRedirection function must have a matching call to the Wow64RevertWow64FsRedirection function. This will ensure redirection is re-enabled and frees associated system resources.
Note The Wow64DisableWow64FsRedirection 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 Wow64RevertWow64FsRedirection.
Disabling file system redirection 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
The following example uses Wow64DisableWow64FsRedirection to disable file system redirection so that a 32-bit application that is running under WOW64 can open the 64-bit version of Notepad.exe in %SystemRoot%\\System32 instead of being redirected to the 32-bit version in %SystemRoot%\\SysWOW64.
#define _WIN32_WINNT 0x0501
#include
void main()
{
BOOLEAN bRet = FALSE;
HANDLE hFile = INVALID_HANDLE_VALUE;
PVOID OldValue = NULL;
// Disable redirection

bRet = Wow64DisableWow64FsRedirection (&OldValue);
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. Also, any data storage
// associated with OldValue is cleaned up by this call.
Wow64RevertWow64FsRedirection (OldValue);
}

// 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, Windows XP Professional x64 Edition
Minimum supported serverWindows Server 2008, Windows Server 2003 with SP1
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
File Management Functions
File System Redirector
Wow64EnableWow64FsRedirection
Wow64RevertWow64FsRedirection
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa365743(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:22:32