InjectNtmsCleaner function (ntmsapi.h)
[Removable Storage Manager is no longer available as of Windows 7 and Windows Server 2008 R2.]
The InjectNtmsCleaner function allows a cleaner cartridge to be inserted into the specified library unit.
Syntax
DWORD InjectNtmsCleaner(
[in] HANDLE hSession,
[in] LPNTMS_GUID lpLibrary,
[in, out] LPNTMS_GUID lpInjectOperation,
[out] DWORD dwNumberOfCleansLeft,
[in] DWORD dwAction
);
Parameters
[in] hSession
Handle to the session returned by the OpenNtmsSession function.
[in] lpLibrary
Unique identifier of a library object.
[in, out] lpInjectOperation
GUID of the insert process library operation. If dwAction is NTMS_INJECT_START, this parameter receives the GUID for the operation. If dwAction is NTMS_INJECT_STOP, this parameter must be set to the GUID for the operation to be stopped.
[out] dwNumberOfCleansLeft
Number of cleaning cycles left on the inserted cleaning cartridge.
[in] dwAction
This parameter can be one of the following values.
Return value
This function returns one of the following values.
Value | Meaning |
---|---|
|
Access to at least one RSM object is denied. |
|
The library is not currently connected. |
|
The value specified in the hSession parameter is not valid. |
|
Unable to retrieve the library definition from the database. |
|
The library must be online for a cleaner cartridge to be inserted. |
|
This library has no slot reserved as a cleaner slot. |
|
A cleaner slot is reserved but already has a cleaner cartridge. The cleaner cartridge must be ejected first, using the EjectNtmsCleaner function. |
|
A cleaner slot is reserved but the slot specified is currently not installed in the library. This error occurs if at least one magazine is missing from the library. |
|
The function was successful. |
Remarks
This function returns to the application as soon as the insert request is queued.
To use the InjectNtmsCleaner function, the number of cleaning cycles that remain on the cleaner cartridge must be specified so that RSM can keep track of it.
If an NTMS_IEPORT object is available, the NTMS_IEPORT object directs the cartridge to the currently reserved cleaner slot.
If there is no NTMS_IEPORT object, a door access is performed. In this case, the operator is directed to place the media into the reserved slot.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | ntmsapi.h |
Library | Ntmsapi.lib |
DLL | Ntmsapi.dll |