<div class="content" name="EjectNtmsCleaner" uuid="9b910aed-5fa5-439c-ba51-8355c315b024"><p>The EjectNtmsCleaner method <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_a22dff61-81ae-4414-8242-3d28f4c70c31" data-linktype="relative-path">ejects</a> the cleaning <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_a71cfd0c-a569-4544-8127-7ae496bca92b" data-linktype="relative-path">cartridge</a> from the
currently reserved <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_95e53eb6-39e3-43ed-905e-ff1f427446d2" data-linktype="relative-path">cleaner</a>
<a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_a1f0ab90-f3c0-46b8-9c77-d0d7508ede94" data-linktype="relative-path">slot</a>.</p><dl>
<dd>
<div><pre> HRESULT EjectNtmsCleaner(
   [in] LPNTMS_GUID lpLibrary,
   [in, out] LPNTMS_GUID lpEjectOperation,
   [in] DWORD dwAction
 );
</pre></div>
</dd></dl><p><b>lpLibrary: </b>A pointer to the identifier of the
media library from which the cleaner will be ejected.</p><p><b>lpEjectOperation: </b>A pointer to GUID of the
insert process library operation. If the value of <b>dwAction</b> is
NTMS_EJECT_START, this parameter receives the GUID of the operation from
server; if the value of <b>dwAction</b> is NTMS_EJECT_STOP, this parameter must
be set to the GUID of the operation to be stopped.</p><p><b>dwAction: </b> One of the NTMS_EJECT_START or
NTMS_EJECT_STOP values from the <a href="6e787121-1c98-4390-a34b-c5e9ce2d33d6" data-linktype="relative-path">NtmsEjectOperation (section 2.2.2.1)</a>
enumeration, specifying the operation to perform.</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>Access to one or more objects is denied.</td>
 </tr><tr>
  <td>0x80070006 ERROR_INVALID_HANDLE</td>
  <td>The session handle is invalid.</td>
 </tr><tr>
  <td>0x80070008 ERROR_NOT_ENOUGH_MEMORY</td>
  <td>Not enough storage is available to process this command.</td>
 </tr><tr>
  <td>0x80070057 ERROR_INVALID_PARAMETER</td>
  <td>The parameter is incorrect.</td>
 </tr><tr>
  <td>0x800708CA ERROR_NOT_CONNECTED</td>
  <td>Unable to connect to the server.</td>
 </tr><tr>
  <td>0x800710CD ERROR_INVALID_LIBRARY</td>
  <td>The library is not found in the database.</td>
 </tr><tr>
  <td>0x800710D1 ERROR_LIBRARY_OFFLINE</td>
  <td>The library identifier refers to an offline library.</td>
 </tr><tr>
  <td>0x800710D5 ERROR_RESOURCE_DISABLED</td>
  <td>A resource required for this operation is disabled.</td>
 </tr><tr>
  <td>0x800710DD ERROR_INVALID_OPERATION</td>
  <td>The NTMS_EJECT_STOP action was performed on an invalid operation identifier.</td>
 </tr></tbody></table>
</dd></dl><p>Upon receiving this message, the server MUST verify that
both <i>lpLibrary</i> and <i>lpEjectOperation</i> are not NULL, and that
dwAction is equal to NTMS_EJECT_START or NTMS_EJECT_STOP. 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
access rights to the library and verify that the library is enabled and online
before processing further. If the client does not have the required access
rights, the server MUST return ERROR_ACCESS_DENIED (0x80070005). If the library
or drive is disabled, the server MUST return ERROR_RESOURCE_DISABLED
(0x800710D5). If the library is offline, the server MUST return ERROR_LIBRARY_OFFLINE
(0x800710D1).</p><p>The action taken by the server depends on the value of <i>dwAction</i>.
The following table lists all possible values for <i>dwAction</i>.</p><table><thead>
  <tr>
   <th>
   <p> Value </p>
   </th>
   <th>
   <p> Meaning </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>NTMS_EJECT_START</td>
  <td>Starts the eject operation with a port. The specified medium is ejected until the time-out event occurs or the method is called again with NTMS_EJECT_STOP. The time-out value is specified in the library object and is applied to all ejections in the library.</td>
 </tr><tr>
  <td>NTMS_EJECT_STOP</td>
  <td>For libraries with NTMS_IEPORT objects, terminates the ejection process that is specified by lpEjectOperation prior to the time-out event lapsing. For libraries without NTMS_IEPORT objects, the server MUST return ERROR_INVALID_OPERATION.</td>
 </tr></tbody></table><p>The EjectNtmsCleaner method ejects the cleaning cartridge
from the currently reserved cleaner slot.</p><p>If the library that is specified in the EjectNtmsCleaner
method has an NTMS_IEPORT object, RSM uses the NTMS_IEPORT object to eject the
cleaner. If there is no NTMS_IEPORT object, the NTMS_IEDOOR object is used to
allow the operator to gain access to the cleaner slot.</p><p>Ejected cleaner cartridges are not tracked in the <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_f248d7b8-b3e9-421e-96c4-78551324fd86" data-linktype="relative-path">offline library</a>.</p><p>On completion of an asynchronous operation, notification
will be sent with the identifier lpEjectOperation.</p></div>