InventoryNtmsLibrary function

[Removable Storage Manager is no longer available as of Windows 7 and Windows Server 2008 R2.]

The InventoryNtmsLibrary function queues an inventory of the specified library. If the library is busy, RSM queues InventoryNtmsLibrary and returns success.

Syntax

DWORD InventoryNtmsLibrary(
  HANDLE      hSession,
  LPNTMS_GUID lpLibraryId,
  DWORD       dwAction
);

Parameters

hSession

Handle to the session returned by the OpenNtmsSession function.

lpLibraryId

Unique identifier of a library object.

dwAction

Action to perform. This parameter can be one of the following values.

Value Meaning
NTMS_INVENTORY_OMID
A full on-media inventory is performed. Each side of each medium must be mounted into a drive. This is a time consuming process.
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 InventoryMethod specified in the library object (see NTMS_LIBRARYINFORMATION).
NTMS_INVENTORY_STOP
Stop the current inventory in the specified library.

Return Value

This function returns one of the following values.

Value Meaning
ERROR_ACCESS_DENIED
Access to one or more RSM objects is denied.
ERROR_DEVICE_NOT_AVAILABLE
The library is not currently connected.
ERROR_INVALID_HANDLE
The value specified in the hSession parameter is not valid.
ERROR_INVALID_LIBRARY
The library is the offline library.
ERROR_INVALID_PARAMETER
The library ID or session ID is not valid.
ERROR_NOT_CONNECTED
Unable to connect to the RSM service.
ERROR_SUCCESS
The function was successful.

Remarks

Not present libraries cannot be inventoried.

The InventoryNtmsLibrary function marks all the slots that currently contain a medium in the library for classification/identification. The InventoryNtmsLibrary function returns when all the media is marked.

Requirements

   
Windows version Windows XP [desktop apps only] Windows Server 2003 [desktop apps only]
Target Platform Windows
Header ntmsapi.h
Library Ntmsapi.lib
DLL Ntmsapi.dll

See Also

AccessNtmsLibraryDoor

Library Control Functions