<div class="content"><p align="right"><a href="https://msdn.microsoft.com/en-us/library/00ce494d-0c74-44fd-8276-c73665cf616b" data-linktype="external">msdn link</a></p><p>(Protocol Version 3) The ApiOpenClusterEx method SHOULD<a id="Appendix_A_Target_96"></a><a aria-label="Product behavior note 96" href="1d58eff8-a042-478c-972c-8e9c76a3f978#Appendix_A_96" data-linktype="relative-path">&lt;96&gt;</a> establish context on the <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a> about <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a> interaction with the
<a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_feef37b3-c173-4f51-aab6-b55a6366259b" data-linktype="relative-path">cluster</a> by means of the
current <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a> connection.
ApiOpenClusterEx returns a context handle so that the client can refer to the
context that is created in subsequent method calls.</p><p>The server MUST determine the level of access to be granted
to the client (section <a href="a249a463-3d3b-4058-abf6-3024d81806a0" data-linktype="relative-path">3.1.4</a>).
Upon success, the server MUST associate that level of access with the cluster
context it has established.</p><p>The server SHOULD accept an ApiOpenClusterEx request if its <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_a93e2fea-3006-4a06-b48f-fdb36d9abac9" data-linktype="relative-path">protocol server state</a> is
read-only and MUST accept the request for processing if it is in the read/write
state, as specified in section <a href="756547e7-ca64-4b7c-9f1b-2b1fbc6153d3" data-linktype="relative-path">3.1.1</a>.</p><dl>
<dd>
<div><pre> HCLUSTER_RPC ApiOpenClusterEx(
   [in] DWORD dwDesiredAccess,
   [out] DWORD * lpdwGrantedAccess,
   [out] error_status_t *Status
 );
</pre></div>
</dd></dl><p><b>dwDesiredAccess: </b>Indicates the access level
desired by the caller. The client SHOULD set <i>dwDesiredAccess</i> to the
bitwise OR of one or more values in the following table (except for
restrictions as noted in the table). The server SHOULD permit the cluster <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_e5213722-75a9-44e7-b026-8e4833f0d350" data-linktype="relative-path">security descriptor</a> to
express permissions other than those specified in the following table. The
server SHOULD perform an access check against those other permissions if
requested by the client, except if the client sets <i>dwDesiredAccess</i> to a
value that is invalid as specified in the following table. The server SHOULD
NOT support a value for <i>dwDesiredAccess</i> that allows the client to
request an access level of &#34;Read with Backup Privilege&#34;.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>CLUSAPI_READ_ACCESS</p>
  <p>0x00000001</p>
  </td>
  <td>
  <p>The client requests a context handle that can be used
  in subsequent method calls that require &#34;Read&#34; access.</p>
  </td>
 </tr><tr>
  <td>
  <p>CLUSAPI_CHANGE_ACCESS</p>
  <p>0x00000002</p>
  </td>
  <td>
  <p>The client requests a context handle that can be used
  in subsequent method calls that require &#34;All&#34; access. The server
  MUST return ERROR_INVALID_PARAMETER (0x00000057) if the <i>dwDesiredAccess</i>
  bitwise OR includes CLUSAPI_CHANGE_ACCESS but not CLUSAPI_READ_ACCESS.</p>
  </td>
 </tr><tr>
  <td>
  <p>GENERIC_READ</p>
  <p>0x80000000</p>
  </td>
  <td>
  <p>The server MUST treat this value the same as
  CLUSAPI_READ_ACCESS.</p>
  </td>
 </tr><tr>
  <td>
  <p>GENERIC-WRITE</p>
  <p>0x40000000</p>
  </td>
  <td>
  <p>The server MUST treat this value the same as the
  bitwise OR of CLUSAPI_READ_ACCESS and CLUSAPI_CHANGE_ACCESS.</p>
  </td>
 </tr><tr>
  <td>
  <p>GENERIC_EXECUTE</p>
  <p>0x20000000</p>
  </td>
  <td>
  <p>The server MUST treat this value the same as the
  bitwise OR of CLUSAPI_READ_ACCESS and CLUSAPI_CHANGE_ACCESS.</p>
  </td>
 </tr><tr>
  <td>
  <p>GENERIC_ALL</p>
  <p>0x10000000</p>
  </td>
  <td>
  <p>The server MUST treat this value the same as the
  bitwise OR of CLUSAPI_READ_ACCESS and CLUSAPI_CHANGE_ACCESS.</p>
  </td>
 </tr><tr>
  <td>
  <p>MAXIMUM_ALLOWED</p>
  <p>0x02000000</p>
  </td>
  <td>
  <p>The client requests a context handle that can be used
  in subsequent method calls that require the maximum access level granted to
  the client, as specified in section 3.1.4.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p><b>lpdwGrantedAccess: </b>A pointer to a 32-bit value
that indicates the access level granted to the client. If the method fails, the
client MUST ignore this value. Upon successful completion of this method, the
server MUST set this value to one of the values in the following table.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>GENERIC_READ</p>
  <p>0x80000000</p>
  </td>
  <td>
  <p>The returned context handle can be used in subsequent
  methods that require &#34;Read&#34; access. If the client has backup
  privilege, the returned context handle can also be used in subsequent methods
  that require &#34;Read with Backup Privilege&#34; access.</p>
  </td>
 </tr><tr>
  <td>
  <p>GENERIC_ALL</p>
  <p>0x10000000</p>
  </td>
  <td>
  <p>The returned context handle can be used in subsequent
  methods that require &#34;All&#34; access.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p><b>Status: </b>Indicates the status of this
operation. The server MUST set <i>Status</i> to the following error codes for
the specified conditions.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>ERROR_SUCCESS</p>
  <p>0x00000000</p>
  </td>
  <td>
  <p>Success.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_ACCESS_DENIED</p>
  <p>0x00000005</p>
  </td>
  <td>
  <p><i>dwDesiredAccess</i> indicates a level of access
  exceeding what the client is entitled to (section 3.1.4).</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_INVALID_PARAMETER</p>
  <p>0x00000057</p>
  </td>
  <td>
  <p><i>dwDesiredAccess</i> is invalid, as specified
  earlier in this section.</p>
  </td>
 </tr><tr>
  <td>
  <p>RPC_S_PROCNUM_OUT_OF_RANGE</p>
  <p>0x000006D1</p>
  </td>
  <td>
  <p>The server does not support this method.</p>
  </td>
 </tr></tbody></table>
</dd>
<dd>
<p>For any other condition, the server sets <i>Status</i>
to a value that is not one of the values listed in the preceding table. The
client MUST treat all values that are not listed in the preceding table the
same, except as specified in section <a href="ca75805a-4b39-4074-8b5b-dbaae6e81b1f" data-linktype="relative-path">3.2.4.6</a>.</p>
</dd></dl><p><b>Return Values: </b>The method MUST return a valid <a href="0102f475-9af8-45fa-83e6-22e57451570a" data-linktype="relative-path">HCLUSTER_RPC</a> (section
2.2.1.1) context handle to indicate success; otherwise, it MUST return NULL.</p></div>