Platform SDK: Removable Storage Manager

SetNtmsObjectAttribute

The SetNtmsObjectAttribute function creates private data in the specified RSM object.

DWORD WINAPI SetNtmsObjectAttribute(
  HANDLE hSession,
  LPNTMS_GUID lpObjectId,
  DWORD dwType,
  LPCTSTR lpAttributeName,
  LPVOID lpAttributeData,
  DWORD dwAttributeSize
);

Parameters

hSession
Handle to the session returned by the OpenNtmsSession function.
lpObjectId
Specifies the GUID of the object for which to set the attribute.
dwType
Specifies the RSM object type. (See EnumerateNtmsObject for object types.)
lpAttributeName
Specifies the name that the extended attribute writes to one of the RSM objects.
lpAttributeData
Specifies the data to save as the RSM object attribute.
dwAttributeSize
Specifies the size of the attribute data.

Return Values

Value Meaning
ERROR_DATABASE_FAILURE The database update failed.
ERROR_INSUFFICIENT_BUFFER The buffer size is not correctly specified. The correct size is returned in the lpAttributeSize parameter.
ERROR_INVALID_HANDLE The value specified in the hSession parameter is NULL or invalid.
ERROR_INVALID_NAME The name or attribute is invalid. The NTMS_MAXATTR_NAMELEN value defines the maximum attribute name length. The length includes a NULL.
ERROR_INVALID_PARAMETER The pointer is NULL or invalid.
ERROR_NO_DATA The attribute specified is greater than or equal to NTMS_MAXATTR_LENGTH.
ERROR_NOT_CONNECTED Unable to connect to the RSM service.
ERROR_OBJECT_NOT_FOUND The GUID is invalid.
ERROR_SUCCESS The function was successful.

Remarks

The SetNtmsObjectAttribute function must be executed on the specified RSM server. Because the buffer of bytes is unmarshaled between systems of different architectures, remote execution of this function can result in unpredictable results.

To delete an attribute, perform a set of the attribute with a length of zero.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Ntmsapi.h.
  Library: Use Ntmsapi.lib.

See Also

Object Management Functions, EnumerateNtmsObject, GetNtmsObjectAttribute