The normal rules for replenishing a COM apartment are observed. If the object was created by the client in the STA apartment, then your client stream must use a marshaled interface pointer or it receives RPC_E_WRONG_THREAD. The actual method call will be made on the server in its STA stream, it needs to pump the message loop for this. Execution is serialized; no lock is required.
If he lives in an MTA apartment, the method call will be executed on any RPC workflow. And you will need to take the usual precautions.
source
share