<div class="content" name="ApiChangeCsvState" uuid="c5fc15b0-5cbe-4403-acf3-433be8e5b5a6"><p>(Protocol Version 3) The ApiChangeCsvState method SHOULD<a id="Appendix_A_Target_102"></a><a aria-label="Product behavior note 102" href="1d58eff8-a042-478c-972c-8e9c76a3f978#Appendix_A_102" data-linktype="relative-path">&lt;102&gt;</a> instruct the <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a></span>
to change the accessibility of the disk associated with <i>hResource</i>.</p><p>If <i>dwState</i> is 1, the server MUST set
ResourceSharedVolumes to TRUE and convert all <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_9a876829-33a1-4f0b-8b81-8552b7e5561c" data-linktype="relative-path">volumes</a></span> associated
with <i>hResource</i> to <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_feef37b3-c173-4f51-aab6-b55a6366259b" data-linktype="relative-path">cluster</a></span> shared volumes.
The server MUST set the initial state of all cluster shared volumes associated
with <i>hResource</i> such that volume maintenance mode, redirected mode, and
backup mode are all disabled.</p><p>If <i>dwState</i> is 1, the server SHOULD also designate the
group associated with <i>hResource</i> as a special group, as specified in
section <span><a href="2cec8d2a-040c-4741-8bf0-ecd4b33de67f" data-linktype="relative-path">3.1.1.1.4</a></span>.</p><p>If <i>dwState</i> is 0, the server MUST set
ResourceSharedVolumes to FALSE and stop making the volumes associated with <i>hResource</i>
accessible to all nodes as cluster shared volumes. </p><p>If <i>dwState</i> is 0, the server SHOULD also remove the
special group designation of the group associated with <i>hResource</i>.</p><p>The server SHOULD accept an ApiChangeCsvState 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 the server 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><p>The server MUST require that the access level associated
with the <i>hResource</i> context handle is &#34;All&#34; (section <span><a href="a249a463-3d3b-4058-abf6-3024d81806a0" data-linktype="relative-path">3.1.4</a></span>).</p><dl>
<dd>
<div><pre> error_status_t ApiChangeCsvState(
   [in] HRES_RPC hResource,
   [in] DWORD dwState,
   [out] error_status_t *rpc_status
 );
</pre></div>
</dd></dl><p><b>hResource: </b>An HRES_RPC context handle that was
obtained in a previous <span><a href="181f8de0-f518-4c5b-b98e-ddb18aa325ce" data-linktype="relative-path">ApiOpenResource</a></span>, <span><a href="6595931d-2fe5-4097-9270-f6bada5d9242" data-linktype="relative-path">ApiOpenResourceEx</a></span>,
or <span><a href="bc6ca940-7177-4bef-9567-ae4a692a2ba5" data-linktype="relative-path">ApiCreateResource</a></span>
method call.</p><p><b>dwState: </b>This MUST be 1 to make the disk
associated with <i>hResource</i> accessible from all cluster nodes. This MUST
be 0 to make the disk associated with <i>hResource</i> accessible only from the
cluster <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_762051d8-4fdc-437e-af9d-3f4da77c3c7d" data-linktype="relative-path">node</a></span> that mounted
the disk.</p><p><b>rpc_status: </b>A 32-bit integer used to indicate
success or failure. The <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> runtime MUST
indicate, by writing to this parameter, whether it succeeded in executing this
method on the server. The encoding of the value passed in this parameter MUST
conform to encoding for comm_status and fault_status, as specified in Appendix
E of <span><a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a></span>.</p><p><b>Return Values: </b>The method MUST return the
following error codes for the specified conditions.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 ERROR_SUCCESS</td>
  <td>Success.</td>
 </tr><tr>
  <td>0x000003E5 ERROR_IO_PENDING</td>
  <td>The operation is still in progress.</td>
 </tr><tr>
  <td>0x00000046 ERROR_SHARING_PAUSED</td>
  <td>The current protocol server state of the server is not read/write.</td>
 </tr><tr>
  <td>0x000006D1 RPC_S_PROCNUM_OUT_OF_RANGE</td>
  <td>The server does not support this method.</td>
 </tr><tr>
  <td>0x000013B8 ERROR_CLUSTER_INVALID_REQUEST</td>
  <td>The operation is invalid for the cluster or for the specified resource . It is invalid for the cluster if the dwState parameter is 1 and the requested state is not enabled for the cluster; for instance, the server EnableSharedVolumes state is FALSE (indicating that the server does not support cluster shared volumes) (see section 3.1.1.4). The operation is invalid for the specified resource if any of the following conditions are met:  The dwState parameter is 1, and the specified resource is already deployed to an application/service.  The dwState parameter is 1, and the specified resource is in maintenance mode (see section 3.1.1.1.1.2).  The dwState parameter is 1, and the specified resource depends on one or more additional resources.  The dwState parameter is 0, and the specified resource does not currently allow volumes to be shared to all nodes in a cluster (ResourceSharedVolumes is already FALSE).</td>
 </tr><tr>
  <td>0x000013D7 ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED</td>
  <td>The dwState parameter is 1 and the specified resource is not of the correct type. Shared access can only be enabled for resources that are of the Physical Disk Resource type.</td>
 </tr><tr>
  <td>0x0000138C ERROR_RESOURCE_NOT_ONLINE</td>
  <td>The dwState parameter is 1 and the specified resource is not online. The resource MUST be online to enable shared access.</td>
 </tr></tbody></table>
</dd></dl><p>For any other condition, this method returns a value that is
not one of the values listed in the preceding table. The <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a></span>
MUST behave in one consistent, identical manner for all values that are not
listed in the preceding table. The client treats errors specified in <span><a href="ca75805a-4b39-4074-8b5b-dbaae6e81b1f" data-linktype="relative-path">3.2.4.6</a></span>
as recoverable errors and initiate the reconnect procedure as specified in
section 3.2.4.6.</p></div>