开启和关闭WOW64进程的重定位

·

用于在64位系统中的32位进程访问64位的系统目录和注册表

//
BOOLEAN EnableWow64FsRedirection(BOOLEAN Wow64FsEnableRedirection)
{
	typedef BOOLEAN (WINAPI *_Wow64EnableWow64FsRedirection)(
		_In_ BOOLEAN Wow64FsEnableRedirection
	);

	_Wow64EnableWow64FsRedirection fpWow64EnableWow64FsRedirection = (_Wow64EnableWow64FsRedirection)GetProcAddress(GetModuleHandleA("Kernel32.dll"), "Wow64EnableWow64FsRedirection");
	if (fpWow64EnableWow64FsRedirection)
	{
		return fpWow64EnableWow64FsRedirection(Wow64FsEnableRedirection);
	}
	return FALSE;
}

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注