6

I was sure 64bit DLL cannot link to 32bit DLL.

Marnix van Valen
  • 13,265
  • 4
  • 47
  • 74
pavelkolodin
  • 2,859
  • 3
  • 31
  • 74
  • 1
    IIRC this has to do with the virtual mapping shenanigans Windows does in newer versions. One DLL path can result in dozens of different versions depending on who's asking. – Pekka Feb 08 '12 at 11:49
  • 1
    A DLL is linked to kernel32.lib, not kernel32.dll. The actual DLL that gets loaded at runtime is another story, told by Sophia. – Hans Passant Feb 08 '12 at 13:11

1 Answers1

8

Wow64 has a file redirector. It has the same named dlls but are stored in the appropriate location. The concept is explained at http://msdn.microsoft.com/en-us/library/aa384187(v=vs.85).aspx

The %windir%\System32 directory is reserved for 64-bit applications. Most DLL file names were not changed when 64-bit versions of the DLLs were created, so 32-bit versions of the DLLs are stored in a different directory. WOW64 hides this difference using a file system redirector.

In most cases, whenever a 32-bit application attempts to access %windir%\System32, the access is redirected to %windir%\SysWOW64. Access to %windir%\lastgood\system32 is redirected to %windir%\lastgood\SysWOW64. Access to %windir%\regedit.exe is redirected to %windir%\SysWOW64\regedit.exe.

Sania Programmer
  • 264
  • 4
  • 13