[英]Win32 32-bit process loads 64-bit kernel32.dll
I am experiencing that 32-bit Win32 console applications are loading the 64-bit version of kernel32.dll on one specific machine which is running Windows Server 2012 R2 Standard. 我遇到32位Win32控制台应用程序正在一台运行Windows Server 2012 R2 Standard的特定计算机上加载64位版本的kernel32.dll。
Using Dependency Walker with a simple HelloWorld application it looks like this: 使用Dependency Walker和一个简单的HelloWorld应用程序,它看起来像这样:
It correctly loads the 32-bit kernel32 on other machines. 它在其他机器上正确加载32位kernel32。
The value of PATH
seems to be if not identical so at least including the relevant paths in exactly the same order on the different machines. PATH
的值似乎不相同,因此至少包括不同机器上完全相同顺序的相关路径。
According to this page from Microsoft, the search order for DLLs is: 根据Microsoft的这个页面 ,DLL的搜索顺序是:
GetSystemDirectory
function retrieves the path of this directory. GetSystemDirectory
函数检索此目录的路径。 GetWindowsDirectory
function retrieves the path of this directory. GetWindowsDirectory
函数检索此目录的路径。 PATH
environment variable. PATH
环境变量中列出的目录。 I am guessing that on this specific machine GetSystemDirectory
returns the path to Windows/system32
instead of Windows/SysWOW64
or that the mapping from system32
to SysWOW64
for 32-bit processes are not working properly but these are only qualified guesses. 我猜测在这个特定的机器上
GetSystemDirectory
返回Windows/system32
而不是Windows/SysWOW64
的路径,或者从32位进程的system32
到SysWOW64
的映射不能正常工作,但这些只是合格的猜测。
Any idea what is causing this behaviour? 知道造成这种行为的原因是什么吗?
Dependency Walker is reporting the dependencies incorrectly. Dependency Walker错误地报告了依赖关系。 Its static analysis sometimes gets confused between 32 and 64 bit modules.
它的静态分析有时会在32位和64位模块之间混淆。 Typically this is when you run a 64 bit version of Dependency Walker against a 32 bit target executable, or vice versa.
通常,这是针对32位目标可执行文件运行64位版本的Dependency Walker,反之亦然。
Rest assured that your 32 bit program is loading the 32 bit version of kernel32. 请放心,您的32位程序正在加载32位版本的kernel32。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.