windows - 为什么在 64 位 Windows 上 64 位 DLL 转到 System32,而 32 位 DLL 转到 SysWoW64?

标签 windows 32bit-64bit wow64 system32 syswow64

我想知道我们什么时候需要将文件放在下面

C:\Windows\System32C:\Windows\SysWOW64,在 64 位 Windows 系统上。

我有两个 DLL,一个用于 32 位,一个用于 64 位。

从逻辑上讲,我认为应该将 32 位 DLL 放在 C:\Windows\System32 下,将 64 位 DLL 放在 C:\Windows\SysWOW64 下。

令我惊讶的是,相反! 32 位 DLL 进入 C:\Windows\SysWOW6464 位 DLL 进入 C:\Windows\System32

非常令人困惑的东西。这背后的原因是什么?

最佳答案

我相信其目的是重命名 System32,但有太多应用程序针对该路径进行了硬编码,因此删除它是不可行的。

SysWoW64 并不是为 64 位系统的 dll 设计的,它实际上类似于“Windows on Windows64”,意思是在 64 位 Windows 上运行 32 位应用程序所需的位。

This article解释一下:

Windows x64 has a directory System32 that contains 64-bit DLLs (sic!). Thus native processes with a bitness of 64 find “their” DLLs where they expect them: in the System32 folder. A second directory, SysWOW64, contains the 32-bit DLLs. The file system redirector does the magic of hiding the real System32 directory for 32-bit processes and showing SysWOW64 under the name of System32.

如果您谈论的是安装程序,您确实不应该硬编码系统文件夹的路径。相反,让 Windows 根据您的安装程序是否在模拟层上运行来为您处理。

关于windows - 为什么在 64 位 Windows 上 64 位 DLL 转到 System32,而 32 位 DLL 转到 SysWoW64?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39558542/

相关文章:

sql-server - Windows 2003 中 JDBC 连接可用的套接字数

c++ - 将旧代码移植到 C++ 中的 64 位

windows - 确定当前进程是否在 WOW64 中运行或不在 Go 中

windows - 如何确定注册表项是否被 WOW64 重定向?

Delphi - 屏幕键盘 (osk.exe) 在 Win32 上工作,但在 Win64 上失败

c++ - 使用 Winsock 读取所有信息时结束 "recv()"循环

windows - 在 Windows 中通过常规文件传输 1-2 兆字节的数据 - 它比通过 RAM 慢吗?

c++ - windows下串口读取的时序

java - 32/64 位 eclipse

windows - 如何在 Win 64 上使用 32 位 JDK 启动 Oracle SQL Developer 4?