gpt4 book ai didi

.net - "The specified procedure could not be found "禁用 wow64 重定向后

转载 作者:可可西里 更新时间:2023-11-01 11:13:52 26 4
gpt4 key购买 nike

我在 x64 系统上运行 32 位应用程序。(windows 7)我正在尝试运行位于 c:\System32\sdclt.exe 的 Windows 备份。因为我作为 32 位进程运行,所以我必须禁用 WOW64 重定向(使用 Wow64DisableWow64FsRedirection)。问题是在禁用 wow64 重定向后我得到“找不到指定的过程”错误。

我的猜测是,当禁用重定向时,sdclt.exe 无法加载其所有依赖的 dll。

注意事项:1. 只有在我没有以提升的权限运行时才会发生这种情况。2. 我将“使用 shell 执行”设置为 true,因为我想让用户在没有提升权限的情况下使用我的应用程序。2.编译成64位时不会出现这个错误。

最佳答案

禁用文件重定向是一项不稳定的工作。您在此处执行此操作是为了让您的 32 位进程能够看到位于 system32 中的文件。通常,从 32 位进程对该文件夹的任何引用都将重定向到 SysWOW64。但是,正如您发现的那样,禁用文件重定向会破坏链中的其他链接。

据我所知,最好的解决方案是使用特殊的 %windir%\sysnative 别名来定位真正的 system32 目录。不要禁用文件重定向并在生成进程时简单地传递 %windir%\sysnative\sdclt.exe

documentation对于文件重定向说:

32-bit applications can access the native system directory by substituting %windir%\Sysnative for %windir%\System32. WOW64 recognizes Sysnative as a special alias used to indicate that the file system should not redirect the access. This mechanism is flexible and easy to use, therefore, it is the recommended mechanism to bypass file system redirection. Note that 64-bit applications cannot use the Sysnative alias as it is a virtual directory not a real one.

Windows Server 2003 and Windows XP: The Sysnative alias was added starting with Windows Vista.

最后的警告实际上意味着 %windir%\Sysnative 在 XP64 上无法识别,除非机器已经使用支持 %windir%\Sysnative< 的 MS 修补程序进行了维修 到那个操作系统。实际上这无关紧要,因为 XP64 的安装基数非常小。

据我所知,唯一的其他解决方案是创建您自己的 64 位进程专用启动器。如果将该启动器放置在不受文件重定向影响的文件夹中,那么您可以从 32 位进程调用该启动器,然后启动器能够看到 64 位系统目录。如果您需要支持 XP64,我认为您将不得不使用这种方法。

关于.net - "The specified procedure could not be found "禁用 wow64 重定向后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9466850/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com