Jump to content
Registration disabled at the moment Read more... ×
dummzeuch

Calling a 64 bit DLL from 32 bit code

Recommended Posts

Is there a way to call a 64 bit dll from 32 bit Delphi code?

 

As far as I know that's not possible, but I have been wrong before.

 

I am aware of this Article on Process Interoperability on Learn Microsoft.com.

And there is Using 64-bit DLLs in 32-bit Processes with Out-of-process COM which is about C# and  WoW64Injection: Loading a 64-bit DLL in a 32-bit process which probably won't help at all.

 

(Hm, maybe this should have gone to RTL + VCL ?)

Edited by dummzeuch

Share this post


Link to post
24 minutes ago, dummzeuch said:

Is there a way to call a 64 bit dll from 32 bit Delphi code?

In a word, no. Certainly not directly, anyway.

24 minutes ago, dummzeuch said:

I am aware of this Article on Process Interoperability on Learn Microsoft.com.

Basically. Load the DLL into a 64bit process, and then use some kind of IPC with the 32bit process.

24 minutes ago, dummzeuch said:

The article is using C#, but the technique is not limited to C#. A COM out-of-proc server is aits own EXE process, and can be instantiated by 32bit and 64bit clients. So, you can write a 64bit server that wraps the 64bit DLL (or use COM's own DllSurrogate if the DLL is itself a COM object) , and then a 32bit client can use the server's COM object.

24 minutes ago, dummzeuch said:

and  WoW64Injection: Loading a 64-bit DLL in a 32-bit process which probably won't help at all.

I'm not familiar with that. It looks interesting but I wouldn't trust it in production code.

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×