为什么 64 位 DLL 在 64 位 Windows 上转到 System32 而 32 位 DLL 转到 SysWoW64? [英] Why do 64-bit DLLs go to System32 and 32-bit DLLs to SysWoW64 on 64-bit Windows?

查看:38
本文介绍了为什么 64 位 DLL 在 64 位 Windows 上转到 System32 而 32 位 DLL 转到 SysWoW64?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我们什么时候需要在

I would like to know when do we need to place a file under

C:WindowsSystem32 或 C:WindowsSysWOW64,在 64 位 Windows 系统上.

C:WindowsSystem32 or C:WindowsSysWOW64, 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:WindowsSystem32 下,将 64 位 DLL 放在 C:WindowsSysWOW64 下.

Logically, I thought I'd place the 32-bit DLL under C:WindowsSystem32, and the 64-bit DLL under C:WindowsSysWOW64.

令我惊讶的是,它相反32位DLL进入C:WindowsSysWOW6464位DLL进入C:WindowsSystem32.

To my surprise, it's the other way around! The 32-bit one goes into C:WindowsSysWOW64, and the 64-bit DLL goes into C:WindowsSystem32.

非常混乱的东西.这背后的原因是什么?

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 64 上的 Windows",意思是在 64 位 Windows 上运行 32 位应用程序所需的位.

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 位 DLL(原文如此!).因此,位数为 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 really should 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆