27

I was looking at some libraries with dumpbin and I noticed that all the 64-bit versions were linked to KERNEL32. Is there no KERNEL64 on 64-bit Windows? If not, why?

All my operating systems are 32-bit so I can't just look. A google search brings up nothing worthwhile so I suspect that there is no KERNEL64 but I'm still curious as to why this is.

EDIT: I found this later which is pretty useful. MSDN guide to x64

Dana Robinson
  • 4,304
  • 8
  • 33
  • 41

2 Answers2

31

It's always called kernel32.dll, even on 64-bit windows. This is for the same compatibility reasons that system32 contains 64-bit binaries, while syswow64 contains 32-bit binaries.

Ben Straub
  • 5,675
  • 3
  • 28
  • 43
  • 8
    *What* compatibility reasons? – Martin Ba Nov 10 '10 at 11:44
  • 2
    @Martin Here's a great answer: http://stackoverflow.com/questions/949959/why-do-64bit-dlls-go-to-system32-and-32bit-dlls-to-syswow64-on-64bit-windows – Ben Straub Nov 17 '10 at 19:29
  • Pretty sure its to keep code like this working in 16bit, 32bit and 64 bit modes without changing code: `((BOOL (WINAPI *)(DWORD, DWORD))GetProcAddress(GetModuleHandle("kernel32"), "Beep"))(1000, 300);`. Pretty sure if Microsoft was to go back in time, they'd just name it Kernel.dll, goes to show the cost of changing an interface after publication. – Dmytro Sep 08 '17 at 17:19
5

On the 64-bit versions of Windows one of the "kernel32.dll"s contains 64-bit code but is still called kernel32.dll. This is at least misleading

Hope the following links will give the solution for this

http://www.howzatt.demon.co.uk/articles/DebuggingInWin64.html

http://www.viva64.com/en/l/0002/

http://blogs.msdn.com/b/aaron_margosis/archive/2012/12/10/using-ntfs-junctions-to-fix-application-compatibility-issues-on-64-bit-editions-of-windows.aspx

64-bit Windows provides such an environment "out of the box" and supports 32-bit applications using the 'Windows on Windows 64' subsystem, abbreviated to WOW64, which runs in user mode and maps the 32-bit calls to the operating system kernel into an equivalent 64-bit call. This is normally almost invisible to the calling program.Windows provides a set of 64-bit DLLs in %windir%\system32 and an equivalent set of 32-bit DLLs in %windir%\syswow64. In fact the bulk of the binary images in this directory are identical to the same files in the system32 directory on a 32-bit Windows installation. (It seems to me an unfortunate naming issue that the 64-bit DLLs live in system32 and the 32-bit ones live in syswow64, but there it is)

Padma Yeddula
  • 167
  • 2
  • 14