<div class="content" name="DeleteNtmsMediaType" uuid="ba9ece7b-b62d-49c0-9d72-98099101aae7"><p>The DeleteNtmsMediaType method deletes a media type from a
library.</p><dl>
<dd>
<div><pre> HRESULT DeleteNtmsMediaType(
   [in] LPNTMS_GUID lpMediaTypeId,
   [in] LPNTMS_GUID lpLibId
 );
</pre></div>
</dd></dl><p><b>lpMediaTypeId: </b>A pointer to the identifier of
a media type to delete from the library.</p><p><b>lpLibId: </b> A pointer to the identifier of the
library from which to delete the media type.</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 media type or library identifiers are missing.</td>
 </tr><tr>
  <td>0x800710CD ERROR_INVALID_LIBRARY</td>
  <td>The library identifier is invalid.</td>
 </tr><tr>
  <td>0x800710D3 ERROR_NOT_EMPTY</td>
  <td>The media pool must be empty to be deleted.</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>lpLibId</i> and <i>lpMediaTypeId</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. If the client does not have the
required access rights, the server MUST return ERROR_ACCESS_DENIED
(0x80070005).</p><p>The library MUST NOT have any media of the type specified by
<i>lpMediaTypeId</i> in it to perform this operation. If the library contains
media of the type specified by <i>lpMediaTypeId</i>, the server MUST return
ERROR_NOT_EMPTY (0x800710D3).</p><p>If there are no <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_9036b269-4f3b-4353-a1d0-54f5c686ec2c" data-linktype="relative-path">physical media</a> objects of
the specified media type in the server system and there are no library objects
that contain the specified media type relation in the server system, the system
media pools for that media type MUST be deleted. Inability to delete the system
media pools does not cause the DeleteNtmsMediaType method to fail.</p></div>