Previous Table of Contents Next


20.8.2 COM Chain Avoidance


   A similar approach is adopted to resolve the same chain avoidance issues in COM; however, since DCOM does not support profiles, the implementation is different. The information for chain avoidance (also used by IForeignObject and IForeignObject2) is provided as DCOM value data associated with each passed view object. This information is represented by a ResolvableRefChain.

   struct OpaqueRef

{

unsigned long

unsigned long

BYTE [size_is(len)]

};

struct OpaqueData

{

len;
maxlen;
*data;
unsigned long len;
unsigned long maxlen;

   BYTE [size_is(len)] *data;};

   typedef unsigned long ObjectSystemID;

   struct ResolvableRef

   {IResolver resolver;ObjectSystemID objSysID;unsigned long chainDataFormat;BYTE chainDataVersion;OpaqueData chainData;

   };

   struct ResolvableRefChain

   {unsigned long len;unsigned long maxlen;ResolvableRef [size_is(len,)]**data;

   };

   [object,pointer_default(unique),uuid(5473e440-20ac-11d1-8a22-006097cc044d)

   ]interface IResolver : IUnknown{

   OpaqueRef Resolve([in] ObjectSystemID objSysID,

[in] unsigned long chainDataFormat,
[in] BYTE chainDataVersion,
[in] OpaqueData chainData);
};
[
object,

   pointer_default(unique),

   uuid(60674760-20ac-11d1-8a22-006097cc044d)]interface IForeignObject2 : IForeignObject{

   ResolvedRefChain ChainInfo();};

   The use semantics of the resolver is identical to the use semantics described in Section 20.8.1, “CORBA Chain Avoidance,? on page 20-16. One format tag with value 1 is defined for a ResolvableRefwith objSysID 1 (CORBA). If the format tag is 1, the chainDataVersion must be 0 and the chainData contains a (CDR marshaled) byte defining the byte ordering for the rest of the chainData (the byte value is identical to that used to encode GIOP messages) followed by a CDR marshaled object reference. If Resolve were called for this ResolvableRef, the same value as contained in the chainDatawould be returned by Resolve (i.e., a CDR-marshaled object reference).

   In addition to this mechanism, the interface IForeignObject2 is defined on COM or Automation views to return the ResolvableRefChain in cases where this information has been lost.