windows64位操作系统重定向问题

64位操作系统运行32程序时,操作系统会启用重定向功能.

系统会把system32文件夹重定向到Syswow64等等。

WOW64 (Windows-on-Windows 64-bit)是一个Windows操作系统的子系统, 它为现有的 32 位应用程序提供了 32 位的模拟,可以使大多数 32 位应用程序在无需修改的情况下运行在 Windows 64 位版本上。

这人功能是可以关闭的.微软提供:

Wow64EnableWow64FsRedirection
Wow64DisableWow64FsRedirection
Wow64RevertWow64FsRedirection

例:

PVOID OldValue = NULL;
if( Wow64DisableWow64FsRedirection(&OldValue) ) 
{
    //  Any function calls in this block of code should be as concise
	//  and as simple as possible to avoid unintended results.

	CopyFile(_T(".\\npf.sys"),_T("C:\\Windows\\System32\\drivers\\npf.sys"),false); 
	//CopyFile(_T(".\\npf.sys"),_T("D:\\npf.sys"),false); 
	//  Immediately re-enable redirection. Note that any resources
	//  associated with OldValue are cleaned up by this call.
	if ( FALSE == Wow64RevertWow64FsRedirection(OldValue) )
	{
		//  Failure to re-enable redirection should be considered
		//  a criticial failure and execution aborted.
		;
	}
}

猜你喜欢

转载自blog.csdn.net/xuq09/article/details/82769195
今日推荐