SetNtmsObjectInformation Function

[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

  • hSession [in]
    Handle to the session returned by the OpenNtmsSession function.

  • lpObjectId [in]
    Unique identifier of the RSM object.

  • lpInfo [in]
    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/2000:   No access rights are required.
NTMS_CHANGER_TYPE szDescription

Requires NTMS_MODIFY_ACCESS to the computer.

Windows XP/2000:   No access rights are required.
NTMS_COMPUTER dwMediaPoolPolicydwLibRequestFlagsdwLibRequestPurgeTimedwOpRequestFlagsdwOpRequestPurgeTimeszDescription

Requires NTMS_MODIFY_ACCESS to the computer.

Windows XP/2000:   No access rights are required.
NTMS_DRIVE dwDeferDismountDelayszDescription

Requires NTMS_MODIFY_ACCESS to the library.

Windows XP/2000:   No access rights are required.
NTMS_DRIVE_TYPE szDescription

Requires NTMS_MODIFY_ACCESS to the computer.

Windows XP/2000:   No access rights are required.
NTMS_IEDOOR MaxOpenSecsszDescription

Requires NTMS_MODIFY_ACCESS to the library.

Windows XP/2000:   No access rights are required.
NTMS_IEPORT MaxExtendSecsszDescription

Requires NTMS_MODIFY_ACCESS to the library.

Windows XP/2000:   No access rights are required.
NTMS_LIBRARY AutoRecoverydwCleanerUsesRemainingdwFlagsInventoryMethodszDescriptionszName

Requires NTMS_CONTROL_ACCESS to the library.

NTMS_LIBREQUEST szDescription

Requires NTMS_MODIFY_ACCESS to the library.

Windows XP/2000:   No access rights are required.
NTMS_LOGICAL_MEDIA szDescriptionszName

Requires NTMS_MODIFY_ACCESS to the media pool of the logical media.

Windows XP/2000:   No access rights are required.
NTMS_MEDIA_POOL AllocationPolicyDeallocationPolicydwMaxAllocatesMediaTypeszDescriptionszName

Requires NTMS_MODIFY_ACCESS to the media pool.

Windows XP/2000:   Requires NTMS_CONTROL_ACCESS to the media pool.
NTMS_MEDIA_TYPE szDescription

Requires NTMS_MODIFY_ACCESS to the computer.

Windows XP/2000:   No access rights are required.
NTMS_OPREQUEST szDescription

Requires NTMS_MODIFY_ACCESS to the computer.

Windows XP/2000:   No access rights are required.
NTMS_PARTITION szNameszDescription

Requires NTMS_MODIFY_ACCESS to the media pool of the side.

Windows XP/2000:   Requires NTMS_CONTROL_ACCESS to the media pool of the side.
NTMS_PHYSICAL_MEDIA szDescriptionszName

Requires NTMS_MODIFY_ACCESS to the media pool.

Windows XP/2000:   No access rights are required.
NTMS_STORAGESLOT szDescription

Requires NTMS_MODIFY_ACCESS to the library.

Windows XP/2000:   No access rights are required.

 

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

Unicode and ANSI names

SetNtmsObjectInformationW (Unicode) and SetNtmsObjectInformationA (ANSI)

See Also

Object Management Functions

GetNtmsObjectInformation

GetNtmsObjectSecurity

NTMS_OBJECTINFORMATION

 

 

Send comments about this topic to Microsoft

Build date: 6/9/2011