Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Out of Process COM Server with simultaneous 32 and 64 bit clients

Tags:

c++

com

I have a 64bit out of process COM Server running on a 64bit machine. I registered my 64bit Proxy/Stub DLL using regsvr32.exe in my C:\Windows\System32 folder and can run my 64bit clients. I have also registered my 32bit Proxy/Stub in the C:\Windows\SysWOW64 folder and I can run my 32bit clients. I can also run multiple 32bit clients at the same time, and multiple 64bit clients at the same time. However, if I try to run a 32bit client and then a 64bit client, the second client attempts to create a new Server.exe process (same thing happens if I start with the 64bit client). Shouldn't they all just use the same Server instance?

Here is my Server CoCreateInstanceEx Call:

HRESULT hr = CoCreateInstanceEx(CLSID_COMServerObject, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_ACTIVATE_64_BIT_SERVER, NULL, 1, &qi);

Both my Client CoCreateInstanceEx Calls look like this:

hr = CoCreateInstanceEx(clsid, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_ACTIVATE_64_BIT_SERVER, NULL, 1, &qi);

Any help would be greatly appreciated.

like image 281
darkrock76 Avatar asked Oct 01 '22 17:10

darkrock76


1 Answers

The 64 bit client was running as administrator and the 32 bit clients were not. Forcing the 32 bit clients to also run as administrator solved the issue

like image 179
darkrock76 Avatar answered Oct 05 '22 11:10

darkrock76