Answered by:
Loading a 32bit DLL into a 64bit application.

Question
-
Is there a way to load a 32bit DLL into a 64bit application?
Can I use some WOW64 API for this? Is there any other way?
thanks :)Friday, January 27, 2012 7:37 PM
Answers
-
>Is there a way to load a 32bit DLL into a 64bit application?
>Can I use some WOW64 API for this?
See:
Everything You Need To Know To Start Programming
64-Bit Windows Systems
http://msdn.microsoft.com/en-us/magazine/cc300794.aspx
Quote:
"While running a fully 64-bit Windows system sounds great,
the reality is that you'll very likely need to run Win32
code for a while. Towards that end, x64 versions of Windows
include the WOW64 subsystem that lets Win32 and Win64
processes run side-by-side on the same system. However,
loading your 32-bit DLL into a 64-bit process, or vice
versa, isn't supported."
For the ugly details, see:
Why can't you thunk between 32-bit and 64-bit Windows?
http://blogs.msdn.com/b/oldnewthing/archive/2008/10/20/9006720.aspx
- Wayne- Marked as answer by Number 2 Monday, January 30, 2012 5:16 PM
Saturday, January 28, 2012 10:56 PM
All replies
-
No way to execute 32-bit DLL code inside a 64-bit proces.
Jose R. MCPFriday, January 27, 2012 7:39 PM -
For various reasons, mainly to do with the differences in pointer sizes, there is no way to load a 32bit DLL into a 64bit process, and vice versa.
The best thing you can do is to load the 32bit DLL in it's own container process and use some form of interprocess communication to do the work.
This is a signature
Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.Friday, January 27, 2012 7:49 PM -
And why you want to do this. Any particular reason . If you let us know what are you trying to do here . Will glad o help you.
Thanks
Rupesh ShuklaFriday, January 27, 2012 9:58 PM -
I agree with Crescens2k.
Several years back I did this using COM, you can also use COM to achieve this. In my case it was third party library, available only for 32 bit that forced me to do.
Saturday, January 28, 2012 7:43 AM -
And why you want to do this. Any particular reason . If you let us know what are you trying to do here . Will glad o help you.
Thanks
Rupesh Shukla
- Edited by Number 2 Saturday, January 28, 2012 9:35 AM
Saturday, January 28, 2012 9:35 AM -
I'm writing a little debugger for .Net application, but ICordebug can debug only applications of the same platform (x64 ICordebug can debug only x64 applications, and x86 ICordebug only x86)
Then you will have to have two versions for your debugger, one for x86 programs, and one for x64 applications.
Saturday, January 28, 2012 5:36 PM -
>Is there a way to load a 32bit DLL into a 64bit application?
>Can I use some WOW64 API for this?
See:
Everything You Need To Know To Start Programming
64-Bit Windows Systems
http://msdn.microsoft.com/en-us/magazine/cc300794.aspx
Quote:
"While running a fully 64-bit Windows system sounds great,
the reality is that you'll very likely need to run Win32
code for a while. Towards that end, x64 versions of Windows
include the WOW64 subsystem that lets Win32 and Win64
processes run side-by-side on the same system. However,
loading your 32-bit DLL into a 64-bit process, or vice
versa, isn't supported."
For the ugly details, see:
Why can't you thunk between 32-bit and 64-bit Windows?
http://blogs.msdn.com/b/oldnewthing/archive/2008/10/20/9006720.aspx
- Wayne- Marked as answer by Number 2 Monday, January 30, 2012 5:16 PM
Saturday, January 28, 2012 10:56 PM