使用64位regsvr32注册32位DLL [英] Registering a 32 bit DLL with 64 bit regsvr32
问题描述
考虑以下理解
- 32位进程无法加载64位dll,反之亦然。
- 注册/取消注册DLL
regsvr32
调用入口点DllRegisterServer
/DllUnregisterServer通过
。LoadLIbrary
将目标DLL加载到其地址空间后 - 在64位系统上,32位于
C:\Windows \SysWOW64
- A 32 bit Process cannot load a 64 bit dll or vice versa.
- For registering/unregistering a DLL
regsvr32
calls the entry pointDllRegisterServer
/DllUnregisterServer
after loading the target DLL into its address space throughLoadLIbrary
. - On a 64 bit System, 32 bit version of regsvr32 is present in
C:\Windows\SysWOW64
>但是在我的2008 R2 Box,我能够注册一个32位的DLL由64位regsvr32。这是怎么可能的?
But then on my 2008 R2 Box, I was able to register a 32 bit dll by the 64 bit regsvr32. How was that possible? Am I missing something?
推荐答案
这应该说明它是如何发生的:
This should explain how it happens exactly:
regsvr32
会启动它的另一个bitness双内部匹配DLL的位数。这是注册成功。您不需要关心是否启动32位或64位版本的 regsvr32
,因为它会处理不匹配。
regsvr32
will start it's another bitness twin internally to match the bitness of the DLL. This is how registration succeeds. You don't need to care whether you start 32-bit or 64-bit version of regsvr32
because it will take care of mismatch.
当你需要关心的场景是当你从Visual Studio中启动 regsvr32
作为调试主机。你想要正确的位数在那里,因为子进程与实际注册将运行调试器之外,你将无法通过代码通过。
The scenario when you need to care is when you start regsvr32
from Visual Studio as debugging host. You want correct bitness there, because child process with actual registration will run outside of debugger and you won't be able to step your code through.
这篇关于使用64位regsvr32注册32位DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!