News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

x64 Dll Wrapper for a X32 Dll

Started by caraveiro, July 05, 2015, 03:48:09 AM

Previous topic - Next topic

caraveiro

Hi there!

I need to call a legacy 32bit Dll from Excel x64. As Excel x64 does NOT support calling x32 Dlls I think that the only solution is to build a wrapper.

I found this article useful:

http://blog.mattmags.com/2007/06/30/accessing-32-bit-dlls-from-64-bit-code/

QuoteThe solution: a surrogate process

This issue can be solved by loading the dependency DLL into a separate 32-bit process space. The main module, running as a 64-bit process, can then access the dependency DLL across the process boundary using IPC (http://msdn2.microsoft.com/en-us/library/aa365574.aspx).


How do I do a surrogate process in asm?

Any clues?
"knowledge is now free at last, everything should be free from now on, enjoy knowledge and life and work for everybody else"
+ORC

BogdanOntanu

#1
Nothing special about it. Just a simple x32 process that loads the x32 bits DLL.

It will have to wait on an IPC mechanism (for example via network sockets) for a message from the x64 application and it will send back the results of the x32 DLL function call.

It is kind of a lot of work.

IMHO it is much better to rewrite the x32 DLL into an x64 DLL.

Ambition is a lame excuse for the ones not brave enough to be lazy, www.oby.ro

jj2007

Probably (=haven't tested that), you can use CreateProcess, ShellExecute or similar to launch the 32-bit process, and e.g. SendMessage hWnd, WM_COPYDATA or similar to exchange data.

caraveiro

Thank you guys.

I'll stay with Excel32 for a long time.

:icon_eek:

"knowledge is now free at last, everything should be free from now on, enjoy knowledge and life and work for everybody else"
+ORC