AccessNtmsLibraryDoor function (ntmsapi.h)

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

The AccessNtmsLibraryDoor function unlocks the door of the specified library. If the library is busy, RSM queues the request and returns successfully.

Syntax

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

Parameters

[in] hSession

Handle to the session returned by the OpenNtmsSession function.

[in] lpLibraryId

Unique identifier of the library object. This library must support door access.

[in] dwAction

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

Value Meaning
NTMS_INVENTORY_NONE
After the user closes the door, no inventory is performed. However, if a mount-label check fails, an inventory will be performed.
NTMS_INVENTORY_OMID
After the user closes the door, a full on-media inventory is performed. This can be time consuming because each side of each medium must be mounted.
NTMS_INVENTORY_FAST
If the library has a bar-code reader installed, this flag causes 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 InventoryMethod specified in the library object (see NTMS_LIBRARYINFORMATION).

Return value

This function returns one of the following values.

Value Meaning
ERROR_ACCESS_DENIED
NTMS_CONTROL_ACCESS to the library is denied. Other security errors are also possible, but they would indicate a security subsystem error.
ERROR_DATABASE_FAILURE
The database is inaccessible or damaged.
ERROR_DATABASE_FULL
The database is full.
ERROR_INVALID_HANDLE
The session ID is missing or is not valid.
ERROR_INVALID_PARAMETER
The library ID is missing.
ERROR_LIBRARY_OFFLINE
The library ID references an offline library without a door.
ERROR_NOT_ENOUGH_MEMORY
An allocation failure occurred during processing.
ERROR_RESOURCE_DISABLED
The library is disabled.
ERROR_RESOURCE_NOT_PRESENT
The library does not have a door.
ERROR_SUCCESS
Door access is queued.

Remarks

Some libraries provide no means for RSM to programmatically lock and unlock their doors. The behavior of this function with these libraries is identical to its behavior with libraries that RSM can unlock and lock.

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

See also

EjectNtmsMedia

InjectNtmsMedia

Library Control Functions