views:

454

answers:

3

Is there a way to load a 32bit DLL library (something with the same usage as LoadLibrary) I would like to use that function along with GetProcAddress.

I looked at WOW, but it does not seem to offer the functionality. The functionality should exist, since tools like DependencyWalker are able to read the symbols of a 32bit dll even though its 64bits.

thanks

A: 

There's a difference between reading a 32 bit executable and executing code within a 32 bit executable. I don't believe that windows offers any functionality to do that.

The only way you're likely to be able to do that is to create a 32 bit process that loads the dll and then do interprocess communication to pass the results between the two processes.

Colin Newell
A: 

I think it would be impossible to load a 32bit DLL directly into a 64 bit process and be able to execute methods obtained by GetProcAddress etc.

Dependency Walker only reads the file (and does not matter if it is 32 bit or 16 bit etc as long as it understands the format of the file), which is very different from actually trying to execute it.

You best bet might be some kind of a 32 bit host process, which will execute the methods for you. If the DLL supports COM, you can try having an out-of-proc COM call.

This page might help: http://dnjonline.com/article.aspx?ID=jun07_access3264

Moron
+3  A: 

Sorry, but you can only load a 32bit DLL into a 64 bit process when you are loading the dll as a datafile. You can't execute the code. http://support.microsoft.com/kb/282423

Microsoft recommends that you use interprocess COM to use 32 bit code with a 64 bit application. Here's an article explaining the process http://www.dnjonline.com/article.aspx?id=jun07_access3264 Its not fun.

John Knoeller