<div class="content" name="MoveToNtmsMediaPool" uuid="c67d6e20-0477-49cb-a04d-ede061817ae3"><p>The MoveToNtmsMediaPool method moves a medium from its
current media pool to another media pool.</p><dl>
<dd>
<div><pre> HRESULT MoveToNtmsMediaPool(
   [in] LPNTMS_GUID lpMediaId,
   [in] LPNTMS_GUID lpPoolId
 );
</pre></div>
</dd></dl><p><b>lpMediaId: </b>A pointer to the identifier of a <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_9036b269-4f3b-4353-a1d0-54f5c686ec2c" data-linktype="relative-path">physical medium</a>.</p><p><b>lpPoolId:</b>  A pointer to the identifier of a
media pool to which the medium is to be moved.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 S_OK</td>
  <td>The call was successful.</td>
 </tr><tr>
  <td>0x80070005 ERROR_ACCESS_DENIED</td>
  <td>NTMS_MODIFY_ACCESS to the library is denied; other security errors are possible, but indicate a security subsystem error.</td>
 </tr><tr>
  <td>0x80070008 ERROR_NOT_ENOUGH_MEMORY</td>
  <td>An allocation failure occurred during processing.</td>
 </tr><tr>
  <td>0x80070057 ERROR_INVALID_PARAMETER</td>
  <td>The parameter is missing or invalid.</td>
 </tr><tr>
  <td>0x800700AA ERROR_BUSY</td>
  <td>A side of the media is in use or currently unavailable.</td>
 </tr><tr>
  <td>0x800710CC ERROR_INVALID_MEDIA</td>
  <td>The source media or implied source media pool is invalid.</td>
 </tr><tr>
  <td>0x800710CE ERROR_INVALID_MEDIA_POOL</td>
  <td>Either the destination media pool is invalid, or media in the unrecognized or import pool can be moved only to the free pool.</td>
 </tr><tr>
  <td>0x800710D9 ERROR_DATABASE_FAILURE</td>
  <td>The database is inaccessible or damaged.</td>
 </tr><tr>
  <td>0x800710DA ERROR_DATABASE_FULL</td>
  <td>The database is full.</td>
 </tr><tr>
  <td>0x800710DB ERROR_MEDIA_INCOMPATIBLE</td>
  <td>The source media type differs from the media type of the destination pool.</td>
 </tr></tbody></table>
</dd></dl><p>Upon receiving this message, the server MUST verify that <i>lpMediaId</i>
and <i>lpPoolId</i> are not NULL. If parameter validation fails, the server
MUST immediately fail the operation and return ERROR_INVALID_PARAMETER
(0x80070057).</p><p>If parameter validation succeeds, the server MUST check that
the user has the required access rights, ensure that all the partitions of the
media about to be moved are currently available, and then MUST move the
specified medium from its current media pool to the specified media pool. If
the client does not have the required access rights, the server MUST return
ERROR_ACCESS_DENIED (0x80070005).</p><p>The destination pool specified in the MoveToNtmsMediaPool
method MUST be of the same media type and have compatible security.</p><p>The server MUST write an <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_e88a9ca7-9b8d-4dca-9338-59c98e1a5f13" data-linktype="relative-path">on-media identifier</a> to
media before moving the media into the free media pool.</p><p>A medium having a partition in the completed, <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_0e546e86-71c4-45cc-9ef1-4a78f6cb425a" data-linktype="relative-path">allocated</a>, or reserved
state MUST NOT be moved to the free media pool. A medium MAY be moved to an
import pool only if all the partitions of the medium are in the import state.<a id="Appendix_A_Target_32"></a><a aria-label="Product behavior note 32" href="7184b376-4ee3-4482-b9c4-f87ff22b421f#Appendix_A_32" data-linktype="relative-path">&lt;32&gt;</a></p><p>On completion of an asynchronous operation, notification
will be sent with the identifier lpPoolId.</p></div>