我想知道我们什么时候需要将文件放在下面
C:\Windows\System32
或 C:\Windows\SysWOW64
,在 64 位 Windows 系统上。
我有两个 DLL,一个用于 32 位,一个用于 64 位。
从逻辑上讲,我认为应该将 32 位 DLL 放在 C:\Windows\System32 下,将 64 位 DLL 放在 C:\Windows\SysWOW64 下。
令我惊讶的是,相反! 32 位 DLL 进入 C:\Windows\SysWOW64,64 位 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/