3.2.5.2.1.3 INtmsLibraryControl1::AccessNtmsLibraryDoor (Opnum 5)

The AccessNtmsLibraryDoor method unlocks the door of an online library.

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

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

dwAction: One of the NTMS_INVENTORY_NONE, NTMS_INVENTORY_OMID, NTMS_INVENTORY_FAST, or NTMS_INVENTORY_DEFAULT values from the NtmsInventoryMethod enumeration, specifying the action to perform when the door is closed.

Return value/code

Description

0x00000000

S_OK

The call was successful.

0x80070005

ERROR_ACCESS_DENIED

NTMS_CONTROL_ACCESS to the library is denied; other security errors are possible but indicate a security subsystem error.

0x80070057

ERROR_INVALID_PARAMETER

A parameter is not valid.

0x800700D1

ERROR_LIBRARY_OFFLINE

A library identifier refers to an offline library.

0x800710D5

ERROR_RESOURCE_DISABLED

The resource required for this operation is disabled.

0x800710DC

ERROR_RESOURCE_NOT_PRESENT

The resource that is required for this operation does not exist.

0x800710D9

ERROR_DATABASE_FAILURE

The database query or update failed.

Upon receiving this message, the server MUST:

  • Verify that lpLibraryId is not NULL.

  • Verify that dwAction is less than NTMS_INVENTORY_MAX.

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 the access to the library and verify that the library is enabled and online before making the call. If the library is disabled, the server MUST return ERROR_RESOUCE_DISABLED (0x800710D5). If the library is offline, the server MUST return ERROR_LIBRARY_OFFLINE (0x800710D1).

If the library does not have a door, the server MUST return ERROR_RESOURCE_NOT_PRESENT (0x800710DC).

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_NONE

After the user closes the door, no inventory is performed. However, if a mount-label check fails, an inventory is performed.

NTMS_INVENTORY_OMID

After the user closes the door, a full on-media inventory is performed.

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. The OMIDs are checked on each medium placed in an empty slot while the door is open.

NTMS_INVENTORY_DEFAULT

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

The server programmatically unlocks the door of the specified library. If the library is busy, the server MUST queue the request and return success.

The failure or success of this method MUST NOT depend on the type of library. Some libraries provide no means for the server to programmatically lock and unlock their doors. The behavior of this method with these libraries is identical to its behavior with libraries that the server can unlock and lock.

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