EnableNtmsObject Function
[Removable Storage Manager is no longer available as of Windows 7 and Windows Server 2008 R2.]
The EnableNtmsObject function enables the specified object.
Syntax
DWORD EnableNtmsObject(
__in HANDLE hSession,
__in DWORD dwType,
__in LPNTMS_GUID lpObjectId
);
Parameters
hSession [in]
Handle to the session returned by the OpenNtmsSession function.dwType [in]
RSM object type. This parameter can be one of the following values from the NtmsObjectsTypes enumeration type.Value Meaning NTMS_DRIVE Drive
NTMS_LIBRARY Library
NTMS_PHYSICAL_MEDIA Physical media (tape, optical disk, CD, or magnetic disk cartridge)
lpObjectId [in]
Unique identifier of the RSM object.
Return Value
This function returns one of the following values.
Value | Meaning |
---|---|
ERROR_ACCESS_DENIED | NTMS_MODIFY_ACCESS to the library containing the object is denied. Other security errors are possible, but they indicate a security subsystem error.
|
ERROR_DATABASE_FAILURE | The database is inaccessible or damaged. |
ERROR_INVALID_HANDLE | The session handle is missing or is not valid. |
ERROR_INVALID_PARAMETER | The 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.) |
ERROR_INVALID_STATE | The object is already enabled. |
ERROR_LIBRARY_OFFLINE | The library ID refers to an off-line library that cannot be enabled or disabled. |
ERROR_OBJECT_NOT_FOUND | The object is not valid. |
ERROR_SUCCESS | The enable is queued. |
Remarks
The EnableNtmsObject function queues a disable command with RSM. If RSM is busy, the command can take some time to complete.
Requirements
Minimum supported client |
Windows 2000 Professional |
Minimum supported server |
Windows 2000 Server |
End of client support |
Windows Vista |
End of server support |
Windows Server 2008 |
Header |
Ntmsapi.h |
Library |
Ntmsapi.lib |
DLL |
Ntmsapi.dll |
See Also
Send comments about this topic to Microsoft
Build date: 6/9/2011