Lets say your DLL exports an API void foo();
one roundabout way to call this 32-bit function from a 64-bit app is to create a new EXE that wraps this API using IPC.
So you'd have:
- A 32-bit EXE that loads the 32-bit DLL with the problematic API.
- A 64-bit DLL that replicates the 32-bit DLL API, i.e it has a
void foo();
- Your client code (probably an EXE or another DLL) links to the 64-bit DLL from step 2, can calls
foo()
however it likes.
Now for the magic part, the DLL from 2. will launch the EXE from 1, it will then use IPC (probably named pipes) to talk to that EXE and forward the call on to it and return its result.
So you'd have your app -> 64-bit wrapper dll -> named pipe -> 32-bit wrapper app -> 32-bit dll. Abstracted in such a way that calling foo();
API works just as it would if your app 32-bit itself. Obviously this is a pain to implement, so consider rewriting the 32-bit API should you find that this is less effort.