Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a 64 bit EXE link against 32-bit DLLs?

I ask because I noticed that many 64 bit EXEs link against what appear to be 32-bit DLLs.

For example, my 64 bit MFC app links against user32.dll, urlmon.dll, wininet.dll - all of which are 32 bit DLLs that reside in windows\system32.

So is this some MS specific wizardry that applies to these DLLs, or is there backward compatability, as it were, for 64 bit EXEs that need to use legacy 32 bit DLLs?

like image 491
Assaf Lavie Avatar asked Jul 12 '09 15:07

Assaf Lavie


1 Answers

You cannot link 64-bit EXEs to 32-bit DLLs or vice versa. On a 64-bit Windows OS, the DLLs in Windows\System32 are actually 64-bit DLLs. The 32-bit versions are in Windows\SysWow64.

like image 74
Curt Hagenlocher Avatar answered Sep 24 '22 01:09

Curt Hagenlocher