<div class="content" name="ChangeNtmsMediaType" uuid="a9bd984b-c0ad-4bf7-8a44-7abcb8f95e59"><p> The ChangeNtmsMediaType method moves a physical <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_746b1ad1-e1ad-4120-9986-fef919a2eaf7" data-linktype="relative-path">media identifier</a> to a new
media pool and sets the media type of the medium to that of the pool.</p><dl>
<dd>
<div><pre> HRESULT ChangeNtmsMediaType(
   [in] LPNTMS_GUID lpMediaId,
   [in] LPNTMS_GUID lpPoolId
 );
</pre></div>
</dd></dl><p><b>lpMediaId: </b>A pointer to the identifier of the <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_9036b269-4f3b-4353-a1d0-54f5c686ec2c" data-linktype="relative-path">physical media</a> to be moved.</p><p><b>lpPoolId: </b> A pointer to the identifier of the
media pool to which the media will be <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_0e546e86-71c4-45cc-9ef1-4a78f6cb425a" data-linktype="relative-path">allocated</a>.</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 media pool of the media is denied.</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 media pool or media identifiers are missing.</td>
 </tr><tr>
  <td>0x800710CC ERROR_INVALID_MEDIA</td>
  <td>The media identifier is not valid.</td>
 </tr><tr>
  <td>0x800710CE ERROR_INVALID_MEDIA_POOL</td>
  <td>The identifier of the media pool is invalid.</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></tbody></table>
</dd></dl><p>Upon receiving this message, the server MUST verify that
both <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 verify
that the user has the required access rights and that the library is enabled
and online. If the client does not have the required access rights, the server
MUST return ERROR_ACCESS_DENIED (0x80070005). If the library is offline, the
server MUST return ERROR_LIBRARY_OFFLINE (0x800710D1).</p><p>The ChangeNtmsMediaType method uses the same policy for
moving media as the method specified in <a href="https://go.microsoft.com/fwlink/?LinkId=90043" data-linktype="external">[MSDN-MoveToNtmsMediaPool]</a>.
A medium having a partition in the completed, allocated, or reserved state MUST
NOT be moved to the free media pool. A medium can be moved to an <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_c74372fa-bcae-4710-8b24-996fa2b676ac" data-linktype="relative-path">import pool</a> only if all the
partitions of the medium are in the import state.</p><p>Unrecognized media can only be moved to the <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_58cd2daf-1d47-44a9-a725-a9459fd5efaf" data-linktype="relative-path">free pool</a>.</p><p>If moving the given media to specified media pool is an
invalid operation, it MUST return ERROR_INVALID_MEDIA_POOL (0x800710CE).</p><p>On completion of an asynchronous operation, notification is
sent with the identifier <b>lpMediaId</b>.</p></div>