问题描述
我想知道我们什么时候需要在
I would like to know when do we need to place a file under
C:\Windows\System32或C:\Windows\SysWOW64下放置一个文件,在64位Windows系统上。
C:\Windows\System32 or C:\Windows\SysWOW64, on a 64-bits windows system.
我有两个DLL,一个用于32位,一个用于64位。
I had two DLL's, one for 32-bit, one for 64-bit.
逻辑上,我以为我会将32位DLL放在C:\Windows\System32下,64位DLL在C:\Windows\SYSWOW64下。
Logically, I thought I'd place the 32-bit DLL under C:\Windows\System32, and the 64-bit DLL under C:\Windows\SysWOW64.
令我惊讶的是, 32 - 位进入C:\Windows\SysWOW 64 ,而 64 位DLL进入C:\ Windows \System 32 。
To my surprise, it's the other way around! The 32-bit one goes into C:\Windows\SysWOW64, and the 64-bit DLL goes into C:\Windows\System32.
非常混乱的东西。这是什么原因?
Very confusing stuff. What's the reason behind this?
推荐答案
我相信这个意图是重命名System32,但是这么多应用程序是硬编码的,删除它是不可行的。
I believe the intent was to rename System32, but so many applications hard-coded for that path, that it wasn't feasible to remove it.
SysWoW64不适用于64位系统的DLL,它实际上就像Windows Windows上的Windows,这意味着您需要运行32位应用程序64位窗口。
SysWoW64 wasn't intended for the dlls of 64-bit systems, it's actually something like "Windows on Windows64", meaning the bits you need to run 32bit apps on a 64bit windows.
解释了一点:
Windows x64有一个目录System32,其中包含64因此,64位的本地进程会发现他们的DLL,他们期望它们在System32文件夹中:第二个目录SysWOW64包含32位DLL,文件系统重定向器隐藏真正的32位进程的System32目录,并以System32的名称显示SysWOW64。
"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根据您的安装程序是否在仿真层上运行,为您而设。
If you're talking about an installer, you should really not hard-code the path to the system folder. Instead, let Windows take care of it for you based on whether or not your installer is running on the emulation layer.
这篇关于为什么64位DLL在64位Windows上可以转到System32和32位DLL到SysWoW64?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!