The premise:
I have an old, 32-bit COM shell extension (written in C++). After years of incompatibility with newer, 64-bit systems, we are now updating it to work in a 64-bit Windows environment.
The trick:
The 32-bit COM DLL contains dependencies on third-party libraries, for which there are no 64-bit builds available. As such, we cannot simply 'recompile in 64-bit.' Given this restriction, we have decided the easiest approach will be to create a 'thin' 64-bit DLL; essentially an empty DLL defining only the required interfaces, and redirecting all calls to the underlying 32-bit COM DLL.
I believe this communication between a 64-bit COM DLL and a 32-bit COM DLL is possible, through the use of COM surrogates. Unfortunately, this appears to be a very specific/niche topic, and I have been unable to find many resources about how to call 32-bit COM APIs from a 64-bit COM DLL.
The questions:
- Is this 'thin COM wrapper' a reasonable approach, for enabling 64-bit functionality of a 32-bit COM DLL?
- Is there any reason this approach would not work specifically for Windows Shell Extensions?
- Would the 64-bit interface definitions use identical GUIDs as their 32-bit counterparts?
- Is this a strategy which has been documented in the past?
- Are there any good resources for calling a 32-bit COM API from within a 64-bit COM DLL?
Clarifications:
This question has a number of aspects which make it unique, setting it apart from the question "Using 32-bit shell extensions in Windows 7 64-bit."
I am not asking if a 32-bit shell extension can be loaded in a 64-bit explorer process, as the referenced question does. Rather, I am asking if it is possible to create a thin 64-bit implementation of the DLL, which acts as a bridge between the 64-bit explorer process and the 32-bit implementation.
To be clear, this is not possible.
But maybe this is?
CoCreateInstance
or similar) into requests back to the 64-bit DLL (if you're usingIClassFactory::CreateInstance
, this basically only requires you to get the factory from the 64-bit DLL instead of withCoGetClassObject
). – acelent