3.2.5.2.2.2 INtmsMediaServices1::DismountNtmsMedia (Opnum 4)

The DismountNtmsMedia method queues a command to move a medium in a drive to its storage.

 HRESULT DismountNtmsMedia(
   [in, size_is(dwCount)] LPNTMS_GUID lpMediaId,
   [in] DWORD dwCount,
   [in] DWORD dwOptions
 );

lpMediaId: An array of logical media or media side identifiers.

dwCount: The number of elements in the lpMediaId array.

dwOptions: One of the options from the NtmsDismountOptions (section 2.2.1.9) numeration.

Return value/code

Description

0x00000000

S_OK

The call was successful.

0x80070005

ERROR_ACCESS_DENIED

NTMS_USE_ACCESS to the media pool or library that contains the media is denied; other security errors are possible, but indicate a security subsystem error.

0x80070057

ERROR_INVALID_PARAMETER

A parameter is missing.

0x800710D9

ERROR_DATABASE_FAILURE

The database is inaccessible or damaged.

0x800710DA

ERROR_DATABASE_FULL

The database is full.

0x800710DF

ERROR_DEVICE_NOT_AVAILABLE

One or more resources required to perform the dismount are not currently available.

0x800710CD

ERROR_INVALID_LIBRARY

The library that contains the drives or media is not valid.

0x800710CC

ERROR_INVALID_MEDIA

A medium is not valid, or lpMediaId contains duplicate identifiers.

0x8007139F

ERROR_INVALID_STATE

An unexpected media or device state occurred during dismount.

0x800710D0

ERROR_MEDIA_OFFLINE

The specified media is offline.

0x80070008

ERROR_NOT_ENOUGH_MEMORY

A memory allocation failure occurred during processing.

0x800705B4

ERROR_TIMEOUT

The time-out event expired while the application attempted to acquire one or more resources.

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

The DismountNtmsMedia method MUST return as soon as the operation is queued with the server. The application can wait for the side state to become idle. An application MUST use the DismountNtmsMedia method to release the drive resource after the application has used the specified medium. Unreleased media cannot be used by other RSM sessions.

On completion of an asynchronous operation, notification is sent with the identifier lpMediaId.