Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[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
[in] hSession
Handle to the session returned by the OpenNtmsSession function.
[in] dwType
RSM object type. This parameter can be one of the following values from the NtmsObjectsTypes enumeration type.
| Value | Meaning | 
|---|---|
| 
 | Drive | 
| 
 | Library | 
| 
 | Physical media (tape, optical disk, CD, or magnetic disk cartridge) | 
[in] lpObjectId
Unique identifier of the RSM object.
Return value
This function returns one of the following values.
| Value | Meaning | 
|---|---|
| 
 | NTMS_MODIFY_ACCESS to the library containing the object is denied. Other security errors are possible, but they indicate a security subsystem error. Windows XP: NTMS_CONTROL_ACCESS to the library containing the object is denied. Other security errors are possible, but they indicate a security subsystem error. | 
| 
 | The database is inaccessible or damaged. | 
| 
 | The session handle is missing or is not valid. | 
| 
 | 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.) | 
| 
 | The object is already enabled. | 
| 
 | The library ID refers to an off-line library that cannot be enabled or disabled. | 
| 
 | The object is not valid. | 
| 
 | 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
| 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 |