4 Protocol Examples

To participate in an MSDTC Connection Manager: OleTx Transports Protocol session, a partner exposes an endpoint to its implementation of the IXnRemote interface. Each partner's endpoint is identified by its name object, which includes its NetBIOS machine name, supported RPC network protocols, and contact identifier (CID), as specified in section 3.2.1.4. To begin a session, the first partner needs to have knowledge of the second partner's name object.

From the second partner's contact identifier (CID), the first partner determines if it is the primary partner or secondary partner by performing a case-insensitive string comparison of the first partner's and second partner's contact identifier (CID), as specified in [C706]. If the first partner's contact identifier (CID) string is greater than (follows) the second partner's contact identifier (CID) string, the first partner is the primary partner. If the first partner's contact identifier (CID) string is less than (precedes) the second partner's contact identifier (CID) string, the first partner is the secondary partner.

A session is initiated by the primary partner sending a BuildContext (or BuildContextW) call to the secondary partner with sRank set to SRANK_PRIMARY. In response, the secondary partner sends a BuildContext call to the secondary partner with sRank set to SRANK_SECONDARY. When the primary partner accepts the BuildContext call from the secondary partner, the secondary partner returns success to the primary partner's BuildContext call. Because the first BuildContext call in the protocol handshake originates from the primary partner, the secondary partner is required to begin a session with the primary partner by calling Poke (or PokeW), which instructs the primary partner to send a BuildContext call to the secondary partner.