3.2.5.2.1.6 INtmsLibraryControl1::InventoryNtmsLibrary (Opnum 8)

The InventoryNtmsLibrary method queues a request to perform an inventory of an online library.

 HRESULT InventoryNtmsLibrary(
   [in] LPNTMS_GUID lpLibraryId,
   [in] DWORD dwAction
 );

lpLibraryId: A pointer to the identifier of a media library.

dwAction:  One of the NTMS_INVENTORY_STOP, NTMS_INVENTORY_OMID, NTMS_INVENTORY_FAST, or NTMS_INVENTORY_DEFAULT values from the NtmsInventoryMethod enumeration, specifying the action to perform.

Return value/code

Description

0x00000000

S_OK

The call was successful.

0x80070005

ERROR_ACCESS_DENIED

Access to the object was denied.

0x80070057

ERROR_INVALID_PARAMETER

A parameter is not valid.

0x800708CA

ERROR_NOT_CONNECTED

Unable to connect to the server.

0x800710D1

ERROR_LIBRARY_OFFLINE

The library identifier refers to an offline library.

0x800710D5

ERROR_RESOURCE_DISABLED

A resource required for this operation is disabled.

0x800710CD

ERROR_INVALID_LIBRARY

The library identifier is invalid.

Upon receiving this message, the server MUST verify that lpLibraryId is not NULL. If parameter validation fails, the server MUST immediately fail the operation and return ERROR_INVALID_PARAMETER (0x80070057).

If parameter validation succeeds, the server MUST get the library selected from the database, check the access to the library, and verify that the library is enabled and is online before making the call. If the client does not have the required access rights, the server MUST return ERROR_ACCESS_DENIED. If the library 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_INVENTORY_OMID

A full on-media inventory is performed. Each side of each medium MUST be mounted into a drive.

NTMS_INVENTORY_FAST

If the library has a bar code reader installed, this flag causes a bar code inventory to be performed. If the library does not have a bar code reader, this flag causes a differential inventory to be performed (slots are classified).

NTMS_INVENTORY_DEFAULT

Use the inventory method specified in the library object (for more information, see the description of the NTMS_LIBRARYINFORMATION structure).

NTMS_INVENTORY_STOP

Stop the current inventory in the specified library.

The libraries that are not present MUST not be inventoried.

The InventoryNtmsLibrary method MUST mark all the slots that currently contain a medium in the library for classification or identification. The InventoryNtmsLibrary method returns when all the media is marked.

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