<div class="content"><p align="right"><a href="https://msdn.microsoft.com/en-us/library/c5fc15b0-5cbe-4403-acf3-433be8e5b5a6" data-linktype="external">msdn link</a></p><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 <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a> 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 <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_9a876829-33a1-4f0b-8b81-8552b7e5561c" data-linktype="relative-path">volumes</a> associated with <i>hResource</i>
to <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_feef37b3-c173-4f51-aab6-b55a6366259b" data-linktype="relative-path">cluster</a> 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 <a href="2cec8d2a-040c-4741-8bf0-ecd4b33de67f" data-linktype="relative-path">3.1.1.1.4</a>.</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
<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 the server 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><p>The server MUST require that the access level associated
with the <i>hResource</i> context handle is &#34;All&#34; (section <a href="a249a463-3d3b-4058-abf6-3024d81806a0" data-linktype="relative-path">3.1.4</a>).</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 <a href="181f8de0-f518-4c5b-b98e-ddb18aa325ce" data-linktype="relative-path">ApiOpenResource</a>,
<a href="6595931d-2fe5-4097-9270-f6bada5d9242" data-linktype="relative-path">ApiOpenResourceEx</a>, or <a href="bc6ca940-7177-4bef-9567-ae4a692a2ba5" data-linktype="relative-path">ApiCreateResource</a> 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 <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_762051d8-4fdc-437e-af9d-3f4da77c3c7d" data-linktype="relative-path">node</a> that
mounted the disk.</p><p><b>rpc_status: </b>A 32-bit integer used to indicate
success or failure. The <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a>
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 <a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a>.</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>
  <p>0x00000000</p>
  <p>ERROR_SUCCESS </p>
  </td>
  <td>
  <p>Success.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x000003E5</p>
  <p>ERROR_IO_PENDING</p>
  </td>
  <td>
  <p>The operation is still in progress.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000046</p>
  <p>ERROR_SHARING_PAUSED</p>
  </td>
  <td>
  <p>The current protocol server state of the server is not
  read/write.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x000006D1</p>
  <p>RPC_S_PROCNUM_OUT_OF_RANGE</p>
  </td>
  <td>
  <p>The server does not support this method.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x000013B8</p>
  <p>ERROR_CLUSTER_INVALID_REQUEST</p>
  </td>
  <td>
  <p>The operation is invalid for the cluster or for the
  specified <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_94e97f15-2f1a-406f-a740-607bb97761ec" data-linktype="relative-path">resource</a> .
  It is invalid for the cluster if the <i>dwState</i> 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 <a href="d6de4d86-f7c9-47e6-9fef-6f2fd861aee5" data-linktype="relative-path">3.1.1.4</a>). The operation
  is invalid for the specified resource if any of the following conditions are
  met:</p>
  <ul><li><p><span><span>  
  </span></span><span>The <i>dwState</i> parameter is
  1, and the specified resource is already deployed to an application/service.</span></p>
  </li><li><p><span><span>  
  </span></span><span>The <i>dwState</i> parameter is
  1, and the specified resource is in maintenance mode (see section <a href="cb073cf4-d214-41b4-bc15-095d4e3d4f13" data-linktype="relative-path">3.1.1.1.1.2</a>).</span></p>
  </li><li><p><span><span>  
  </span></span><span>The <i>dwState</i> parameter is
  1, and the specified resource depends on one or more additional resources.</span></p>
  </li><li><p><span><span>  
  </span></span><span>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).</span></p>
  </li></ul></td>
 </tr><tr>
  <td>
  <p>0x000013D7</p>
  <p>ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED</p>
  </td>
  <td>
  <p>The <i>dwState</i> 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.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x0000138C</p>
  <p>ERROR_RESOURCE_NOT_ONLINE</p>
  </td>
  <td>
  <p>The <i>dwState</i> parameter is 1 and the specified
  resource is not online. The resource MUST be online to enable shared access.</p>
  </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 <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a> MUST behave in one
consistent, identical manner for all values that are not listed in the
preceding table. The client treats errors specified in <a href="ca75805a-4b39-4074-8b5b-dbaae6e81b1f" data-linktype="relative-path">3.2.4.6</a> as recoverable
errors and initiate the reconnect procedure as specified in section 3.2.4.6.</p></div>