程序是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;
}
}