<div class="content" name="ApiOpenClusterEx" uuid="00ce494d-0c74-44fd-8276-c73665cf616b"><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 <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a></span>
about <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a></span> interaction
with the <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_feef37b3-c173-4f51-aab6-b55a6366259b" data-linktype="relative-path">cluster</a></span> by means of
the current <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> 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 <span><a href="a249a463-3d3b-4058-abf6-3024d81806a0" data-linktype="relative-path">3.1.4</a></span>). 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 <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_a93e2fea-3006-4a06-b48f-fdb36d9abac9" data-linktype="relative-path">protocol
server state</a></span> is read-only and MUST accept the request for processing
if it is in the read/write state, as specified in section <span><a href="756547e7-ca64-4b7c-9f1b-2b1fbc6153d3" data-linktype="relative-path">3.1.1</a></span>.</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 <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_e5213722-75a9-44e7-b026-8e4833f0d350" data-linktype="relative-path">security
descriptor</a></span> 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>CLUSAPI_READ_ACCESS 0x00000001</td>
  <td>The client requests a context handle that can be used in subsequent method calls that require &#34;Read&#34; access.</td>
 </tr><tr>
  <td>CLUSAPI_CHANGE_ACCESS 0x00000002</td>
  <td>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 dwDesiredAccess bitwise OR includes CLUSAPI_CHANGE_ACCESS but not CLUSAPI_READ_ACCESS.</td>
 </tr><tr>
  <td>GENERIC_READ 0x80000000</td>
  <td>The server MUST treat this value the same as CLUSAPI_READ_ACCESS.</td>
 </tr><tr>
  <td>GENERIC-WRITE 0x40000000</td>
  <td>The server MUST treat this value the same as the bitwise OR of CLUSAPI_READ_ACCESS and CLUSAPI_CHANGE_ACCESS.</td>
 </tr><tr>
  <td>GENERIC_EXECUTE 0x20000000</td>
  <td>The server MUST treat this value the same as the bitwise OR of CLUSAPI_READ_ACCESS and CLUSAPI_CHANGE_ACCESS.</td>
 </tr><tr>
  <td>GENERIC_ALL 0x10000000</td>
  <td>The server MUST treat this value the same as the bitwise OR of CLUSAPI_READ_ACCESS and CLUSAPI_CHANGE_ACCESS.</td>
 </tr><tr>
  <td>MAXIMUM_ALLOWED 0x02000000</td>
  <td>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.</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>GENERIC_READ 0x80000000</td>
  <td>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.</td>
 </tr><tr>
  <td>GENERIC_ALL 0x10000000</td>
  <td>The returned context handle can be used in subsequent methods that require &#34;All&#34; access.</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>ERROR_SUCCESS 0x00000000</td>
  <td>Success.</td>
 </tr><tr>
  <td>ERROR_ACCESS_DENIED 0x00000005</td>
  <td>dwDesiredAccess indicates a level of access exceeding what the client is entitled to (section 3.1.4).</td>
 </tr><tr>
  <td>ERROR_INVALID_PARAMETER 0x00000057</td>
  <td>dwDesiredAccess is invalid, as specified earlier in this section.</td>
 </tr><tr>
  <td>RPC_S_PROCNUM_OUT_OF_RANGE 0x000006D1</td>
  <td>The server does not support this method.</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 <span><a href="ca75805a-4b39-4074-8b5b-dbaae6e81b1f" data-linktype="relative-path">3.2.4.6</a></span>.</p>
</dd></dl><p><b>Return Values: </b>The method MUST return a valid <span><a href="0102f475-9af8-45fa-83e6-22e57451570a" data-linktype="relative-path">HCLUSTER_RPC</a></span>
(section 2.2.1.1) context handle to indicate success; otherwise, it MUST return
NULL.</p></div>