views:

45

answers:

1

I'm using the virtualbox api that uses COM on windows. If you have a 64 bit OS it will install the 64 bit version and the COM interfaces will be accessible to 64 bit clients but not to 32 bit ones. I'm told this is a COM limitation but I have seen ways to use dll32 to "publish" 32 bit interfaces on the registry, so 64 bit processes can call these COM servers, but I can't find the inverse, accessing 64 bits interfaces from 32 bits processes.

If I wasn't very clear I believe this person wants to achieve something similar: http://www.codeproject.com/Forums/1648/COM.aspx?fid=1648&df=90&mpp=25&sort=Position&select=1702805&tid=1702805

+1  A: 

In process thunking will always work only only from higher bitness to lower one, not the other way around. When Win32 came out, a 32 bit process could thunk a 16 bit dll, but there was just no way a 32 bit dll could be thunked into a 16 bit process. Same is true now, a 32 bit dll can be thunked into a 64 bit process, but there is no way a 64 bit dll can be thunked into a 32 bit process (with the exception of the WOW64 emulator DLLs: Wow64.dll, wow64Win.dll and Wow64Cpu.dll).

If you want to load a 64 bit COM in-process-dll, you'll need an out-of-process 64bit loader and your 32 bit app can communicate with the loaded and pass the necessary parameters for the call, and receive the result.

For out-of-process 64 bit COM local servers you'll need the 32 bit proxy DLLs, see Interprocess Communication Between 32-bit and 64-bit Applications.

Remus Rusanu