3.2.5.2.1.11 INtmsLibraryControl1::EjectNtmsCleaner (Opnum 14)

The EjectNtmsCleaner method ejects the cleaning cartridge from the currently reserved cleaner slot.

 HRESULT EjectNtmsCleaner(
   [in] LPNTMS_GUID lpLibrary,
   [in, out] LPNTMS_GUID lpEjectOperation,
   [in] DWORD dwAction
 );

lpLibrary: A pointer to the identifier of the media library from which the cleaner will be ejected.

lpEjectOperation: A pointer to GUID of the insert process library operation. If the value of dwAction is NTMS_EJECT_START, this parameter receives the GUID of the operation from server; if the value of dwAction is NTMS_EJECT_STOP, this parameter must be set to the GUID of the operation to be stopped.

dwAction:  One of the NTMS_EJECT_START or NTMS_EJECT_STOP values from the NtmsEjectOperation (section 2.2.2.1) enumeration, specifying the operation to perform.

Return value/code

Description

0x00000000

S_OK

The call was successful.

0x80070005

ERROR_ACCESS_DENIED

Access to one or more objects is denied.

0x80070006

ERROR_INVALID_HANDLE

The session handle is invalid.

0x80070008

ERROR_NOT_ENOUGH_MEMORY

Not enough storage is available to process this command.

0x80070057

ERROR_INVALID_PARAMETER

The parameter is incorrect.

0x800708CA

ERROR_NOT_CONNECTED

Unable to connect to the server.

0x800710CD

ERROR_INVALID_LIBRARY

The library is not found in the database.

0x800710D1

ERROR_LIBRARY_OFFLINE

The library identifier refers to an offline library.

0x800710D5

ERROR_RESOURCE_DISABLED

A resource required for this operation is disabled.

0x800710DD

ERROR_INVALID_OPERATION

 The NTMS_EJECT_STOP action was performed on an invalid operation identifier.

Upon receiving this message, the server MUST verify that both lpLibrary and lpEjectOperation 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).

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).

The action taken by the server depends on the value of dwAction. The following table lists all possible values for dwAction.

 Value

 Meaning

NTMS_EJECT_START

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.

NTMS_EJECT_STOP

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.

The EjectNtmsCleaner method ejects the cleaning cartridge from the currently reserved cleaner slot.

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.

Ejected cleaner cartridges are not tracked in the offline library.

On completion of an asynchronous operation, notification will be sent with the identifier lpEjectOperation.