<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
R_QMOpenRemoteQueue to obtain a valid queue handle on a <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_91d29587-3e24-439b-8f2c-c2a43be99afc" data-linktype="relative-path">remote
queue</a></span> as part of the sequence of events involved in opening a remote
queue as described in section <span><a href="b2fc68c7-ba87-47ec-9b98-780f1202282a" data-linktype="relative-path">4.2</a></span>.</p><dl>
<dd>
<div><pre> HRESULT R_QMOpenRemoteQueue(
   [in] handle_t hBind,
   [out] PCTX_OPENREMOTE_HANDLE_TYPE* pphContext,
   [out] DWORD* pdwContext,
   [in, unique] QUEUE_FORMAT* pQueueFormat,
   [in] DWORD dwCallingProcessID,
   [in] DWORD dwDesiredAccess,
   [in] DWORD dwShareMode,
   [in] GUID* pLicGuid,
   [in] DWORD dwMQS,
   [out] DWORD* dwpQueue,
   [out] DWORD* phQueue
 );
</pre></div>
</dd></dl><p><b>hBind: </b> MUST be set to an <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span>
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>pphContext: </b> A pointer to a variable to
receive the <span><a href="13e09f92-a54f-4066-90af-026e8ca0ae18" data-linktype="relative-path">PCTX_OPENREMOTE_HANDLE_TYPE (section 2.2.1.1.3)</a></span>
context handle.</p><p><b>pdwContext: </b>A pointer to a variable to receive
the value of the <b>Handle</b> attribute for the new <b>OpenQueueDescriptor</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/e2005510-8785-414e-9a71-fa313fa6e119" data-linktype="relative-path">3.1.1.16</a></span>)
ADM element instance created by this method. It MUST NOT be NULL.</p><p><b>pQueueFormat: </b>A <b>QUEUE_FORMAT</b> (<span><a href="../ms-mqmq/b7cc2590-a617-45df-b6a3-1f31102b36fb" data-linktype="relative-path">[MS-MQMQ]</a></span>
section <span><a href="../ms-mqmq/905e154a-6123-42a9-86cb-e0a3169820f2" data-linktype="relative-path">2.2.7</a></span>)
structure that identifies the <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_c1a6400d-703b-4f9a-a74c-40f1487978d9" data-linktype="relative-path">queue</a></span> to be opened.
It MUST NOT be NULL and MUST conform to the <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_390ae273-7109-44eb-981f-aa157e6b37c0" data-linktype="relative-path">format name</a></span> syntax
rules defined in [MS-MQMQ]. It MUST NOT be a distribution list or multicast
format name. For direct format names, the protocol MUST NOT be HTTP.</p><p><b>dwCallingProcessID: </b> MUST be ignored. Clients
MAY pass 0x00000000.<a id="Appendix_A_Target_15"></a><a aria-label="Product behavior note 15" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_15" data-linktype="relative-path">&lt;15&gt;</a></p><p><b>dwDesiredAccess: </b> A <b>DWORD</b> that
specifies the access mode requested for the queue. The access mode defines the
set of operations that can be invoked using the returned queue handle. The
value MUST be one of the following:</p><table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>MQ_RECEIVE_ACCESS</p>
  <p>0x00000001</p>
  </td>
  <td>
  <p>The returned queue handle MUST only permit message
  peek, message receive (peek and delete), and queue purge operations.</p>
  </td>
 </tr><tr>
  <td>
  <p>MQ_PEEK_ACCESS</p>
  <p>0x00000020</p>
  </td>
  <td>
  <p>The returned queue handle MUST only permit message
  peek operations.</p>
  </td>
 </tr></tbody></table><p><b>dwShareMode: </b> Specifies the exclusivity level
for the opened queue. The value MUST be one of the following:</p><table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>MQ_DENY_NONE</p>
  <p>0x00000000</p>
  </td>
  <td>
  <p>The queue is not opened exclusively.</p>
  </td>
 </tr><tr>
  <td>
  <p>MQ_DENY_RECEIVE_SHARE</p>
  <p>0x00000001</p>
  </td>
  <td>
  <p>The queue is to be opened for exclusive read access.
  If the queue has already been opened for read access, the <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a></span>
  MUST return STATUS_SHARING_VIOLATION (0xc0000043). If the queue is opened
  successfully for exclusive read access, subsequent attempts to open the same
  queue for read access MUST return STATUS_SHARING_VIOLATION (0xc0000043) until
  the queue has been closed.</p>
  </td>
 </tr></tbody></table><p><b>pLicGuid: </b> MUST be a pointer to a valid <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_f49694cc-c350-462d-ab8e-816f0103c6c1" data-linktype="relative-path">GUID</a></span>
that uniquely identifies the client.<a id="Appendix_A_Target_16"></a><a aria-label="Product behavior note 16" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_16" data-linktype="relative-path">&lt;16&gt;</a><a id="Appendix_A_Target_17"></a><a aria-label="Product behavior note 17" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_17" data-linktype="relative-path">&lt;17&gt;</a> The server MAY ignore this
parameter.<a id="Appendix_A_Target_18"></a><a aria-label="Product behavior note 18" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_18" data-linktype="relative-path">&lt;18&gt;</a></p><p><b>dwMQS: </b> MUST be set by clients to indicate the
client operating system category. Servers MAY ignore this value.<a id="Appendix_A_Target_19"></a><a aria-label="Product behavior note 19" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_19" data-linktype="relative-path">&lt;19&gt;</a> The following values are
defined:</p><dl>
<dd>
<dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Are server connection licensing limitations
   enforced?/Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x00000000<a id="Appendix_A_Target_20"></a><a aria-label="Product behavior note 20" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_20" data-linktype="relative-path">&lt;20&gt;</a></p>
  </td>
  <td>
  <p>None. The operating system (OS) version is not declared.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000100</p>
  </td>
  <td>
  <p>Yes. For supported operating systems.<a id="Appendix_A_Target_21"></a><a aria-label="Product behavior note 21" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_21" data-linktype="relative-path">&lt;21&gt;</a></p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000200</p>
  </td>
  <td>
  <p>Yes. For supported operating systems.<a id="Appendix_A_Target_22"></a><a aria-label="Product behavior note 22" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_22" data-linktype="relative-path">&lt;22&gt;</a></p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000300</p>
  </td>
  <td>
  <p>Yes. For supported operating systems.<a id="Appendix_A_Target_23"></a><a aria-label="Product behavior note 23" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_23" data-linktype="relative-path">&lt;23&gt;</a></p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000400</p>
  </td>
  <td>
  <p>No. For supported operating systems.<a id="Appendix_A_Target_24"></a><a aria-label="Product behavior note 24" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_24" data-linktype="relative-path">&lt;24&gt;</a></p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000500</p>
  </td>
  <td>
  <p>No. For supported operating systems.<a id="Appendix_A_Target_25"></a><a aria-label="Product behavior note 25" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_25" data-linktype="relative-path">&lt;25&gt;</a></p>
  </td>
 </tr></tbody></table>
</dd></dl></dd></dl><p><b>dwpQueue: </b>A pointer to a variable to receive a
value that identifies the new <b>OpenQueueDescriptor</b> ADM element instance
created by this method, as specified in the processing rules section for this
method. It MUST NOT be NULL.</p><p><b>phQueue: </b>A pointer to a variable to receive
the value of the <b>Handle</b> attribute for the new <b>OpenQueueDescriptor</b>
ADM element instance created by this method. It MUST NOT be NULL.</p><p><b>Return Values: </b> On success, this method MUST return
MQ_OK (0x00000000); otherwise, the server MUST return a failure <span><a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a></span>
<a id="Appendix_A_Target_26"></a><a aria-label="Product behavior note 26" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_26" data-linktype="relative-path">&lt;26&gt;</a>, 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: In addition to the exceptions thrown by
the underlying RPC protocol [MS-RPCE], the method can throw HRESULT failure
codes as RPC exceptions. The client MUST treat all thrown HRESULT codes
identically. Additionally, the client MUST disregard all out-parameter values
when any failure HRESULT is thrown.</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 HRESULT.</p>
</li><li><p><span><span> 
</span></span>Generate an <span><a href="../ms-mqdmpr/0fc165fd-317a-49ab-919d-3911da6da6d6" data-linktype="relative-path">Open Queue</a></span>
([MS-MQDMPR] section 3.1.7.1.5) event with the following argument values:</p>
<ul><li><p><span><span>  </span></span><i>iFormatName</i>
:= <i>pQueueFormat</i></p>
</li><li><p><span><span>  </span></span><i>iRequiredAccess</i>
:=<i>dwDesiredAccess</i>, according to the following values:</p>
<ul><li><p><span><span> 
</span></span>MQ_RECEIVE_ACCESS (0x00000001): ReceiveAccess</p>
</li><li><p><span><span> 
</span></span>MQ_PEEK_ACCESS (0x00000020): PeekAccess</p>
</li></ul></li><li><p><span><span>  </span></span><i>iSharedMode</i>
:= <i>dwShareMode</i>, according to the following values:</p>
<ul><li><p><span><span> 
</span></span>MQ_DENY_NONE (0x00000000): DenyNone</p>
</li><li><p><span><span> 
</span></span>MQ_DENY_RECEIVE_SHARE (0x00000001): DenyReceive</p>
</li></ul></li></ul></li><li><p><span><span> 
</span></span>If the <i>rStatus</i> out-argument of the Open Queue event
indicates failure, take no further action and return the <i>rStatus</i> value.</p>
</li><li><p><span><span> 
</span></span>The <i>rOpenQueueDescriptor</i> out-argument of the Open Queue
event contains a reference to the <b>OpenQueueDescriptor</b> ADM element
instance created by the Open Queue event.</p>
</li><li><p><span><span> 
</span></span>Set <b>rOpenQueueDescriptor.RemoteReadState</b> to <b>Opened</b>.</p>
</li><li><p><span><span> 
</span></span>Declare <i>iNewRemoteQueueOpenContextHandle</i> as a <b>RemoteQueueOpenContextHandle</b>
ADM element instance and set its attributes to the following values:</p>
<ul><li><p><span><span>  </span></span><b>Handle</b>
:= PCTX_OPENREMOTE_HANDLE_TYPE reference to <b>rOpenQueueDescriptor.Handle</b>.</p>
</li><li><p><span><span>  </span></span><b>OpenQueueDescriptorReference</b>
:= The <i>rOpenQueueDescriptor</i> out-argument of the Open Queue event
generated preceding.</p>
</li></ul></li><li><p><span><span> 
</span></span>Add <i>iNewRemoteQueueOpenContextHandle</i> to <i>iRemoteQueueOpenContextHandleTable</i>.</p>
</li><li><p><span><span> 
</span></span>Set the out-parameter values accordingly:</p>
<ul><li><p><span><span>  </span></span><i>pphContext</i>
:= <i>iNewRemoteQueueOpenContextHandle</i>.<b>Handle</b></p>
</li></ul></li></ul><p>Additionally, the server SHOULD set the following
out-parameter values accordingly:</p><ul><li><p><span><span> 
</span></span>Either to:<a id="Appendix_A_Target_27"></a><a aria-label="Product behavior note 27" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_27" data-linktype="relative-path">&lt;27&gt;</a></p>
<ul><li><p><span><span>  </span></span><i>pdwContext</i>
:= <b>rOpenQueueDescriptor.Handle</b></p>
</li><li><p><span><span>  </span></span><i>phQueue</i>
:= <b>rOpenQueueDescriptor.Handle</b></p>
</li><li><p><span><span>  </span></span><i>dwpQueue</i>
:= <i>iNewRemoteQueueOpenContextHandle</i>. <b>OpenQueueDescriptorReference</b></p>
</li></ul></li><li><p><span><span> 
</span></span>Or to:<a id="Appendix_A_Target_28"></a><a aria-label="Product behavior note 28" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_28" data-linktype="relative-path">&lt;28&gt;</a></p>
<ul><li><p><span><span>  </span></span><i>pdwContext</i>
:= <b>rOpenQueueDescriptor.Handle</b></p>
</li><li><p><span><span>  </span></span><i>phQueue</i>
:= <b>rOpenQueueDescriptor.Handle</b></p>
</li><li><p><span><span>  </span></span><i>dwpQueue</i>
:= <b>rOpenQueueDescriptor.Handle</b></p>
</li></ul></li><li><p><span><span> 
</span></span>Return MQ_OK (0x00000000).</p>
</li></ul></div>