列集: 為了將一個接口指針從一個線程傳遞到同一進程內的另一個線程中。
用到的兩個函數:CoMarshalInterface和CoUnmarshalInterface.
CoMarshalInterface
Writes into a stream the data required to initialize a proxy object in some client process. The COM library in the client process calls the CoUnmarshalInterface function to extract the data and initialize the proxy. Before calling CoUnmarshalInterface, seek back to the original position in the stream. CoMarshalInterface can marshal only interfaces derived from IUnknown.
CoUnmarshalInterface
Initializes a newly created proxy using data written into the stream by a previous call to the CoMarshalInterface function, and returns an interface pointer to that proxy.
列集可以通過函數CoMarshalInterface函數來完成,當調用CoMarshalInterface第一次為對象進行列集時會為對象建立一個存根管理器,而以后對同一個對象的其他接口列集時,就不會再建一個存根管理器.
進程具有一個或者多個套間,任何一個線程在某一時刻只能在一個套間種運行。
每個COM對象只能屬于一個套間。為了使每個套間之間能夠進行通信。
COM支持跨套間邊界的對象引用列集機制。