[Removable Storage Manager is no longer available as of Windows 7 and Windows Server 2008 R2.]
The DisableNtmsObject function disables the specified RSM object.
DWORD DisableNtmsObject( __in HANDLE hSession, __in DWORD dwType, __in LPNTMS_GUID lpObjectId );
Handle to the session returned by the OpenNtmsSession function.
RSM object type. This parameter can be one of the following values from the NtmsObjectsTypes enumeration type.
Value Meaning NTMS_DRIVE
Physical media (tape, optical disk, CD, or magnetic cartridge)
Unique identifier of the RSM object.
This function returns one of the following values.
NTMS_MODIFY_ACCESS to the library containing the object is denied. Other security errors are possible, but indicate a security subsystem error.
The database is inaccessible or damaged.
The session handle is missing or is not valid.
An object ID is missing or the object type is not valid. (The object type is not valid if it is not NTMS_LIBRARY, NTMS_DRIVE, or NTMS_PHYSICAL_MEDIA.)
The object is already disabled.
The library ID refers to an off-line library that cannot be enabled or disabled.
The object is not valid.
The disable is queued.
The DisableNtmsObject function queues a disable command for the specified object. The function returns successfully when the command is queued. If RSM is busy, the command can take some time to complete. When the medium is disabled, RSM renders all of the media's sides and associated logical media unavailable. All requests to disabled media return errors.
To remove a drive or media changer from service the drive or media changer must first be disabled.
All objects contained by a disabled object are also disabled. For example, disabling a piece of physical media disables all sides. Whenever possible, when a drive is disabled, the medium in the drive is removed and placed in its slot.
Minimum supported client
|Windows 2000 Professional|
Minimum supported server
|Windows 2000 Server|
End of client support
End of server support
|Windows Server 2008|
Build date: 6/9/2011