DismountNtmsMedia function (ntmsapi.h)
[Removable Storage Manager is no longer available as of Windows 7 and Windows Server 2008 R2.]
The DismountNtmsMedia function queues a command to move the specified media in a drive to its storage. This function should be paired with the MountNtmsMedia function.
Syntax
DWORD DismountNtmsMedia(
[in] HANDLE hSession,
[in] LPNTMS_GUID lpMediaId,
[in] DWORD dwCount,
[in] DWORD dwOptions
);
Parameters
[in] hSession
Handle to the session returned by the OpenNtmsSession function.
[in] lpMediaId
Array of at least one logical medium or side.
[in] dwCount
Number of media identifiers in the lpMediaId parameter.
[in] dwOptions
Options. This parameter can be the following value.
Return value
This function returns one of the following values.
Value | Meaning |
---|---|
|
NTMS_USE_ACCESS to the media pool or library that contains the media is denied. Other security errors are also possible, but they would indicate a security subsystem error. |
|
The database is inaccessible or damaged. |
|
The database is full. |
|
One or more resources required to perform the dismount are not currently available (probably disabled). |
|
The library that contains the media is not valid. |
|
At least one of the specified media is not valid. |
|
An unexpected media or device state occurred during dismount. |
|
The specified media is offline. |
|
One or more media resources required to perform the mount are not currently available (probably disabled). |
|
A memory allocation failure occurred during processing. |
|
The media dismount has been queued. |
|
The time-out event expired while the application attempted to acquire one or more resources. |
Remarks
An application must use the DismountNtmsMedia function to release the drive resource after the application has used the specified medium. Unreleased media cannot be used by other RSM sessions.
The DismountNtmsMedia function returns as soon as the operation is queued with RSM. The application can wait for the side state to become idle.
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 |