2

In this post, I'm talking about native windows applications and DLLs created with C++ and Win32 API.

From the post Can I load a 32 bit DLL into a 64 bit process on Windows? I understand that 64-bit process cannot use 32-bit DLLs directly. One way to get around this is to host the DLL in a 32-bit process and use some form of IPC. This being the case, what is the reason behind this? Why can't 64-bit process use 32-bit DLLs? Could it be the differences between the x86 and x64 instruction sets?

Community
  • 1
  • 1
Coder777
  • 985
  • 2
  • 9
  • 15
  • The question seems not to be duplicate; none of the answers in the "duplicate" question provide an answer for THIS question: The "duplicate" question asks IF it is possible (the answers say "no") while THIS question is about the REASON why! @John: Please ASK YOUR QUESTION AGAIN; your question should contain a reference to the other question (like "the answers of the question 'Can I load a 32 bit DLL...' say that it is not possible. What is the reason for this?") so everyone can see that your question is not exactly the same. – Martin Rosenau Oct 05 '13 at 06:05
  • @Ben Voigt the post you suggested does not answer my question. My question is reason why 64-bit process cannot use 32-bit dll? – Coder777 Oct 05 '13 at 23:21
  • 5
    Well, my comment highlighting the dupe seems to have disappeared. But the *answers* to that other question most certainly answer this one as well. Specifically, click through the [link to the Raymond Chen blog post](http://blogs.msdn.com/oldnewthing/archive/2008/10/20/9006720.aspx) and read it. – Ben Voigt Oct 05 '13 at 23:25

1 Answers1

0

If an address passed to 32-bit code had any bit higher than 32nd set it would be lost due to pointer size mismatch and would most likely result in an AV.

Tanveer Badar
  • 5,438
  • 2
  • 27
  • 32