<div class="content"><p> </p><p>A <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a></span> calls the
R_QMEnlistInternalTransaction method to enlist the <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_7bc5d175-2fa4-481e-893c-6f3eb2862fa4" data-linktype="relative-path">supporting server&#39;s</a></span> <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_a7d0361f-8608-454d-9a52-67d4d181ae09" data-linktype="relative-path">resource
manager (RM)</a></span> in an <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_fcccf89d-d9c6-44ed-9f8a-13a204fe35b3" data-linktype="relative-path">internal transaction</a></span>.
The <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a></span>
returns a <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_61e1de21-a78d-4d20-b184-eda380386871" data-linktype="relative-path">transaction</a></span> handle
associated with the given <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_a9e645d9-caad-4e6c-8fed-cefb289e3824" data-linktype="relative-path">unit of work</a></span>
identifier (<span><a href="../ms-mqmq/711d679b-e7b1-4e0c-8e51-f7529bfbc02f" data-linktype="relative-path">XACTUOW</a></span>).
The returned transaction handle is used when calling <span><a href="67840302-59e6-40ea-9c7d-3fef65e7c226" data-linktype="relative-path">R_QMCommitTransaction</a></span>
or <span><a href="9e3ae18b-78c0-4f29-9541-d7b7e649013b" data-linktype="relative-path">R_QMAbortTransaction</a></span>.
The XACTUOW structure (<span><a href="../ms-mqmq/b7cc2590-a617-45df-b6a3-1f31102b36fb" data-linktype="relative-path">[MS-MQMQ]</a></span>
section 2.2.18.1.8) is provided for calls to <span><a href="a043b74f-8466-42d6-9a66-b3f2581b309a" data-linktype="relative-path">rpc_ACSendMessageEx</a></span>
and <span><a href="328a5652-db8d-4426-b01c-2c1e499086df" data-linktype="relative-path">rpc_ACReceiveMessageEx</a></span>
of the qmcomm2 <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> interface.</p><dl>
<dd>
<div><pre> HRESULT R_QMEnlistInternalTransaction(
   [in] handle_t hBind,
   [in] XACTUOW* pUow,
   [out] RPC_INT_XACT_HANDLE* phIntXact
 );
</pre></div>
</dd></dl><p><b>hBind: </b> MUST be set to an RPC binding handle
as described in <span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>
section <span><a href="../ms-rpce/a01f5886-c485-4bcf-bb23-e0d755510ab7" data-linktype="relative-path">2</a></span>.</p><p><b>pUow: </b> MUST point to an XACTUOW structure that
uniquely identifies the internal transaction in which the server is to enlist.<a id="Appendix_A_Target_44"></a><a aria-label="Product behavior note 44" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_44" data-linktype="relative-path">&lt;44&gt;</a></p><p><b>phIntXact: </b> A pointer to receive the new <span><a href="ad71f465-cc25-4dbc-9acc-decbb7b84555" data-linktype="relative-path">RPC_INT_XACT_HANDLE</a></span>
which represents the new internal transaction context.</p><p><b>Return Values: </b> On success, this method MUST return
MQ_OK (0x00000000); otherwise, the server MUST return a failure HRESULT, and
the client MUST treat all failure HRESULTs identically. Additionally, if a
failure HRESULT is returned, the client MUST disregard all out-parameter
values.</p><p>Exceptions Thrown: No exceptions are thrown beyond those
thrown by the underlying RPC protocol, as specified in [MS-RPCE].</p><p>This method is invoked at the dynamically assigned <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_b91c1e27-e8e0-499b-8c65-738006af72ee" data-linktype="relative-path">endpoint</a></span>
returned by the <span><a href="a8c96155-a7e6-41cb-95c7-6ab7e4f8214d" data-linktype="relative-path">R_QMGetRTQMServerPort</a></span>
method when IP_HANDSHAKE (0x00000000) or IPX_HANDSHAKE (0x00000002) is the
interface specified by the <i>fIP</i> parameter.</p><p>When processing this call, the server MUST:</p><ul><li><p><span><span> 
</span></span>Determine if input parameter values violate constraints specified
above. If an invalid parameter is detected, the server MUST take no further
action and return a failure <span><a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a></span>.</p>
</li><li><p><span><span> 
</span></span>Look up a <b>Transaction</b> (<span><a href="../ms-mqdmpr/5eafe0a6-a22f-436b-a0d9-4cbc25c52b47" data-linktype="relative-path">[MS-MQDMPR]</a></span>
section <span><a href="../ms-mqdmpr/977818a4-098a-44f4-a6e2-97b8e8b1bb6b" data-linktype="relative-path">3.1.1.14</a></span>)
ADM element instance in the server&#39;s <b>LocalQueueManager.TransactionCollection</b>
where <b>Transaction.Identifier</b> matches the <i>pUow</i> parameter.</p>
</li><li><p><span><span> 
</span></span>If found:</p>
<ul><li><p><span><span>  </span></span>Take
no further action and return MQ_ERROR_TRANSACTION_SEQUENCE (0xC00E0051).</p>
</li></ul></li><li><p><span><span> 
</span></span>Else:</p>
<ul><li><p><span><span>  </span></span>Generate
a <span><a href="../ms-mqdmpr/a44b2ff2-c914-44e2-ac21-4855718b39aa" data-linktype="relative-path">Create
Transaction</a></span> ([MS-MQDMPR] section 3.1.7.1.8) event with the following
argument value:</p>
<ul><li><p><span><span> 
</span></span><i>iTransactionIdentifier</i> := <i>pUow</i></p>
</li></ul></li><li><p><span><span>  </span></span>The
Create Transaction event returns a reference to a <b>Transaction</b> ADM
element instance <i>rTransaction</i>.</p>
</li><li><p><span><span>  </span></span>Declare
<i>iNewTransactionHandle</i> as a <span><a href="5a36d61c-b8c3-4b75-9304-ccdd17dcf9a4" data-linktype="relative-path">TransactionHandle (section 3.1.1.10)</a></span>
ADM element instance and set its attributes to the following values:</p>
<ul><li><p><span><span> 
</span></span><b>Handle</b> := A new RPC_INT_XACT_HANDLE context handle.</p>
</li><li><p><span><span> 
</span></span><b>TransactionReference</b> := <i>rTransaction</i></p>
</li></ul></li><li><p><span><span>  </span></span>Add
<i>iNewTransactionHandle</i> to <i>iTransactionHandleTable</i>.</p>
</li><li><p><span><span>  </span></span>Set
the <i>phIntXact</i> parameter to <i>iNewTransactionHandle</i>.<b>Handle</b>.</p>
</li></ul></li><li><p><span><span> 
</span></span>Return MQ_OK (0x00000000).</p>
</li></ul></div>