SetNtmsObjectInformation function (ntmsapi.h)

[Removable Storage Manager is no longer available as of Windows 7 and Windows Server 2008 R2.]

The SetNtmsObjectInformation function changes the information structure of the specified object.

Syntax

DWORD SetNtmsObjectInformation(
  [in] HANDLE                   hSession,
  [in] LPNTMS_GUID              lpObjectId,
  [in] LPNTMS_OBJECTINFORMATION lpInfo
);

Parameters

[in] hSession

Handle to the session returned by the OpenNtmsSession function.

[in] lpObjectId

Unique identifier of the RSM object.

[in] lpInfo

Pointer to an NTMS_OBJECTINFORMATION structure.

Return value

This function returns one of the following values.

Value Meaning
ERROR_ACCESS_DENIED
NTMS_MODIFY_ACCESS or NTMS_CONTROL_ACCESS is denied to the object being written or no modifications are allowed to the object type specified. See Remarks.
ERROR_SUCCESS
The function was successful.
ERROR_DATABASE_FAILURE
The database is inaccessible or damaged.
ERROR_DATABASE_FULL
The database is full.
ERROR_INVALID_HANDLE
The session handle is missing or is not valid.
ERROR_INVALID_PARAMETER
The object ID or information structure is missing, or the object information size or object type is not valid.
ERROR_NOT_ENOUGH_MEMORY
An allocation failure occurred during processing.
ERROR_OBJECT_NOT_FOUND
The object ID is not valid.

Remarks

The information size and type must be set before you can use SetNtmsObjectInformation.

All writable properties for the object are read from the NTMS_OBJECTINFORMATION structure and written to the database without regard for any write operations that have occurred between the time this application called the GetNtmsObjectInformation function and the SetNtmsObjectInformation function. Because of this you can lose changes.

To avoid unpredictable results, applications must call GetNtmsObjectInformation before calling SetNtmsObjectInformation. As noted above, SetNtmsObjectInformation updates all writable members, therefore the application is responsible for providing a value for all writable members.

The following is the list of objects that have members that can be updated.

Object Members
NTMS_CHANGER szDescription Requires NTMS_MODIFY_ACCESS to the library.

Windows XP:   No access rights are required.

NTMS_CHANGER_TYPE szDescription Requires NTMS_MODIFY_ACCESS to the computer.

Windows XP:   No access rights are required.

NTMS_COMPUTER dwMediaPoolPolicy
 
dwLibRequestFlags
 
dwLibRequestPurgeTime
 
dwOpRequestFlags
 
dwOpRequestPurgeTime
 
szDescription Requires NTMS_MODIFY_ACCESS to the computer.

Windows XP:   No access rights are required.

NTMS_DRIVE dwDeferDismountDelay
 
szDescription Requires NTMS_MODIFY_ACCESS to the library.

Windows XP:   No access rights are required.

NTMS_DRIVE_TYPE szDescription Requires NTMS_MODIFY_ACCESS to the computer.

Windows XP:   No access rights are required.

NTMS_IEDOOR MaxOpenSecs
 
szDescription Requires NTMS_MODIFY_ACCESS to the library.

Windows XP:   No access rights are required.

NTMS_IEPORT MaxExtendSecs
 
szDescription Requires NTMS_MODIFY_ACCESS to the library.

Windows XP:   No access rights are required.

NTMS_LIBRARY AutoRecovery
 
dwCleanerUsesRemaining
 
dwFlags
 
InventoryMethod
 
szDescription
 
szName Requires NTMS_CONTROL_ACCESS to the library.
NTMS_LIBREQUEST szDescription Requires NTMS_MODIFY_ACCESS to the library.

Windows XP:   No access rights are required.

NTMS_LOGICAL_MEDIA szDescription
 
szName Requires NTMS_MODIFY_ACCESS to the media pool of the logical media.

Windows XP:   No access rights are required.

NTMS_MEDIA_POOL AllocationPolicy
 
DeallocationPolicy
 
dwMaxAllocates
 
MediaType
 
szDescription
 
szName Requires NTMS_MODIFY_ACCESS to the media pool.

Windows XP:   Requires NTMS_CONTROL_ACCESS to the media pool.

NTMS_MEDIA_TYPE szDescription Requires NTMS_MODIFY_ACCESS to the computer.

Windows XP:   No access rights are required.

NTMS_OPREQUEST szDescription Requires NTMS_MODIFY_ACCESS to the computer.

Windows XP:   No access rights are required.

NTMS_PARTITION szName
 
szDescription Requires NTMS_MODIFY_ACCESS to the media pool of the side.

Windows XP:   Requires NTMS_CONTROL_ACCESS to the media pool of the side.

NTMS_PHYSICAL_MEDIA szDescription
 
szName Requires NTMS_MODIFY_ACCESS to the media pool.

Windows XP:   No access rights are required.

NTMS_STORAGESLOT szDescription Requires NTMS_MODIFY_ACCESS to the library.

Windows XP:   No access rights are required.

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

See also

GetNtmsObjectInformation

GetNtmsObjectSecurity

NTMS_OBJECTINFORMATION

Object Management Functions