程序是32位的,在64位系统下,所有对system32的操作都会被转向syswow64
Wow64EnableWow64FsRedirection function
方法一
程序编译成x64位
方法二
关闭重定向
if( Wow64EnableWow64FsRedirection(FALSE) )
{
// Any function calls in this block of code should be as concise
// and as simple as possible to avoid unintended results.
CopyFile(_T("CherryTrail\\AP6212\\x64\\43430r0nvram.txt"), _T("C:\\Windows\\System32\\drivers\\43430r0nvram.txt"), FALSE);
// Immediately re-enable redirection. Note that any resources
// associated with OldValue are cleaned up by this call.
if ( FALSE == Wow64EnableWow64FsRedirection(TRUE) )
{
// Failure to re-enable redirection should be considered
// a criticial failure and execution aborted.
return;
}
}
本文介绍在64位系统中32位程序如何通过关闭Wow64FsRedirection来实现对system32目录的直接操作,避免文件重定向到syswow64,并提供了一个具体的代码示例。
3万+

被折叠的 条评论
为什么被折叠?



