SetNtmsObjectInformationW 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 SetNtmsObjectInformationW(
[in] HANDLE hSession,
[in] LPNTMS_GUID lpObjectId,
[in] LPNTMS_OBJECTINFORMATIONW 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 |
---|---|
|
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. |
|
The function was successful. |
|
The database is inaccessible or damaged. |
|
The database is full. |
|
The session handle is missing or is not valid. |
|
The object ID or information structure is missing, or the object information size or object type is not valid. |
|
An allocation failure occurred during processing. |
|
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 Windows XP: No access rights are required. |
NTMS_DRIVE | dwDeferDismountDelay 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 Windows XP: No access rights are required. |
NTMS_IEPORT | MaxExtendSecs Windows XP: No access rights are required. |
NTMS_LIBRARY | AutoRecovery |
NTMS_LIBREQUEST | szDescription Requires NTMS_MODIFY_ACCESS to the library.
Windows XP: No access rights are required. |
NTMS_LOGICAL_MEDIA | szDescription Windows XP: No access rights are required. |
NTMS_MEDIA_POOL | AllocationPolicy 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 Windows XP: Requires NTMS_CONTROL_ACCESS to the media pool of the side. |
NTMS_PHYSICAL_MEDIA | szDescription Windows XP: No access rights are required. |
NTMS_STORAGESLOT | szDescription Requires NTMS_MODIFY_ACCESS to the library.
Windows XP: No access rights are required. |
Note
The ntmsapi.h header defines SetNtmsObjectInformation as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
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 |